Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Dynamic PL/SQL and Column Name

Re: Dynamic PL/SQL and Column Name

From: Radu Lascae <r.nospam.lascae_at_wanadoo.nl>
Date: Thu, 11 Oct 2001 17:38:56 GMT
Message-ID: <QOkx7.98$_14.603@castor.casema.net>


Matt,

What is the error? The syntax appears correct to me, but I'd have to assume that all variables are characters, not numbers. Also I'd put || ';' at the end of the string.

If it's a runtime error, things are different: you're sql needs to be legal.

Regards,
Radu

"Matthew Cunningham" <mcunning_at_vcs.org.au> wrote in message news:CA6x7.20$kg.576_at_wa.nnrp.telstra.net...
> Hi
>
> I am trying to write Dynamic PL/SQL to update a record depending on a
column
> name:
>
> eg:
> DBMS_SQL.PARSE(v_CursorId,
> ' UPDATE rptwork_cler_prod '||
> ' SET '||p_ColumnName||' = '||p_ColumnName||' +
1'||
> ' WHERE userid = '|| p_UserId||
> ' AND rptrun_id = '|| p_RptRun_Id ,
> DBMS_SQL.V7);
>
> The column name is passed in as a variable. Can I do this? It does not
> seem to like it!
>
> Any help would be appreciated.
>
> Thanks
> Matt
>
>
Received on Thu Oct 11 2001 - 12:38:56 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US