Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Object not found error
Message
De
11/04/2000 15:04:09
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00358259
Message ID:
00358273
Vues:
10
>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,

Stupid me, I forgot to put in the html tags to indent the SQL Code sample I sent to you.

One other thing. When i use an aggregate function in SQL, in this case count() I use the following syntax ...

SELECT COUNT(mycolumn) AS cnt_mycolumn FROM mytable

Otherwise one ends up with a column called Expr1 or some such which isn't particularly useful

Regards,

Jason
Jason Tryon
Senior Systems Analyst / Technical Lead
eBusiness / iPage
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform