Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: set defaults for $1?

Re: set defaults for $1?

From: Dons <m.v.vandonselaar_at_donotspam.kpn.com>
Date: Fri, 08 Dec 2000 16:30:49 +0100
Message-ID: <ddu13tg3pg1is41fj4sc6hj1bg6ldt9ags@4ax.com>

On Fri, 08 Dec 2000 12:34:20 +0100, Jan Haase <jh_at_informationsdesign.de> wrote:

>Hi.
>
>I've got a problem using Oracle 8:
>
>I want an index to be created with a size given on command line to the .sql-script. It looks like this:
>
>foo.sql:
> create index index1 on table1 (column1)
> tablespace ts1
> pctfree 4
> storage (initial $1 next $2)
> unrecoverable;
>
>But what can I do if a user forgets to provide this size on command line? Is there any possibility to set a default if $1 is empty?
>
>Thanks for any hints,
>
>Jan

Rewrite the script like this:

column i_value new_value i_value noprint; column n_value new_value n_value noprint;

select decode(&1,null,<default_value>) i_value from dual; select decode(&2,null,<default_value>) n_value from dual;

create index index1 on table1 (column1)
tablespace ts1
pctfree 4
storage (initial &i_value next &n_value) unrecoverable;

hth,

Martin Received on Fri Dec 08 2000 - 09:30:49 CST

Original text of this message

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