Home » SQL & PL/SQL » SQL & PL/SQL » Inserting data dynamically
Inserting data dynamically [message #39135] Wed, 19 June 2002 03:00 Go to next message
Deepak Khemani
Messages: 5
Registered: April 2002
Junior Member
Hi all....
There is a situation where I have got stuck..
There is a table which has following field... JAN_CNSMPTN, JAN_YR, FEB_CNSMPTN, FEB_YR, MAR_CNSMPTN, MAR_YR, APR_CNSMPTN, APR_YR and so on till december...
Here we want to update the table. The point here is we have to update one field according to the current month.
For eg if we have the month as 'JAN' then we update the field JAN_CNSMPTN. I donot want to write various IF ELSIF statment. Is there a way where this can be done dynamically.
Re: Inserting data dynamically [message #39136 is a reply to message #39135] Wed, 19 June 2002 03:46 Go to previous message
month
Messages: 1
Registered: June 2002
Junior Member
execute immediate
'update your_table set '||to_char(sysdate,'mon')||'_CNSMPTN = your_new_value where ...... ' ;
Previous Topic: DatabaseLinks
Next Topic: question
Goto Forum:
  


Current Time: Thu Apr 25 22:23:28 CDT 2024