RE: SQLPlus Substitution Variables

2003-01-16 Thread Erik Williams
I was not looking to pass the variable in when calling the script, but to explicitly set it at the beginning of the script so that I could use it over again in multiple statements. Kind of like what the preprocessor does, it replaces all instances of the defined variable with a constant. The DEFINE

Re: SQLPlus Substitution Variables

2003-01-15 Thread John Carlson
To expand on your description of define, I thought Erik may be looking for a way to pass the variables in. Maybe this will be of some use. sqlplus id/pwd @test 'a b c' 'd e f' Where test.sql is: define field1 = '&1' define field2 = '&2' select '&field1', '&field2' from dual; HTH, John >>> [E

RE: SQLPlus Substitution Variables

2003-01-15 Thread Charu Joshi
If you pass arguments to your script, they would get reflected in the substitution variables defined in the script. test1.sql: * Disclaimer This message (including any attachments) contains confidential information intended for a specific

Re: SQLPlus Substitution Variables

2003-01-15 Thread David L Phillips
I'm not sure this is what you wnat, but here is a short example of the use of DEFINE / UNDEFINE and && (Accept once but use many times inside script without re-prompt) -- define testtyp = Repair / select * from buy_type where buy_typ = '&&tes

RE: SQLPlus Substitution Variables

2003-01-15 Thread Anderson, Brian
AM > To: Multiple recipients of list ORACLE-L > Subject: SQLPlus Substitution Variables > > > I am using substitution variables in SQLPlus, but don't want > to be prompted > for their values. I want to set them at the start of the > script. Kind of > like a prepr

RE: SQLPlus Substitution Variables

2003-01-15 Thread [EMAIL PROTECTED]
You can use the SQL*Plus commands DEFINE to provide values for variables and UNDEFINE to "reset" them. Karen Original Message: - Date: Wed, 15 Jan 2003 07:04:18 -0800 To: [EMAIL PROTECTED] I am using substitution variables in SQLPlus, but don't want to be prompted for their val

Re: SQLPlus Substitution Variables

2003-01-15 Thread Jared . Still
TECTED]> cc: Subject:SQLPlus Substitution Variables I am using substitution variables in SQLPlus, but don't want to be prompted for their values. I want to set them at the start of the script. Kind of like a preprocessor directive. Is this possible? Erik -- Please see the

RE: SQLPlus Substitution Variables

2003-01-15 Thread Deshpande, Kirti
Yes. SQL> define tname = t1 SQL> select * from &tname where rownum < 2; old 1: select * from &&tname where rownum < 2 new 1: select * from t1 where rownum < 2 EMPNUM SEQNUM LAST_BID -- -- -- 100 1 0 SQL> undefine tname SQL> / Enter

Re: SQLPlus Substitution Variables

2003-01-15 Thread Philip Douglass
That's not quite what he asked for... Erik, you're looking for the DEFINE command, and you don't really need to use '&&' either (unless you want to reuse the script without the DEFINE), e.g.: define datestamp = "sysdate - 1" select count(*) from logtab2003 where datestamp = to_char(&datestamp, '

RE: SQLPlus Substitution Variables

2003-01-15 Thread McBain, Neil SITI-ITDSEL314
Use && instead of & and you should not get prompted if the variable has a value set. -Original Message- Sent: 15 January 2003 15:04 To: Multiple recipients of list ORACLE-L I am using substitution variables in SQLPlus, but don't want to be prompted for their values. I want to set them a

Re: SQLPlus Substitution Variables

2003-01-15 Thread Imran Ashraf
SET SCAN OFF - Original Message - To: "Multiple recipients of list ORACLE-L" <[EMAIL PROTECTED]> Sent: Wednesday, January 15, 2003 3:04 PM > I am using substitution variables in SQLPlus, but don't want to be prompted > for their values. I want to set them at the start of the script. Kind

RE: SQLPlus Substitution Variables

2003-01-15 Thread Fink, Dan
You can explicitly assign the values in the script or you can use parameters and pass in the values. Make sure you use the && and not &. Dan Fink -Original Message- Sent: Wednesday, January 15, 2003 8:04 AM To: Multiple recipients of list ORACLE-L I am using substitution variables in SQ

SQLPlus Substitution Variables

2003-01-15 Thread Erik Williams
I am using substitution variables in SQLPlus, but don't want to be prompted for their values. I want to set them at the start of the script. Kind of like a preprocessor directive. Is this possible? Erik -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Erik Williams INE