Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Using Case statement to insert,update,delete the tables

567540Nov 7 2008 — edited Nov 7 2008
Hi All,

I have to check the databse ,
if it is developement then
insert/update/delete values in tables;
if it staging then
insert/update/delete values in tables;
if it is production then
insert/update/delete values in tables;

thers is function available to check the current database

For doing the about i am trying to write CASE statement like this

SELECT function,
case
when fun = 'developement' then insert into table1 values ('abcd','1234')
when fun = 'staging' then insert into table1 values ('abcd','1234')
when fun= 'production' then insert into table1 values ('abcd','1234')
else null
from dual

its throughing me an error
please help

Thanks,
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 5 2008
Added on Nov 7 2008
7 comments
1,711 views