It looks like you only have the perl code in place for the tables. I put a couple of statements in to echo '$cmd' and '$dumppfx' and they are just what I am getting in the export file.
I can run perl from the command line by just typing in perl and it waits until I exit it.
Hope this helps
Terry
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Note that $cmd is built as a long command line including perl stuff. What you want to do is execute the whole thing at the command prompt to see what happens.
Not sure what you're getting at. I believe that code would be run if you're exporting specific lists or layouts. Isn't that what you are doing? If not, get whatever is generated for exec() and try it at the command prompt.
Kinda odd though because I do see a closing "'" in the "-e" argument. It's all one line, right? If so, it seems to raise the question of whether this perl version supports a single -e argument with multiple statements in it.
Rod:
It looks like you only have the perl code in place for the tables. I put a couple of statements in to echo '$cmd' and '$dumppfx' and they are just what I am getting in the export file.
I can run perl from the command line by just typing in perl and it waits until I exit it.
Hope this helps
Terry
Note that $cmd is built as a long command line including perl stuff. What you want to do is execute the whole thing at the command prompt to see what happens.
Rod
http://www.sunsetsystems.com/
This is the only section of code with the perl stuff.
Terry
Not sure what you're getting at. I believe that code would be run if you're exporting specific lists or layouts. Isn't that what you are doing? If not, get whatever is generated for exec() and try it at the command prompt.
Rod
http://www.sunsetsystems.com/
I am selecting a list to export. The selection does not have a 'table' checked just the list selected.
the generated command is as follows
'SET character_set_client = utf8;' ;echo "DELETE FROM list_options WHERE list_id = 'Birth_Control_Before';" ;echo "DELETE FROM list_options WHERE list_id = 'lists' AND option_id = 'Birth_Control_Before';" ;C:/xampp/mysql/bin\mysqldump -u "openemr" -p"escargot" --skip-opt --quote-names --complete-insert --no-create-info --where="list_id = 'lists' AND option_id = 'Birth_Control_Before' OR list_id = 'Birth_Control_Before'" "openemr" list_options ;
If you run it from the command line it will tells you that SET is not a valid command.
Hope this helps
Thank you for your help
Terry
Doesn't make sense. Look at this line in the code:
So the generated commands should start with "echo".
You'll need to do some debugging.
Rod
http://www.sunsetsystems.com/
C:\xampp\mysql\bin\mysqldump -u "openemr" -p"escargot" --opt --qu
ote-names "openemr" fee_sheet_options | C:\xampp\perl\bin\perl -pe 's/ DEFAULT
CHARSET=utf8//i; s/ collate[ =][^ ;,]*//i;' >> C:\Users\terry\AppData\Local\Temp
/openemr_config.sql;
Can't find string terminator "'" anywhere before EOF at -e line 1.
mysqldump: Got errno 22 on write
Does this help?
Well you finally have an error message. :)
Kinda odd though because I do see a closing "'" in the "-e" argument. It's all one line, right? If so, it seems to raise the question of whether this perl version supports a single -e argument with multiple statements in it.
Try this:
and then
They should give the same result.
Rod
http://www.sunsetsystems.com/
You ain't gonna like this
C:\Users\terry> perl -e 'print "hi there\n";'
Can't find string terminator "'" anywhere before EOF at -e line 1.
C:\Users\terry>perl -e 'print "hi "; print "there\n";'
Can't find string terminator "'" anywhere before EOF at -e line 1.
Kinda looks like your perl is broken. But just for grins try this too:
Rod
http://www.sunsetsystems.com/
nope same thing
http://www.ask-coder.com/1803026/why-am-i-getting-cant-find-string-terminator-anywhere-before-eof-at-e-line-1-when-i-try-to-run-a-perl-one-liner-on-windows
Bottom line seems to be that Windows creates a vacuum. :)
So... maybe it could be fixed by rewriting the code to reverse the single and double quotes. Start with this as a test:
Rod
http://www.sunsetsystems.com/
On the right track
C:\Users\terry>perl -e "print 'hi '; print 'there\n';"
hi there\n
C:\Users\terry>
So the \n escape didn't work... ok try:
Rod
http://www.sunsetsystems.com/
better
C:\Users\terry>perl -e "print \"hi \"; print \"there\n\";"
hi there
C:\Users\terry>
So, do you know how to fix the code now? :)
Rod
http://www.sunsetsystems.com/
so what have I got wrong
This is what I am getting
C:\Users\terry>C:\xampp\mysql\bin\mysqldump -u "openemr" -p"escargot" --opt --qu
ote-names "openemr" fee_sheet_options | C:\xampp\perl\bin\perl -pe "s/ DEFAULT
CHARSET=utf8//i; s/ collate[ =][^ ;,]*//i;" >> C:\Users\terry\AppData\Local\Temp
\openemr_config.sql;
Can't open ;: No such file or directory.
mysqldump: Got errno 22 on write
Terry
I'm not seeing the cause. Guess you'd have to construct a simpler test case to narrow it down.
Rod
http://www.sunsetsystems.com/