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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Test value of &1 before prompt

Status
Not open for further replies.

fidge

Technical User
Jun 11, 2003
20
0
0
GB
Hello all,

I have a script which takes a telephone nummber as its only variable i.e script 01256123456.

I would like to test that the variable given is
a) populated
b) all numeric, and
c) no greater than 11 chars in length.

I can test b and c, but not a, as if the script is run without a input variable it always prompts "Enter value for 1:"

How can I stop this from happening so I can test the input variable. Is there a way?

Thanks for your help.
 

No way José. [3eyes]

----------------------------------------------------------------------------
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb
 
In that case, is there another way to pass in a variable?
 
Fidge,

Can you please post the code that you are using already, and then editorialise on the code how you would like it to behave if you had your wish?

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

If you wish to pass an 'empty' value use double quotes:

SQL>@myscript.sql '' 'Value2' 3333

above would assign '' (emty string) to &1

[pipe]



----------------------------------------------------------------------------
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top