in reply to Need to capture return code

Is there a reason you're not just running $LIST_FILE directly through mysql?

Being right, does not endow the right to be rude; politeness costs nothing.
Being unknowing, is not the same as being stupid.
Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.

Replies are listed 'Best First'.
Re^2: Need to capture return code
by James_Marcinek (Initiate) on Oct 11, 2004 at 18:45 UTC
    This is my first post
    Listfile is the list of files that are to be imported (not the actual data). I'm calling each file then importing the specific file. I'm not MySQL expert either so if there's a way to tell it to import various numbers of files I'd like to know .
      Well, your code isn't doing that. Your code is saying that you have a list of MySQL commands in listfile2 and you're running through those commands one by one.

      Being right, does not endow the right to be rude; politeness costs nothing.
      Being unknowing, is not the same as being stupid.
      Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
      Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.

        You are correct. Since I had to parse log files I reformatted them with another perl script which did not capture some of the trickier entries. My other script added the header and footer lines:

        use database_name;
        insert into table values

        The important thing to know is that it works unless there's a syntax problem with (mentioned above). I've imported over 540million out of the 600 million records. Each file is currently broken into 2500 record rows. I want to capture the error code with the:

        system("mysql < $LISTFILE");

        I can then re-run the import and isolate the problem files