Subject | Problem using - for select do |
---|---|
Author | Grant Brown |
Post date | 2005-04-26T02:25Z |
Hi all,
When I run the following query against the stored procedure listed below
I only seem to get 1 name coming back when I should get 5
Can someone show me what I ab doing wrong
------- Query ------------------
try
GetPersons.Transaction.StartTransaction;
GetPersons.Prepare;
GetPersons.ExecQuery;
while not GetPersons.EOF do
begin
Log_Per_Name_List.Items.Add(GetPersons.FieldByName('FNAME').AsString);
.....
.....
.....
GetPersons.Next;
end;
GetPersons.Transaction.Commit;
except
begin
GetPersons.Transaction.Rollback;
raise;
end;
end;
------- Stored Procedure -------------
declare variable TempID BigInt=0;
declare variable F_Name VarChar(160);
declare variable F_Word VarChar(80);
begin
for select DETECTID, FIRSTNAME||' '||LASTNAME,PSWORD from CONTACTS
into :TempID,:F_Name,:F_Word
do
begin
ID=:TempID;
FNAME=:F_Name;
PWORD=:F_Word;
end
suspend;
end
--
Regards,
Grant Brown
Product Development Manager
Phone : 02 4229 1185
Mobile : 0412 926 995
Email : grant@...
Web : www.sitedoc.com.au
SiteDoc - Easy to Use - Powerful Results
When I run the following query against the stored procedure listed below
I only seem to get 1 name coming back when I should get 5
Can someone show me what I ab doing wrong
------- Query ------------------
try
GetPersons.Transaction.StartTransaction;
GetPersons.Prepare;
GetPersons.ExecQuery;
while not GetPersons.EOF do
begin
Log_Per_Name_List.Items.Add(GetPersons.FieldByName('FNAME').AsString);
.....
.....
.....
GetPersons.Next;
end;
GetPersons.Transaction.Commit;
except
begin
GetPersons.Transaction.Rollback;
raise;
end;
end;
------- Stored Procedure -------------
declare variable TempID BigInt=0;
declare variable F_Name VarChar(160);
declare variable F_Word VarChar(80);
begin
for select DETECTID, FIRSTNAME||' '||LASTNAME,PSWORD from CONTACTS
into :TempID,:F_Name,:F_Word
do
begin
ID=:TempID;
FNAME=:F_Name;
PWORD=:F_Word;
end
suspend;
end
--
Regards,
Grant Brown
Product Development Manager
Phone : 02 4229 1185
Mobile : 0412 926 995
Email : grant@...
Web : www.sitedoc.com.au
SiteDoc - Easy to Use - Powerful Results