Home » SQL & PL/SQL » SQL & PL/SQL » Dynamic SQL
Dynamic SQL [message #19619] Mon, 01 April 2002 19:36 Go to next message
Mahesh
Messages: 90
Registered: January 2001
Member
I need to dynamically specify column in update statemnt. This apparently does not work.

For example:

'UPDATE EMP SET ENAME = :NAME WHERE EMPNO=:ENO' works perfectly.

But

'UPDATE EMP SET :F1 = :NAME WHERE EMPNO=:ENO' does not work.

Any help will be greatly appreciated.

Thanks
Mahesh
Re: Dynamic SQL [message #19620 is a reply to message #19619] Mon, 01 April 2002 19:52 Go to previous messageGo to next message
Nilesh Mahajan
Messages: 10
Registered: March 2002
Junior Member
I think Mahesh instead of using :F1 for the column name if you will generate the sql using the concat string function and then if this sql is executed It will work.
Just try.
Re: Dynamic SQL [message #19622 is a reply to message #19620] Mon, 01 April 2002 21:07 Go to previous message
Mahesh
Messages: 90
Registered: January 2001
Member
Thank you Nilesh for the information. It worked perfectly fine.

Thanks
Mahesh
Previous Topic: to store the sql st in d/b
Next Topic: math
Goto Forum:
  


Current Time: Fri Mar 29 00:04:13 CDT 2024