YAPC Europe 2007 Reminder - CFP and CFH Deadlines Approaching
Hi, The deadline to submit Hackathon proposals for this year's YAPC Europe in Vienna is just around the corner. Please do not forget to submit your proposals by Sunday, 13th May 2007. Information on what we're looking for exactly and what we can offer to moderators (e.g. travel/accommodation refund) can be found at: http://vienna.yapceurope.org/ye2007/cfh.html The Call for Papers deadline is less than 3 weeks away from today: http://vienna.yapceurope.org/ye2007/cfp.html The theme for this year's conference is Social Perl, which we hope will inspire submissions for this and related topics. If Perl has helped you or your company to get people together, or if you can report how Perl is social to other programming languages, or how Perl may profit from inspirations from other languages, we'd like to hear about it. Although this is our main topic for the conference, it will not be the only one, and as such we will also be accepting talks on just about any theme. Types of talks include 20 or 40 minutes talks, 60-90 minute tutorials, or 3 hour Hack-a-thons, BOFs or Workshops. There are still some slots free! Hope to see you in Vienna, Michael Kröll on behalf of Vienna.pm -- 063A F25E B064 A98F A479 1690 78CD D023 5E2A 6688 http://zis.uibk.ac.at/.m/uibk.ac.at_pgp_pubkey.asc
Trapping error for $dbh-do()
Hi, I am trying to execute multi SQL statements within the $dbh-do() and it appears to work fine except it does not give me an error when part of the SQL fails. For example: BEGIN WORK; CREATE TEMP TABLE p_temp AS SELECT col1 , col2 , col3 FROM table1 , table2 WHERE blah blah; INSERT INTO some_destination_table SELECT col1 , col2 , col3 , etc... FROM table1 , table2 , table3; COMMIT; The part that does the CREATE TEMP TABLE failed because one of the tables it is referencing does not exist, however, $dbh-do() did not return any error. I did in fact turned on the RaiseError in the connect statement. unless($dbh = DBI-connect(dbi:$dbDriver:$dbName, $dbUser, $dbPass, { RaiseError = 1 })) { $MESSAGE = ERROR: Connection failed to $dbName for user $dbUser.; print STDERR $MESSAGE\n\n; $STATUS = $FAILURE; sub_exit(); } I am also trying to trap $dbh-do() using eval. eval { $dbh-do($sqlString); }; if ($@) { $MESSAGE = ERROR: dbh-do($sqlString) failed. $@; print STDERR $MESSAGE\n\n; $STATUS = $FAILURE; sub_exit(); } Hope someone can shed some light for me. The versions I am using are: This is perl, v5.8.7 built for sun4-solaris $ perl -M'DBD::ODBC' -le 'print $DBD::ODBC::VERSION' 1.13 Thanks. Peter
Bar Code
I want to barcode label from a serial number. I have a property accountability database using SYBASE. I access the database using perl and cgi, and display the results on the Web Page using Apache. The server is a unix platform running solaris 8. At the present time I can print labels, with the serial number, nomenclature and hand reciept number. I would like to print the serial number on barcode format. Oscar
Re: Bar Code
if you're using a label printer, the label printer will have primitives for that. If you're using a normal high-resolution laser or bubblejet, I would suggest looking into barcode support with the GD graphics library. Also, this issue is off-topic for dbi-users; after finding a bar code graphics library that is supposed to work, follow up to their users list for help with it. Have a nice day
Re: Bar Code
On 5/8/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I want to barcode label from a serial number. I have a property accountability database using SYBASE. I access the database using perl and cgi, and display the results on the Web Page using Apache. The server is a unix platform running solaris 8. At the present time I can print labels, with the serial number, nomenclature and hand reciept number. I would like to print the serial number on barcode format. So you need to obtain for yourself Perl modules (or other software) that will print a bar-code for you when given the appropriate data. The module is unlikely to be under the DBI or DBD hierarchies, so there's at least some argument that the question is inappropriate for this list. -- Jonathan Leffler [EMAIL PROTECTED] #include disclaimer.h Guardian of DBD::Informix - v2007.0226 - http://dbi.perl.org Blessed are we who can laugh at ourselves, for we shall never cease to be amused.
Re: Bar Code
Good Afternoon Oscar I just got this suggestion from [EMAIL PROTECTED] GD::Barcode Martin-- This email message and any files transmitted with it contain confidential information intended only for the person(s) to whom this email message is addressed. If you have received this email message in error, please notify the sender immediately by telephone or email and destroy the original message without making a copy. Thank you. - Original Message - From: [EMAIL PROTECTED] To: dbi-users@perl.org Sent: Tuesday, May 08, 2007 12:46 PM Subject: Bar Code I want to barcode label from a serial number. I have a property accountability database using SYBASE. I access the database using perl and cgi, and display the results on the Web Page using Apache. The server is a unix platform running solaris 8. At the present time I can print labels, with the serial number, nomenclature and hand reciept number. I would like to print the serial number on barcode format. Oscar
Re: Trapping error for $dbh-do()
Quoting the DBI man page http://search.cpan.org/~timb/DBI-1.55/DBI.pm#Database_Handle_Methods: do $rows = $dbh-do($statement) or die $dbh-errstr; $rows = $dbh-do($statement, \%attr) or die $dbh-errstr; $rows = $dbh-do($statement, \%attr, @bind_values) or die ... Prepare and execute a *SINGLE* statement. If your DBD seems to support mutliple statements in a single $dbh-do(), it does that by accident. If you need all or nothing, read about transactions: http://search.cpan.org/~timb/DBI-1.55/DBI.pm#Transactions If you just need to process several SQL commands, use a loop. my @statements=(...); foreach my $st (@statements) { $dbh-do($st); } With transactions, you would wrap the entire loop and the final commit inside an eval BLOCK, and call rollback if $@ is true after the eval. NEVER, NEVER, NEVER put values inside the SQL statements, this begs for trouble and usually performs suboptimal. Hope that helps, Alexander Loo, Peter # PHX wrote: Hi, I am trying to execute multi SQL statements within the $dbh-do() and it appears to work fine except it does not give me an error when part of the SQL fails. For example: BEGIN WORK; CREATE TEMP TABLE p_temp AS SELECT col1 , col2 , col3 FROM table1 , table2 WHERE blah blah; INSERT INTO some_destination_table SELECT col1 , col2 , col3 , etc... FROM table1 , table2 , table3; COMMIT; The part that does the CREATE TEMP TABLE failed because one of the tables it is referencing does not exist, however, $dbh-do() did not return any error. I did in fact turned on the RaiseError in the connect statement. unless($dbh = DBI-connect(dbi:$dbDriver:$dbName, $dbUser, $dbPass, { RaiseError = 1 })) { $MESSAGE = ERROR: Connection failed to $dbName for user $dbUser.; print STDERR $MESSAGE\n\n; $STATUS = $FAILURE; sub_exit(); } I am also trying to trap $dbh-do() using eval. eval { $dbh-do($sqlString); }; if ($@) { $MESSAGE = ERROR: dbh-do($sqlString) failed. $@; print STDERR $MESSAGE\n\n; $STATUS = $FAILURE; sub_exit(); } Hope someone can shed some light for me. The versions I am using are: This is perl, v5.8.7 built for sun4-solaris $ perl -M'DBD::ODBC' -le 'print $DBD::ODBC::VERSION' 1.13 Thanks. Peter -- Alexander Foken mailto:[EMAIL PROTECTED] http://www.foken.de/alexander/
RE: Trapping error for $dbh-do()
Hi Alexander, Thanks for your kind input. Completely understood except the sentence starting with NEVER, NEVER Will you kindly explain? Thanks again. Peter -Original Message- From: Alexander Foken [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 08, 2007 2:11 PM To: Loo, Peter # PHX Cc: dbi-users@perl.org Subject: Re: Trapping error for $dbh-do() Quoting the DBI man page http://search.cpan.org/~timb/DBI-1.55/DBI.pm#Database_Handle_Methods: do $rows = $dbh-do($statement) or die $dbh-errstr; $rows = $dbh-do($statement, \%attr) or die $dbh-errstr; $rows = $dbh-do($statement, \%attr, @bind_values) or die ... Prepare and execute a *SINGLE* statement. If your DBD seems to support mutliple statements in a single $dbh-do(), it does that by accident. If you need all or nothing, read about transactions: http://search.cpan.org/~timb/DBI-1.55/DBI.pm#Transactions If you just need to process several SQL commands, use a loop. my @statements=(...); foreach my $st (@statements) { $dbh-do($st); } With transactions, you would wrap the entire loop and the final commit inside an eval BLOCK, and call rollback if $@ is true after the eval. NEVER, NEVER, NEVER put values inside the SQL statements, this begs for trouble and usually performs suboptimal. Hope that helps, Alexander Loo, Peter # PHX wrote: Hi, I am trying to execute multi SQL statements within the $dbh-do() and it appears to work fine except it does not give me an error when part of the SQL fails. For example: BEGIN WORK; CREATE TEMP TABLE p_temp AS SELECT col1 , col2 , col3 FROM table1 , table2 WHERE blah blah; INSERT INTO some_destination_table SELECT col1 , col2 , col3 , etc... FROM table1 , table2 , table3; COMMIT; The part that does the CREATE TEMP TABLE failed because one of the tables it is referencing does not exist, however, $dbh-do() did not return any error. I did in fact turned on the RaiseError in the connect statement. unless($dbh = DBI-connect(dbi:$dbDriver:$dbName, $dbUser, $dbPass, { RaiseError = 1 })) { $MESSAGE = ERROR: Connection failed to $dbName for user $dbUser.; print STDERR $MESSAGE\n\n; $STATUS = $FAILURE; sub_exit(); } I am also trying to trap $dbh-do() using eval. eval { $dbh-do($sqlString); }; if ($@) { $MESSAGE = ERROR: dbh-do($sqlString) failed. $@; print STDERR $MESSAGE\n\n; $STATUS = $FAILURE; sub_exit(); } Hope someone can shed some light for me. The versions I am using are: This is perl, v5.8.7 built for sun4-solaris $ perl -M'DBD::ODBC' -le 'print $DBD::ODBC::VERSION' 1.13 Thanks. Peter -- Alexander Foken mailto:[EMAIL PROTECTED] http://www.foken.de/alexander/ This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message.
Re: Trapping error for $dbh-do()
Hello Basically the reason for substitution variables.. the statement SELECT * from my_table where col1 = 0 and col2 = 1 and col3 -3 where the predicate would be supplied by the substitution variables :0 and :1 and :2 as in my $sth=$dbh-prepare(select * from my_table where col1=:0 and col2=:1 and col3=:2); Martin-- This email message and any files transmitted with it contain confidential information intended only for the person(s) to whom this email message is addressed. If you have received this email message in error, please notify the sender immediately by telephone or email and destroy the original message without making a copy. Thank you. - Original Message - From: Loo, Peter # PHX [EMAIL PROTECTED] To: Alexander Foken [EMAIL PROTECTED] Cc: dbi-users@perl.org Sent: Tuesday, May 08, 2007 5:44 PM Subject: RE: Trapping error for $dbh-do() Hi Alexander, Thanks for your kind input. Completely understood except the sentence starting with NEVER, NEVER Will you kindly explain? Thanks again. Peter -Original Message- From: Alexander Foken [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 08, 2007 2:11 PM To: Loo, Peter # PHX Cc: dbi-users@perl.org Subject: Re: Trapping error for $dbh-do() Quoting the DBI man page http://search.cpan.org/~timb/DBI-1.55/DBI.pm#Database_Handle_Methods: do $rows = $dbh-do($statement) or die $dbh-errstr; $rows = $dbh-do($statement, \%attr) or die $dbh-errstr; $rows = $dbh-do($statement, \%attr, @bind_values) or die ... Prepare and execute a *SINGLE* statement. If your DBD seems to support mutliple statements in a single $dbh-do(), it does that by accident. If you need all or nothing, read about transactions: http://search.cpan.org/~timb/DBI-1.55/DBI.pm#Transactions If you just need to process several SQL commands, use a loop. my @statements=(...); foreach my $st (@statements) { $dbh-do($st); } With transactions, you would wrap the entire loop and the final commit inside an eval BLOCK, and call rollback if $@ is true after the eval. NEVER, NEVER, NEVER put values inside the SQL statements, this begs for trouble and usually performs suboptimal. Hope that helps, Alexander Loo, Peter # PHX wrote: Hi, I am trying to execute multi SQL statements within the $dbh-do() and it appears to work fine except it does not give me an error when part of the SQL fails. For example: BEGIN WORK; CREATE TEMP TABLE p_temp AS SELECT col1 , col2 , col3 FROM table1 , table2 WHERE blah blah; INSERT INTO some_destination_table SELECT col1 , col2 , col3 , etc... FROM table1 , table2 , table3; COMMIT; The part that does the CREATE TEMP TABLE failed because one of the tables it is referencing does not exist, however, $dbh-do() did not return any error. I did in fact turned on the RaiseError in the connect statement. unless($dbh = DBI-connect(dbi:$dbDriver:$dbName, $dbUser, $dbPass, { RaiseError = 1 })) { $MESSAGE = ERROR: Connection failed to $dbName for user $dbUser.; print STDERR $MESSAGE\n\n; $STATUS = $FAILURE; sub_exit(); } I am also trying to trap $dbh-do() using eval. eval { $dbh-do($sqlString); }; if ($@) { $MESSAGE = ERROR: dbh-do($sqlString) failed. $@; print STDERR $MESSAGE\n\n; $STATUS = $FAILURE; sub_exit(); } Hope someone can shed some light for me. The versions I am using are: This is perl, v5.8.7 built for sun4-solaris $ perl -M'DBD::ODBC' -le 'print $DBD::ODBC::VERSION' 1.13 Thanks. Peter -- Alexander Foken mailto:[EMAIL PROTECTED] http://www.foken.de/alexander/ This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message.