oracle - pass sqlplus value to shell variable -
the below picture shows gets returned when run sqlplus in shell
but when run "run" command:
powershell.exe -noexit c:\sqltriggers\voicetrigger2.ps1
with voicetrigger2.ps1 this:
$(sqlplus user/pass@omp1 '@c:\sqltriggers\voiceblocktrig.sql');
i this:
i should expect 3 back. issue is, try set variable, , if integer greater zero, run bat file. don't think sqlplus returning integer value. think returning this:
count(*) 3
how return integer value sqlplus command?
sql*plus isn't returning anything, it's displaying result of query on standard output. direct call show 3
can set heading off
in sql script, , call sql*plus -s
flag suppress banner. want exit
@ end of sql script doesn't stay sitting @ sql>
prompt.
the same applies powershell call, there's else going on there; 17
line number means it's waiting more input , hasn't executed commands in sql script, suggests either query without terminating ;
or /
, or pl/sql block without terminating /
. if it's same sql ran in first example bit odd should behave same. should add sql script contents question see might wrong.
the thing can think of change behaviour if had login.sql
includes set sqlterminator
command, you'd have picking different login.sql
files 2 calls... plausible if powershell has own environment variables, perhaps.
Comments
Post a Comment