Query length

Chris Jack (msn) chris_jack at msn.com
Tue Mar 18 07:57:07 GMT 2008

> Please let me know if there is any particular length of query perl
> supports.

Depends on the database and the type. If you're talking text fields in
Sybase, there is a default maximum length that you can overwrite for

> for ($x = 1; $x <= $num_inserts; $x++)
>             {
>                print "insert_string_$x = $insert_string[$x] \n" if $debug;
>                $db->sql($insert_string[$x]);
>                $db->sql("commit");
>            }
> Is there any way I can do it at one go instead of making so many small
> small queries.

You might like to commit every n statements to reduce logging overhead (as
you've only got 10 - you may as well do them all).

Again, if you're using a database like Sybase, you can execute them all in
one statement. Better still, you could use a stored procedure and save on
compile overhead.

What you really want, though, is to buy this:

More information about the london.pm mailing list