Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Prepared statement within a stored procedure loop
In article <7js67s$ssl$1_at_nnrp1.deja.com>, mozkill_at_my-deja.com writes
>Does anyone have a rough idea of what the syntax for a prepared
>statement would be inside a loop of a stored procedure.
>
>Example:
>
>while x < 10
> preparedStatement = "SELECT label" + x + " FROM field" + x + " WHERE
>item = "somestring"
>execute(preparedstatement)
>end loop
>
>i realize the syntax above is all screwed up.
It looks like you should be looking and the DBMS_SQL package in order to create dynamic SQL.
Andy
> any help would be
>appreciated, or a GOOD url. notice how the table and field element
>dynamically change according to the value of "x"
>
>send a carbon copy of your reply to jonx.williams_at_intel.com
>
>thanks a bunch
>
>
>Sent via Deja.com http://www.deja.com/
>Share what you know. Learn what you don't.
--
Andy Hardy. PGP key available on request