MySQL Forums
Forum List  »  Stored Procedures

Re: need some help with a stored procedure to import XML into a table
Posted by: Rick James
Date: January 28, 2012 11:56AM

Let's see the actual .sh file.

It would be easier, clear, simplier, etc, if you used a heredoc, and use it for the input, not "-e", something like:

cat <<ZZZ >sql.txt
use test;
set @xml :=(XML/$xmlFILENAME);
delimiter //
drop procedure if exists p_temp
...
ZZZ
mysql -u root -ppassword -D tempDB -X <sql.txt

Check the syntax rules for interpolating $ variables in such; I forget the details. That, plus multi-line quoting were probably your problems.

Why have this at all? @xml does not seem to be used.
echo "set @xml :=(XML/$xmlFILENAME);" >> sqlcommand.sh

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.