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

SQL queries

Status
Not open for further replies.

sn128

Programmer
Dec 3, 2002
13
GB
Hi,

Is there any way in an SQL query where the user can enter the condional parameter which the results will be based upon?

i.e. A list of suppliers in a user selected postal area.

It must be in SQL.


Many thanks in advance

Nick
 
Look at the Docs for the Prompt and Accept commands and the use of substitution varibles..
Here is one example from
Code:
  1   PROMPT Enter a valid employee number
  2  PROMPT For example:  7369, 7499, 7521
  3  ACCEPT ENUMBER NUMBER PROMPT 'Emp. no.:  '
  4  SELECT ENAME, MGR, JOB, SAL
  5  FROM EMP
  6  WHERE EMPNO = &ENUMBER
Save as testprompt.sql ( or something ) - when run it will 'ask' for a number to use in the where clause...

[profile]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top