Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Object not found error
Message
From
11/04/2000 15:00:55
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00358259
Message ID:
00358272
Views:
11
>I am baffled by this sql select problem. When use select (count) first time as follows:
>
>Select count(employee.e_lname) from employee where employee.e_lname == .txtlname.value;
>into array a__gen1
>
>
>everything is ok and I get my results, but when use select statement as follows:
>
>Select employee.e_id. employee.e_lname, employee.e_ssn from employee;
>where employee.e_lname == .txtlname.value into array a__gen1
>
>I get an error saying "object EMPLOYEE is not found". The complete code is below. I don't understand why it can find my table with first select, but not the second time. around.
>
>
>Case !empty(.txtlname.value) and empty(.txtssn.value)
>Select count(employee.e_lname) from employee where employee.e_lname == .txtlname.value;
>into array a__gen1
>
>If type('a__gen1') # 'U' and type('a__gen1') # 'L'
>.hldcnt = a__gen1(1,1)
>Release a__gen1
>Do case && case4-1
>
>Case .hldcnt = 1 && case4-1a
>Select employee.e_id. employee.e_lname, employee.e_ssn from employee;
>where employee.e_lname == .txtlname.value into array a__gen1
>
>
>Thanks
>Nick Patel

Nick,

Assuming this is a cut and paste from your code, you have a typo.

>Select employee.e_id [.] employee.e_lname, employee.e_ssn from employee;
>where employee.e_lname == .txtlname.value into array a__gen1

The [.] should be a comma thus ... Also, just a readability issue I tend to format my sql code with one thing per line ... ie ...

Select ;
employee.e_id, ;
employee.e_lname, ;
employee.e_ssn ;
from employee ;
where employee.e_lname == .txtlname.value ;
into array a__gen1

That way when I have to debug code, it is easier for me to read.

Hope this helps.

Regards,

Jason
Jason Tryon
Senior Systems Analyst / Technical Lead
eBusiness / iPage
Previous
Reply
Map
View

Click here to load this message in the networking platform