0

I have a stored procedure myProc defined within a file stored_proc.sql that has select statements to report on various things.

If call myProc within stored_proc.sql, skip-column-names works.

I'd like to call myProc within another file overall.sql, but, if I do SOURCE stored_proc.sql and CALL myProc() within overall.sql, skip-column-names stops working.

I'm executing overall.sql like this:

mysql <connection properties> --skip-column-names -e "SOURCE overall.sql"

Marko Galesic
  • 472
  • 5
  • 17
  • 1
    Please show how you execute the sql files and where you provide the skip column names option! – Shadow Dec 04 '22 at 00:26

1 Answers1

0

Looks like --skip-column-names may not work with the -e option, but -skip-column-names does work, if the *.sql file's pipe through either through | or < (e.g. cat overall.sql | mysql <...> --skip-column-names). I was hoping to use -e to be able to set a session variable, but doing a sed replacement (like in this SO post) also works.

Marko Galesic
  • 472
  • 5
  • 17