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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: SQL Question - using a var. in create

Re: SQL Question - using a var. in create

From: David Kurlowich - MIS <dkurlow_at_SCETV.STATE.SC.US>
Date: Mon, 22 Jan 1996 16:07:43 -0500
Message-Id: <9601222133.AA07653@alice.jcc.com>


Wouldn't it be something more like &&prefix||'HSCH'?



From: Joe Johnson[SMTP:HCC_JOHNSON_at_DELPHI.COM] Sent: Monday, January 22, 1996 3:08 PM
To:     Multiple recipients of list ORACLE-L
Subject:        SQL Question - using a var. in create

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?

Thanks!

Joe Johnson
Highland Community College

begin 600 WINMAIL.DAT

M>)\^(BP5`0:0" `$```````!``$``0>0!@`(````Y 0```````#H``$-@ 0`
M`@````(``@`!!) &`#P!```!````# ````,``# #````"P`/#@`````"`?\/
M`0```%0`````````@2L?I+ZC$!F=;@#=`0]4`@````!/4D%#3$4_at_9&%T86)A
M<V4@;6%I;&EN9R!L:7-T+@!33510`$]204-,12U,0&-C=FTN<W5N>7-B+F5D
M=0`>``(P`0````4```!33510`````!X``S !````&0```$]204-,12U,0&-C
M=FTN<W5N>7-B+F5D=0`````#`!4,`0````,`_@\&````'@`!, $````@````
M)T]204-,12!D871A8F%S92!M86EL:6YG(&QI<W0N)P`"`0LP`0```!X```!3 M3510.D]204-,12U,0$-#5DTN4U5.65-"+D5$50````,``#D`````"P! .@$` M```"`?8/`0````0````````#E3L!"( '`!@```!)4$TN36EC<F]S;V9T($UA
M:6PN3F]T90`Q" $$@ $`*@```%)%.B!344P_at_475E<W1I;VX@+2!U<VEN9R!A
M('9A<BX@:6X_at_8W)E871E`(\-`06 `P`.````S <!`!8`$ `'`"L``0`M`0$@
M@ ,`#@```,P'`0`6`! `!@`Z``$`.P$!"8 !`"$```!",S,P,D1!-3E"-31#
M1C$Q0D4S14%!,# P-# P-D$R0P`D!P$#D 8`1 8``!(````+`",```````,`
M)@``````"P`I```````#`#8``````$ `.0`@OO2K#>FZ`1X`< `!````*@``
M`%)%.B!344P_at_475E<W1I;VX@+2!U<VEN9R!A('9A<BX@:6X_at_8W)E871E````
M`@%Q``$````6`````;KI#:OTI2TPM52;$<^^/JH`! !J+ ``'@`># $````%
M````4TU44 `````>`!\,`0```!H```!D:W5R;&]W0'-C971V+G-T871E+G-C M+G5S`````P`&$)'[B%X#``<0J ,``!X`"! !````90```%=/54Q$3E1)5$)% M4T]-151(24Y'34]214Q)2T4F)E!2149)6$A30T@_+2TM+2TM+2TM+4923TTZ M2D]%2D](3E-/3E--5% Z2$-#2D](3E-/3D!$14Q02$E#3TU314Y4.DU/3D0` M`````@$)$ $```"N! ``J_at_0```<)``!,6D9U+5BAJ?\`"@$/`A4"J 7K`H,` M4 +R"0(`8V@*P'-E=#(W!@`&PP*#,@/%`@!P<D)Q$>)S=&5M`H,SMP+D!Q," M_at_S02S!3(-0-%=Q,T$5\"@S8#1@=M`H,WMQ<+&;\"DC@"Y!(&?0J BPC/"=D[ M'O\R-34@'_!E,3(X(6,A,1],'B&##:(+8&YG,3 S%%"7"PH440OR8P! (%<( M8%!L9&XG!4!I!4!B6&4@<P-P$<!H"X!GAB $8!\`(&QI:R=0#"8F$U -P&EX M?'R )TA30T_at_G/PJ+$2A@,3_at_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W!@ M0G1G3V%A[F1,,"<0$;!L0 !T\4:0/RC4"H6 =( 4=2)74B=VVW'Q"(%D=B]5 M5"<HMBE3]7E=(BBV(HQY2W8#H ;@KTT14A 1L%14)VMC(D: _R_at_Q"X!:X2C1 M$]!,,"A_at_6N&]2L%Y5U)44R_at_Q1I!W./!?3U2()DU1*;8*A508`&YX:W,A1YPR M&0J%2I!G_F_at_D@4PP"%!RD'"@)Q YD/\(4%(QA3!'GTBO2;P*A1XA`@"=8 `` M`P`0$ `````#`!$0`````$ `!S#@P#V1#>FZ`4 `"##@P#V1#>FZ`1X`/0`! 1````!0```%)%.B `````LNP`
`
end Received on Mon Jan 22 1996 - 16:33:58 CST

Original text of this message

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