Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: SQL Question - using a var. in create
Hi,
I had to something like that some days ago, try
&&prefix.HSCH
regards
Susanne Stolpe
Ruhr-Uni-Bochum, FRG
Joe Johnson wrote :
>Hi all.
>
>I need some help with this one. Here's what I'm trying to do:
>
>1. Execute a script called create_tables.sql that prompts the user
> for a "table name prefix". I need to create similar tables each
> semester each with the same last 4 characters but starting with a
> different profix (i.e. F96HSCH, S96HSCH, U96HSCH, etc.). My "create"
> script does this:
>
> ACCEPT prefix PROMPT CHAR 'Enter a tablename prefix:'
>
> and the user would enter S96 for example.
>
>2. Next a second script runs that does a create table command using that
> variable as part of the name:
>
> CREATE TABLE &&prefixHSCH
> ...
>
> resulting in a table name like S96HSCH, tacking the suffix HSCH to the
> variable name.
>
>No matter what I do, I can't get the pfix variable to add itself as a prefix
>to the HSCH part. I've tried:
>
> '&&prefix'HSCH
> "&&prefix"HSCH
>
>In both cases the ' and " are interpreted literally. Is there a way to do
>this?
>
Received on Thu Jan 25 1996 - 14:56:46 CST