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
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