Re: dynamic SQL within a Routine
Posted in 2000
You cannot create Dynamic statements within Stored Procedure.
Harinath Venkata
Svenska Handelsbanken
Peter Hamm <hamm@dbs.informatik.uni-muenchen.de> on 02/10/2000 09:30:39 AM
Please respond to Peter Hamm <hamm@dbs.informatik.uni-muenchen.de>
To: informix-list@iiug.org
cc: (bcc: Harinath Venkata/HAVE01/SHB)
Subject: dynamic SQL within a Routine
This is a multi-part message in MIME format.
--------------D5407F91526F4F532BE9DF97
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Hi,
is it possible to create a dynamic statement in a function like this:
CREATE FUNCTION find ( db char(30), where_clause varchar )
RETURNING SET(INTEGER NOT NULL)
DEFINE foundVar SET (INTEGER NOT NULL);
DEFINE tab_db CHAR(30);
DEFINE pred VARCHAR;
SELECT oid INTO foundVar
FROM tab_db = db
WHERE pred = where_clause;
RETURN foundVar;
END FUNCTION;
Does anybody know how I can create a dynamic statement within a routine?
Thanks for your advice.
peter
--------------D5407F91526F4F532BE9DF97
Content-Type: text/x-vcard; charset=us-ascii;
name="hamm.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Peter Hamm
Content-Disposition: attachment;
filename="hamm.vcf"
begin:vcard
n:Hamm;Peter
tel;cell:+49 171 / 8 98 48 00
tel;fax:+49 89 / 48 00 24 21
tel;home:+49 89 / 48 00 24 20
x-mozilla-html:TRUE
org:University of Munich;Computer Science
adr:;;Comeniusstrasse 3 / Rgb;Munich;Bavaria;81667;Germany
version:2.1
email;internet:hamm@dbs.informatik.uni-muenchen.de
x-mozilla-cpt:;9536
fn:Peter Hamm
end:vcard
--------------D5407F91526F4F532BE9DF97--