Re: Bad error message

2014-07-27 Thread Stuart Cooper
Hi Meir, Remember that the process of changing the ? placeholders to actual variables is called "binding".. and that can go wrong if for example you have 4 ? placeholders and provide 3 values or you have 0 ? and provide 3 values. Because of your missing a backquote you effectively got an SQL stat

Re: question on CPAN example for DBI

2011-07-29 Thread Stuart Cooper
Hi Rajeev, $baz is a variable that gets substituted for the ? in the prepare statement, between the $dbh->prepare() and the $sth->execute. So it's really: $sth = $dbh->prepare("SELECT foo, bar FROM table WHERE baz=?"); ... extra lines here... calculating $baz $sth->execute( $baz ); Read a bit

Re: Perl DBI sets $SIG{PIPE} to 'IGNORE'

2010-07-28 Thread Stuart Cooper
Hi Damian, > my $first_line = `grep -v '#' $filename|head -n 1`; # to get the first > non-comment line > the shell which is invoked inherits the SIGPIPE = 'IGNORE' state. This > causes a > grep: writing output: Broken pipe > error as the grep tries to write to the head process which has exited.

Re: ShowErrorStatement

2007-08-13 Thread Stuart Cooper
> First off, I had no idea it existed until I started going through a dbi > tutorial. The idea is you don't have to litter your code with "or > die..." statements. > Is it good practice to use this or is an explicit "or die..." better > because you can "see" there is error trapping? I think setti

Re: Problem upgrading DBI using CPAN (module test suite fails)

2006-09-05 Thread Stuart Cooper
/usr/bin/perl -MCPAN -e 'install "DBI"' it downloads the new module, builds everything, and then starts running the make test portion of the install. During this process, I get the following output (after a bunch of other successful tests): /usr/bin/make test -- NOT OK Running make insta

Re: peer review: recipe for solving SELECT/INSERT/UPDATE race condition

2006-08-21 Thread Stuart Cooper
Sometimes it's desirable to first to a SELECT to see if a row exists, and then INSERT if it doesn't already, or UPDATE if it does. MySQL's got a really handy 'REPLACE INTO' for just this circumstance, some have suggested that PostgreSQL should support this in future. Your solution looks good.

Re: MySQL BLOB: random access via DBI ?

2006-07-25 Thread Stuart Cooper
does DBD::mysql (or the MySQL API for that matter) support random access to BLOB types ? i.e. the ability to select/insert a BLOB via a serious of small queries, as opposed to the memory intensive approach of selecting/inserting the total contents of the column in one query. It's unlikely that a

Re: Perl script

2006-07-25 Thread Stuart Cooper
Ok now coming to the problem. Can someone explain to me that what this script is doing. I want to know the meaning of all the lines in the script. $val = defined $val ? $val : "null"; $val =~ s/\'/$& x 2/eg; # double pad single quote character

Re: oracle array interface

2006-05-29 Thread Stuart Cooper
> I saw on the web that the Oracle array interface has not been implemented > properly. I am new to DBI. Has the implementation been made more efficient? Would you care to provide a reference (URL) to justify the assertion? http://www.dba-oracle.com/t_dbi_perl_connecting.htm Concluding quote