dbTalk Databases Forums  

CASE Statement Question -- Can this be done?

comp.databases.oracle.misc comp.databases.oracle.misc


Discuss CASE Statement Question -- Can this be done? in the comp.databases.oracle.misc forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
amerar (AT) iwc (DOT) net
 
Posts: n/a

Default CASE Statement Question -- Can this be done? - 05-08-2006 , 09:25 AM






Hi All,

I need to create a script that can be run on different databases to
create some objects. Problem is, the databases have different layouts,
ie: the tablespaces are different.

Can I use the CASE statement to select a tablespace name from
dba_tablespaces, and if the tablespace exists, create the objects in
that tablespace, else create them in another?

So, the CASE statement would also have DDL statements..........

If I cannot do it this way, I'm open to other suggestions.

Thank you in advance.


Reply With Quote
  #2  
Old   
Volker Hetzer
 
Posts: n/a

Default Re: CASE Statement Question -- Can this be done? - 05-08-2006 , 09:31 AM






amerar (AT) iwc (DOT) net schrieb:
Quote:
Hi All,

I need to create a script that can be run on different databases to
create some objects. Problem is, the databases have different layouts,
ie: the tablespaces are different.

Can I use the CASE statement to select a tablespace name from
dba_tablespaces, and if the tablespace exists, create the objects in
that tablespace, else create them in another?

So, the CASE statement would also have DDL statements..........

If I cannot do it this way, I'm open to other suggestions.

Thank you in advance.
You could do a little pl/sql procedure that expects a rudimentary ddl statement,
completes it with the tablespace information and executes it.
Your install script first installs the procedure and then calls it with the ddl.

Lots of Greetings!
Volker


Reply With Quote
  #3  
Old   
amerar (AT) iwc (DOT) net
 
Posts: n/a

Default Re: CASE Statement Question -- Can this be done? - 05-08-2006 , 11:11 AM




Good idea......all done!


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.