0

I have some embedded SQL in a ksh script with functionality to count the number of records in a table, however, the select * in the query is returning all file names

"$(sqlplus -s $username/$password@$hostname <<ENDOFSQL
            set head off
            select count(*) from (select * from table_a minus select * from table_b);
            exit;
ENDOFSQL)"

When I print the results of the query, I get select count(*) from (select a.txt b.txt c.sql d.ctl

What's going wrong here?

cdm
  • 1
  • 1
  • seems like you said it yourself - the shell is doing globbing - in which case quoting the query should avoid that. specifying what shell you're using might help, but this seems pretty general. – underscore_d Jul 31 '20 at 17:15
  • 1
    I think this may help: https://stackoverflow.com/q/22697688/2422776 – Mureinik Jul 31 '20 at 17:19
  • Does this answer your question? [How to cat <> a file containing code?](https://stackoverflow.com/questions/22697688/how-to-cat-eof-a-file-containing-code) – underscore_d Jul 31 '20 at 17:20

0 Answers0