Traci, it is.... adr is the alias for the procedure (looking like a table).... normally fields from adr would be selected as adr."Street" or adr."Suburb".

As I said, it looks wierd only because I have stripped it down.... there are normally a pageful of fields selected from upto 6 procedures and a dozen joined tables with a pageful of where clauses.

Everything works fine, unless there are no loj's - then interbase seems to get confused. I suppose in my query builder I can add a dummy loj when none are required.

Traci Sumpter wrote:

The From needs to be After all the fields you want to selsect ..

eg.

select count (cln."Ref_Number")
, "Get_Address" ('PST','C',cln."Ref_Number") adr
from
"Client_Main" cln
where cln."Status" = 'A'
order by cln."First_Name"


-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Rohit Gupta Sent: Thursday, 12 June 2003 4:10 p.m. To: Multiple recipients of list delphi Subject: [DUG]: SQL foolishness


Does anyone know why the first sql gives the error "No current record for fetch operation" and the second one works (basically as long as I have a loj with anything it works)


select count (cln."Ref_Number") from "Client_Main" cln , "Get_Address" ('PST','C',cln."Ref_Number") adr where cln."Status" = 'A' order by cln."First_Name"

select count (cln."Ref_Number") from
"Client_Main" cln
left outer join "Client_Main" cl2 on cl2."Ref_Number" = cln."Ref_Number"
, "Get_Address" ('PST','C',cln."Ref_Number") adr
where cln."Status" = 'A'
order by cln."First_Name"

P.S.  it looks wierd only because this is the smallest fragment that
produces the
problem.








---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/

Reply via email to