Re: Executing stored SQL statements
Date: 1997/07/12
Message-ID: <33C7F842.B28BBC05_at_bryan.prestel.co.uk>#1/1
This is a multi-part message in MIME format.
--------------DF058BA3F5C653D36430382F Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit
Hi,
Take a look at DBMS_SQL in PL/SQL. It can do all of this, and more.
Bryan
Bryan Dollery BSC.(Hons).
MD - ByteSmart Systems Ltd.
Rick Musgrove wrote:
>
> Can anyone give me some suggestions as to how to retrieve SQL statements
> from a table and then execute them in a procedure and then execute them?
> I want to store rules in a table, then use them to create a relation
> between two entities.
>
> i.e. BEGIN
> update case_record set case_record.clerk_id = rules.clerk_id
> where case_record.case_record_id = :case_record_id
> and (select rule from rules);
> END;
>
> I would like to do this *without* building a procedure.sql file and then
> executing it, because I need to know if the rule was a 'hit' or not.
>
> Is there a way set a declared variable to an sql statement string and
> then execute the contents of the variable as an sql statement, updating
> other variables declared in the procedure?
>
> Rick.
--------------DF058BA3F5C653D36430382F Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf" Content-Transfer-Encoding: 7bit Content-Description: Card for Bryan Dollery Content-Disposition: attachment; filename="vcard.vcf" begin: vcard fn: Bryan Dollery n: Dollery;Bryan org: ByteSmart Systems Ltd. email;internet: bryan_at_bryan.prestel.co.uk note: Consultant Software Engineer=0A=
B.Sc. (Hons). Software Engineering
=0A=
MD - ByteSmart Systems Ltd.
x-mozilla-cpt: ;0
x-mozilla-html: TRUE
end: vcard
--------------DF058BA3F5C653D36430382F-- Received on Sat Jul 12 1997 - 00:00:00 CEST