Subject RE: [firebird-support] Dynamic Stored Procedure
Author Moegamat Alexander
Hi

Thanx for the help .. I eventualy ended up with ..

stmnt1 = 'select GEN_ID(DOCTYPE'||:SALESTYPE_in||',1) from dual';
for execute statement :stmnt1 into :newdocid do
begin
newdocid = docsufix||newdocid;
end

Which seems after limited testing to do what I want

Regards

M

>>> Svein Erling Tysvær <svein.erling.tysvaer@...> 2008/03/05 04:50:08 pm >>>
Try || rather than +

stmnt1 = 'select :docsusufix+GEN_ID(DOCTYPE' || :SALESTYPE_in || ',1) from dual';

HTH,
Set

-----Original Message-----
From: firebird-support@yahoogroups.com [mailto:firebird-support@yahoogroups.com] On Behalf Of Moegamat Alexander
Sent: 5. mars 2008 15:42
To: firebird-support@yahoogroups.com
Subject: Re: [firebird-support] Dynamic Stored Procedure

Hi

I thought that by replacing that lame code with the very lean code
below now I get an "Expression evaluation not supported error"

Mayby I need to this in two steps no?

M

stmnt1 = 'select :docsusufix+GEN_ID(DOCTYPE'+:SALESTYPE_in+',1) from
dual';
for execute statement :stmnt1 into :newdocid do
begin
/* */
end

>>> "Moegamat Alexander" <alexanderm@...> 2008/03/05 04:23:51 pm
>>>
Ooops Sorry the FB version 203 Win32 Build

>>> "Martijn Tonies" <m.tonies@...> 2008/03/05 04:19:29 pm >>>
Hi,

It depends on your version of Firebird, but you didn't mention the
version you're using.

Firebird 1.5 has [FOR] EXECUTE STATEMENT that can be
used to execute dynamic SQL in PSQL code.

Take a look at the Release Notes.

Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB,
Oracle &
MS SQL Server
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com



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

Visit http://www.firebirdsql.org 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