Subject RE: [firebird-support] Problem with Execute statement
Author Paul Mercea
Hi
When I try the procedure in procedure debugger it's working but when I try
to run I get error!!!

PaulM

-----Original Message-----
From: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com] On Behalf Of Paul Mercea
Sent: Saturday, April 08, 2006 6:51 PM
To: firebird-support@yahoogroups.com
Subject: [firebird-support] Problem with Execute statement

Hi

I want to create generic procedure to execute sql statements passed as
variable.
I have made this test procedure to verify if is working:

CREATE PROCEDURE T2 (
T VARCHAR(20))
RETURNS (
IDN VARCHAR(30),
IDL INTEGER)
AS
DECLARE VARIABLE STRSQL VARCHAR(50);
begin
strsql='select loc_id, loc_name from '||T;
for execute statement :strsql into :idl, :idn do
begin
suspend;
end

end

I pass table name (SYS_LOCATION) and I get this error message:
"Variable type (position 0) in EXECUTE STATEMENT 'select loc_id, loc_name
from SY' INTO does not match returned column type.
Password required"
If I change strsql='select loc_id, loc_name from '||T||' '; I get message:
"Variable type (position 1) in EXECUTE ......"
Same message if I modify like this:
strsql='select loc_id, loc_name from ';
for execute statement :strsql ||T into :idl, :idn do

What I'm doing wrong????

TIA
PaulM



++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Visit http://firebird.sourceforge.net and click the Resources item
on the main (top) menu. Try Knowledgebase and FAQ links !

Also search the knowledgebases at http://www.ibphoenix.com

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Yahoo! Groups Links