Menu

Has any one got a program to export specific layout based forms and lists

Developers
Terry Hill
2015-06-22
2015-06-24
<< < 1 2 (Page 2 of 2)
  • Terry Hill

    Terry Hill - 2015-06-23

    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

     
  • Rod Roark

    Rod Roark - 2015-06-23

    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/

     
  • Terry Hill

    Terry Hill - 2015-06-23

    This is the only section of code with the perl stuff.

    if ($tables) {
      $cmd .= "$mysql_dump_cmd -u " . escapeshellarg($sqlconf["login"]) .
        " -p" . escapeshellarg($sqlconf["pass"]) .
        " --opt --quote-names " .
        escapeshellarg($sqlconf["dbase"]) . " $tables" .
        " | $perl -pe 's/ DEFAULT CHARSET=utf8//i; s/ collate[ =][^ ;,]*//i;'" .
        " >> $EXPORT_FILE;";
    }
    

    Terry

     
  • Rod Roark

    Rod Roark - 2015-06-23

    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/

     
  • Terry Hill

    Terry Hill - 2015-06-23

    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

     
  • Rod Roark

    Rod Roark - 2015-06-23

    Doesn't make sense. Look at this line in the code:

    $cmd = "echo 'SET character_set_client = utf8;' > $EXPORT_FILE;";
    

    So the generated commands should start with "echo".

    You'll need to do some debugging.

    Rod
    http://www.sunsetsystems.com/

     
  • Terry Hill

    Terry Hill - 2015-06-23

    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?

     
  • Rod Roark

    Rod Roark - 2015-06-24

    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:

    perl -e 'print "hi there\n";'
    

    and then

    perl -e 'print "hi "; print "there\n";'
    

    They should give the same result.

    Rod
    http://www.sunsetsystems.com/

     
  • Terry Hill

    Terry Hill - 2015-06-24

    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.

     
  • Rod Roark

    Rod Roark - 2015-06-24

    Kinda looks like your perl is broken. But just for grins try this too:

    perl -e 'print "hi there\n"'
    

    Rod
    http://www.sunsetsystems.com/

     
  • Terry Hill

    Terry Hill - 2015-06-24

    nope same thing

     
  • Terry Hill

    Terry Hill - 2015-06-24

    On the right track

    C:\Users\terry>perl -e "print 'hi '; print 'there\n';"
    hi there\n
    C:\Users\terry>

     
  • Rod Roark

    Rod Roark - 2015-06-24

    So the \n escape didn't work... ok try:

    perl -e "print \"hi \"; print \"there\n\";"
    

    Rod
    http://www.sunsetsystems.com/

     
  • Terry Hill

    Terry Hill - 2015-06-24

    better

    C:\Users\terry>perl -e "print \"hi \"; print \"there\n\";"
    hi there

    C:\Users\terry>

     
  • Rod Roark

    Rod Roark - 2015-06-24

    So, do you know how to fix the code now? :)

    Rod
    http://www.sunsetsystems.com/

     
  • Terry Hill

    Terry Hill - 2015-06-24

    so what have I got wrong

        " | $perl -pe \"s/ DEFAULT CHARSET=utf8//i; s/ collate[ =][^ ;,]*//i;\"" .
        " >> $EXPORT_FILE;";
    

    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

     
  • Rod Roark

    Rod Roark - 2015-06-24

    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/

     
<< < 1 2 (Page 2 of 2)

Log in to post a comment.