Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting a string value to a variable 1

Status
Not open for further replies.

tmcneil

Technical User
Nov 17, 2000
294
US
I'm trying to write this value into a stored procedure and I am not able to build into SQL Plus. So how would I fix it so that it can be stored in a VARCHAR?

Code:
InAspArgList     := 'AnnEventID=$ANN_EVENT_ID&TimeStamp=$TIME_STAMP';

I'm getting a prompt in the SQL Plus window
Code:
Enter value for timestamp:

Well, I think it must have something to do with timestamp...

Thanks,
Todd
 
Todd,

In the Oracle SQL*Plus environment, the "&" character, by default, means to "prompt for a string value and store in a label by the string name that follows." In your case, SQL*Plus is trying to store a prompted value in something named "TIMESTAMP".

One way to override this SQL*Plus behaviour is to turn off this behaviour for your session. Here is an example of the default behaviour, followed by the turning off of the behaviour:
Code:
SQL> select 'this is &a test' from dual;
Enter value for a: some

'THISISSOMETEST'
-----------------
this is some test
SQL> set define off
SQL> select 'this is &a test' from dual;

'THISIS&ATEST'
---------------
this is &a test
Let us know if this resolves your need.

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[I provide low-cost, remote Database Administration services: www.dasages.com]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top