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

Criteria in SQL for exporting help

Status
Not open for further replies.

kilabru

Programmer
Oct 15, 2002
26
0
0
US
I am trying to have input for criteria for
my where statement in sql. I am using a .bat
file to prompt for a password (WORKS GREAT),
then run the sql script (.ctl) that exports
data. I need it to allow the user to enter a
vendor name. My only guess is an Accept, but
I have never used it before.

Can anyone help?

Here is my .bat and .ctl
--------
.bat
--------
@ECHO OFF
ECHO 'Q' or 'q' for Quit
ECHO.
SET MyInput=
IF '%1'=='JOHN' GOTO OPEN
IF '%1'=='holly_jo' GOTO OPEN
IF '%1'=='Q' GOTO END
IF '%1'=='q' GOTO END
SET /P MyInput=Enter password:
%0 %MyInput%


:OPEN
C:\Oracle\Ora81\BIN\SQLPLUSW.exe maximo/maximo@maximo
@export_quotationline.ctl %2

:END
-----------------------------
--------
.ctl
--------
set echo off
set termout off
set pagesize 0
set heading off
set feedback off
set serveroutout off
set linesize 1000


spool graybar_out.txt


ACCEPT john

select rfqnum||'*'||rfqlinenum||'*'||vendor||'*'
from quotationline
where vendor = john;

quit
---------------------------------

Thanks,

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top