Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Not Unique and must be Qualified
Message
From
27/10/2009 17:10:18
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01431714
Message ID:
01431761
Views:
35
>>>Hi Gang!
>>>
>>>The code below gives me an error....
>>>
>>>" 'Plan_ID' is not unique and must be qualified"
>>>
>>>
>>>SELECT n_505_f5,n_509_f9,plan_id,tp_order,n_503_f3,;
>>>	n_558_aw,n_559_ax,n_507_f7,n_506_f6,n_409_d9, ;
>>>	n_504_f4, n_526_fq ;
>>>	FROM rx_claim, third_party_plans ;
>>>	WHERE (rx_claim.rx_no = rx.rx_no);
>>>		AND (rx_claim.refill_no = rx.refill_no) AND ((rx_claim.statuscode = 2) OR (rx_claim.statuscode = 4));
>>>		AND (rx_claim.n_103_a3 = "B1") ;
>>>		AND (rx_claim.plan_id = third_party_plans.plan_id) ;
>>>		ORDER BY rx_claim.tp_order DESC INTO CURSOR csrMultiThirdParty
>>>
>>>
>>>In rx_claim, Plan_ID refers to the Plan_ID in the Third_party_plans... the Plan_ID is unique in third_party_plans...
>>>
>>>So, what should I look for? First time I've run across this error!!!!
>>>
>>>Thanks!
>>
>>It wants to know which plan_id to use in the select (even though YOU know it is the same value).
>
>I must have lost my eyesight!
>
>Egads!!! I have looked at this SELECT for about 4 HOURS and did not see the PLAN_ID in the first line!!!!
>
>Thanks!

I've generated that error so many times I automatically do a search for the offending column name. It always does a better job than my eyeballs!

I've also gotten into the habit of putting each column on its own line to improve readability. Strictly a personal preference.
SELECT ;
	n_505_f5, ;
	n_509_f9, ;
	plan_id, ;
	tp_order, ;
	n_503_f3, ;
	n_558_aw, ;
	n_559_ax, ;
	n_507_f7, ;
	n_506_f6, ;
	n_409_d9, ;
	n_504_f4, ;
	n_526_fq ;
FROM rx_claim, third_party_plans ;
WHERE (rx_claim.rx_no = rx.rx_no);
	AND (rx_claim.refill_no = rx.refill_no) AND ((rx_claim.statuscode = 2) OR (rx_claim.statuscode = 4));
	AND (rx_claim.n_103_a3 = "B1") ;
	AND (rx_claim.plan_id = third_party_plans.plan_id) ;
ORDER BY rx_claim.tp_order DESC ;
INTO CURSOR csrMultiThirdParty
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform