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 -> SQL-Plus &variables in HINT

SQL-Plus &variables in HINT

From: Christian Bantzer <bantzerc_at_orca.akctr.noaa.gov>
Date: 1998/03/31
Message-ID: <Pine.SGI.3.95.980331160418.20470A-100000@orca.akctr.noaa.gov>#1/1

Hi,

I have too peeves with the SQL-Plus handling of &variables, any help with which I would surely appreciate.

  1. if you want to substitute the value of an &variable in the middle of a string you need to somehow tell sql-Plus where the variable name ends and the string continues. By default a . will do that. like in

partone&variable.parttwo

that's all fine and good if you only need to do that once in your script. if you try something like

partone&&variable.parttwo
blahone&variable.blahtwo

SQL-plus will not replace the . before blahtwo and your script won't work. If you leave the . away your script won't work either because it will ask for a value for variableblahtwo.

OK, that is just an annoyance, since you always can repeatedly enter the value for &variable (i.e. not use the &&) here's the one I really need help with.

2) If you want to use a &variable within a hint it doesn't work at all. like in

select --+ INDEX(tablename IDX_TAB_&yy._PK)

Any help surely appreciated

                     Thanks
                           Christian
==========================================================================
Christian Bantzer                                   PSMFC-PacFIN F/AKC
christian_bantzer_at_psmfc.org                         Bldg. 4 Rm. 2066   
phone (206) 526 4057                                7600 SandPoint Wy. NE
fax   (206) 526 4074                                Seattle, WA 98115-0070
Received on Tue Mar 31 1998 - 00:00:00 CST

Original text of this message

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