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: CASE Statement Question -- Can this be done?

Re: CASE Statement Question -- Can this be done?

From: Volker Hetzer <volker.hetzer_at_ieee.org>
Date: Mon, 08 May 2006 16:31:40 +0200
Message-ID: <e3nkoc$7lr$1@nntp.fujitsu-siemens.com>


amerar_at_iwc.net schrieb:
> 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 Received on Mon May 08 2006 - 09:31:40 CDT

Original text of this message

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