Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to return a sql query result back to Windows env variable in a batch script file?

In Unix shell script, I can pass a sql query result back to Unix shell variable as below:
var1=$(sqlplus -s / as sysdba << EOF
select count(*) from dba_objects;
EOF
)

How to do this in Windows batch script ?

This post has been answered by Billy Verreynne on Apr 28 2021
Jump to Answer
Comments
Post Details
Added on Apr 28 2021
8 comments
5,014 views