Re: Issue with SQL statement
Javier, Moreno, Javier wrote: Hi, I am attempting an insert with dates and I am getting the following: /* INSERT into MASTER_Entry VALUES (?,?,?,?,?,?,?) with values E1138132263904 Javier Moreno has become the new Systems Engineer for AMS. 2004-07-22 00:00:00 H B 3018525 2004-04-19 00:00:00 Try: INSERT into MASTER_Entry VALUES (?,?,to_date(?,'-MM-DD HH24:MI:SS'), ?,?,?,to_date(?,'-MM-DD HH24:MI:SS')) Regards, Frank. --cut -- Dr. Frank Ullrich, DBA Netzwerkadministration Heise Zeitschriften Verlag GmbH & Co KG, Helstorfer Str. 7, D-30625 Hannover E-Mail: [EMAIL PROTECTED] Phone: +49 511 5352 587; FAX: +49 511 5352 538
Re: DBI and unicode seg. fault
On Fri, 23 Jul 2004, Tim Bunce wrote: > Please try to isolate the problem further. A stack trace from the > core file would be a _big_ help. Try using > http://search.cpan.org/search%3fmodule=Devel::CoreStack > > Reproducing it without the DBI, if possible, would also help. > The problem is even if select has only ASCII character:( #!/bin/perl use encoding 'latin2'; use open ":std", IN => ":encoding(iso-8859-2)", OUT => ":encoding(iso-8859-2)"; require DBI; $SQL = DBI->connect("DBI:mysql:test"); my $sql = $SQL->prepare("select a"); $sql->execute; if ($DBI::errstr) { return 0; } --- $ DBI_TRACE=2 perl test.pl DBI 1.32-ithread dispatch trace level set to 2 -> DBI->connect(DBI:mysql:test, , ) -> DBI->install_driver(mysql) for linux perl=5.008 pid=22073 ruid=0 euid=0 install_driver: DBD::mysql version 2.0419 loaded from /usr/lib/perl5/site_perl/5.8.0/i586-linux-thread-multi/DBD/mysql.pm <- install_driver= DBI::dr=HASH(0x82a4b48) -> default_user in DBD::_::dr for DBD::mysql::dr (DBI::dr=HASH(0x82a4b48)~0x8303da4 undef undef HASH(0x827be6c)) thr#815a058 <- default_user= ( undef undef ) [2 items] at DBI.pm line 510 -> connect for DBD::mysql::dr (DBI::dr=HASH(0x82a4b48)~0x8303da4 'test' undef HASH(0x827be6c)) thr#815a058 imp_dbh->connect: dsn = test, uid = , pwd = imp_dbh->MyLogin: dbname = test, uid = NULL, pwd = NULL,host = NULL, port = NULL imp_dbh->MyConnect: host = NULL, port = 0, uid = NULL, pwd = NULL imp_dbh->MyConnect: client_flags = 0 <- connect= DBI::db=HASH(0x8303d74) at DBI.pm line 513 -> STORE for DBD::mysql::db (DBI::db=HASH(0x8303d8c)~INNER 'PrintError' 1) thr#815a058 <- STORE= 1 at DBI.pm line 555 -> STORE for DBD::mysql::db (DBI::db=HASH(0x8303d8c)~INNER 'AutoCommit' 1) thr#815a058 <- STORE= 1 at DBI.pm line 555 <- connect= DBI::db=HASH(0x8303d74) -> prepare for DBD::mysql::db (DBI::db=HASH(0x8303d74)~0x8303d8c 'select a') thr#815a058 Setting mysql_use_result to 0 <- prepare= DBI::st=HASH(0x8303ec4) at test.pl line 11 -> execute for DBD::mysql::st (DBI::st=HASH(0x8303ec4)~0x8302420) thr#815a058 -> dbd_st_execute for 08303dc8 Segmentation fault (core dumped) $ perl -MDevel::CoreStack -e 'stack' Executing /usr/bin/gdb "/usr/bin/perl" "core" (bt)... GNU gdb 5.3 Copyright 2002 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i586-suse-linux"... Core was generated by `perl test.pl'. Program terminated with signal 11, Segmentation fault. Reading symbols from /lib/libnsl.so.1...done. Loaded symbols for /lib/libnsl.so.1 Reading symbols from /lib/libdl.so.2...done. Loaded symbols for /lib/libdl.so.2 Reading symbols from /lib/libm.so.6...done. Loaded symbols for /lib/libm.so.6 Reading symbols from /lib/libpthread.so.0...done. Loaded symbols for /lib/libpthread.so.0 Reading symbols from /lib/libc.so.6...done. Loaded symbols for /lib/libc.so.6 Reading symbols from /lib/libcrypt.so.1...done. Loaded symbols for /lib/libcrypt.so.1 Reading symbols from /lib/libutil.so.1...done. Loaded symbols for /lib/libutil.so.1 Reading symbols from /lib/ld-linux.so.2...done. Loaded symbols for /lib/ld-linux.so.2 Reading symbols from /usr/lib/perl5/5.8.0/i586-linux-thread-multi/auto/Encode/Encode.so...done. Loaded symbols for /usr/lib/perl5/5.8.0/i586-linux-thread-multi/auto/Encode/Encode.so Reading symbols from /usr/lib/perl5/5.8.0/i586-linux-thread-multi/auto/PerlIO/encoding/encoding.so...done. Loaded symbols for /usr/lib/perl5/5.8.0/i586-linux-thread-multi/auto/PerlIO/encoding/encoding.so Reading symbols from /usr/lib/perl5/5.8.0/i586-linux-thread-multi/auto/Encode/Byte/Byte.so...done. Loaded symbols for /usr/lib/perl5/5.8.0/i586-linux-thread-multi/auto/Encode/Byte/Byte.so Reading symbols from /usr/lib/perl5/site_perl/5.8.0/i586-linux-thread-multi/auto/DBI/DBI.so...done. Loaded symbols for /usr/lib/perl5/site_perl/5.8.0/i586-linux-thread-multi/auto/DBI/DBI.so Reading symbols from /usr/lib/perl5/site_perl/5.8.0/i586-linux-thread-multi/auto/DBD/mysql/mysql.so...done. Loaded symbols for /usr/lib/perl5/site_perl/5.8.0/i586-linux-thread-multi/auto/DBD/mysql/mysql.so Reading symbols from /usr/lib/mysql/libmysqlclient.so.10...done. Loaded symbols for /usr/lib/mysql/libmysqlclient.so.10 Reading symbols from /lib/libz.so.1...done. Loaded symbols for /lib/libz.so.1 Reading symbols from /lib/libnss_files.so.2...done. Loaded symbols for /lib/libnss_files.so.2 #0 0x08068b0e in Perl_gv_fetchmethod_autoload () (gdb) Hangup detected on fd 0 error detected on stdin -- Ondrej Koala Vacha
perl Oracle
hi, it is possible to install the DBD oracle driver from a box different from the oracle server? it there a standalone library w/c i can install? TIA
RE: perl Oracle
Yes, You will need to install the Oracle client on the server you wish to install DBD::Oracle. -- Ron Reidy Sr. DBA Array BioPharma, Inc. -Original Message- From: JM [mailto:[EMAIL PROTECTED] Sent: Fri 7/23/2004 5:32 AM To: [EMAIL PROTECTED] Cc: Subject:perl Oracle hi, it is possible to install the DBD oracle driver from a box different from the oracle server? it there a standalone library w/c i can install? TIA This electronic message transmission is a PRIVATE communication which contains information which may be confidential or privileged. The information is intended to be for the use of the individual or entity named above. If you are not the intended recipient, please be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. Please notify the sender of the delivery error by replying to this message, or notify us by telephone (877-633-2436, ext. 0), and then delete it from your system.
Re: perl Oracle
thanks, is there a way to install a oracle client on linux w/o X installed? On Friday 23 July 2004 19:36, Reidy, Ron wrote: > Yes, > > You will need to install the Oracle client on the server you wish to > install DBD::Oracle. > > -- > Ron Reidy > Sr. DBA > Array BioPharma, Inc. > > > -Original Message- > From: JM [mailto:[EMAIL PROTECTED] > Sent: Fri 7/23/2004 5:32 AM > To: [EMAIL PROTECTED] > Cc: > Subject: perl Oracle > hi, > > it is possible to install the DBD oracle driver from a box different from > the oracle server? > > it there a standalone library w/c i can install? > > TIA > > > > > > This electronic message transmission is a PRIVATE communication which > contains information which may be confidential or privileged. The > information is intended to be for the use of the individual or entity named > above. If you are not the intended recipient, please be aware that any > disclosure, copying, distribution or use of the contents of this > information is prohibited. Please notify the sender of the delivery error > by replying to this message, or notify us by telephone (877-633-2436, ext. > 0), and then delete it from your system. -- Jerome Macaranas Systems/Network Administrator GMA New Media, Inc. Phone: (632) 9254627 loc 202 Fax: (632) 9284553 Mobile: (632) 918-9336819 [EMAIL PROTECTED]
Re: Fwd: dbi:Adabas
> > > >>I still have a problem with my DBD:Adabas-Module > > Sorry, I don't think I can help -- I don't see what the trouble is. > I would suggest upgrading from DBI 1.38, but I'm not convinced that's > a critical part of the problem. Is there anybody else, who can help me? I now tryed to install the ODBC-Driver again. The problem is defently caused by the misstaken installation by our former admin. But I may not make a new installation ( Im just a student :-) . So, as it seems it has somethink doto with the include-directories. Because the headers which are needed to build are spread all over the filesystem. After I solved that problem I got parser-error. This is the beginning: # make cp Changes blib/lib/DBD/ODBC/Changes.pm cp ODBC.pm blib/lib/DBD/ODBC.pm /usr/bin/perl -p -e "s/~DRIVER~/ODBC/g" /usr/local/lib/perl5/5.8.3/PA-RISC2.0/auto/DBI/Driver.xst > ODBC.xsi /usr/bin/perl /usr/local/lib/perl5/5.8.3/ExtUtils/xsubpp -typemap /usr/local/lib/perl5/5.8.3/ExtUtils/typemap ODBC.xs > ODBC.xsc && mv ODBC.xsc ODBC.cWarning: duplicate function definition 'data_sources' detected in ODBC.xs, line 202 /usr/local/bin/gcc -c -I/REFDB_HOME/referenz/adabas_d/include -I. -I/usr/local/lib/perl5/5.8.3/PA-RISC2.0/auto/DBI -D_HPUX_SOURCE -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -O2 -DVERSION=\"1.09\" -DXS_VERSION=\"1.09\" -fPIC "-I/usr/local/lib/perl5/5.8.3/PA-RISC2.0/CORE" -I/REFDB_HOME/referenz/adabas_d/include ODBC.c In file included from /REFDB_HOME/referenz/adabas_d/include/isqlext.h:4, from dbdodbc.h:6, from ODBC.h:9, from ODBC.xs:1: /REFDB_HOME/referenz/adabas_d/include/isql.h:10: error: parse error before '*' token /REFDB_HOME/referenz/adabas_d/include/isql.h:10: warning: data definition has no type or storage class /REFDB_HOME/referenz/adabas_d/include/isql.h:12: error: parse error before '*' token /REFDB_HOME/referenz/adabas_d/include/isql.h:12: warning: data definition has no type or storage class /REFDB_HOME/referenz/adabas_d/include/isql.h:13: error: parse error before '*' token /REFDB_HOME/referenz/adabas_d/include/isql.h:13: warning: data definition has no type or storage class /REFDB_HOME/referenz/adabas_d/include/isql.h:14: error: parse error before '*' token /REFDB_HOME/referenz/adabas_d/include/isql.h:14: warning: data definition has no type or storage class In file included from dbdodbc.h:6, from ODBC.h:9, from ODBC.xs:1: and this is somethink I don't want to touch ! Gruss Christian
Re: DBD::Oracle binary release for AS Perl NON announcement (was RE: :Oracle 1.16 question)
Doh! Now there is no Oracle! Thanks for the answer though. :-) Robert
RE: perl Oracle
You can do a silent install. See the Oracle installation docs. -- Ron Reidy Sr. DBA Array BioPharma, Inc. -Original Message- From: Jerome Macaranas [mailto:[EMAIL PROTECTED] Sent: Fri 7/23/2004 5:43 AM To: Reidy, Ron; [EMAIL PROTECTED] Cc: Subject:Re: perl Oracle thanks, is there a way to install a oracle client on linux w/o X installed? On Friday 23 July 2004 19:36, Reidy, Ron wrote: > Yes, > > You will need to install the Oracle client on the server you wish to > install DBD::Oracle. > > -- > Ron Reidy > Sr. DBA > Array BioPharma, Inc. > > > -Original Message- > From: JM [mailto:[EMAIL PROTECTED] > Sent: Fri 7/23/2004 5:32 AM > To: [EMAIL PROTECTED] > Cc: > Subject: perl Oracle > hi, > > it is possible to install the DBD oracle driver from a box different from > the oracle server? > > it there a standalone library w/c i can install? > > TIA > > > > > > This electronic message transmission is a PRIVATE communication which > contains information which may be confidential or privileged. The > information is intended to be for the use of the individual or entity named > above. If you are not the intended recipient, please be aware that any > disclosure, copying, distribution or use of the contents of this > information is prohibited. Please notify the sender of the delivery error > by replying to this message, or notify us by telephone (877-633-2436, ext. > 0), and then delete it from your system. -- Jerome Macaranas Systems/Network Administrator GMA New Media, Inc. Phone: (632) 9254627 loc 202 Fax: (632) 9284553 Mobile: (632) 918-9336819 [EMAIL PROTECTED] This electronic message transmission is a PRIVATE communication which contains information which may be confidential or privileged. The information is intended to be for the use of the individual or entity named above. If you are not the intended recipient, please be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. Please notify the sender of the delivery error by replying to this message, or notify us by telephone (877-633-2436, ext. 0), and then delete it from your system.
Re: DBI and unicode seg. fault
On Fri, Jul 23, 2004 at 09:58:50AM +0200, Ondrej Koala Vacha wrote: > On Fri, 23 Jul 2004, Tim Bunce wrote: > > > Please try to isolate the problem further. A stack trace from the > > core file would be a _big_ help. Try using > > http://search.cpan.org/search%3fmodule=Devel::CoreStack > > > > Reproducing it without the DBI, if possible, would also help. > > The problem is even if select has only ASCII character:( > > > #!/bin/perl > use encoding 'latin2'; > use open ":std", > IN => ":encoding(iso-8859-2)", > OUT => ":encoding(iso-8859-2)"; > > require DBI; > $SQL = DBI->connect("DBI:mysql:test"); > > my $sql = $SQL->prepare("select a"); > $sql->execute; > if ($DBI::errstr) { > return 0; > } > --- > $ DBI_TRACE=2 perl test.pl > -> execute for DBD::mysql::st (DBI::st=HASH(0x8303ec4)~0x8302420) > thr#815a058 > -> dbd_st_execute for 08303dc8 > Segmentation fault (core dumped) That looks like it's inside DBD::mysql at the time. > $ perl -MDevel::CoreStack -e 'stack' > Executing /usr/bin/gdb "/usr/bin/perl" "core" (bt)... > #0 0x08068b0e in Perl_gv_fetchmethod_autoload () > (gdb) Hangup detected on fd 0 > error detected on stdin Looks like Devel::CoreStack is not working well for you there. I think the "bt" (backtrace) command hasn't been run. Try executing gdb /usr/bin/perl core yourself and then give gdb the bt command. Tim.
How to perform JOINs with DBI
Title: How to perform JOINs with DBI Hi all, I am having issues trying to do the following: SELECT I.idIssue, I.Description, I.idEntry, I.idStatus, E.Description, E.CreateDate, E.idPriority, E.idSeverity, E.idUser, E.DueDate FROM MASTER_Issue I, MASTER_Entry E WHERE I.idIssue = ? AND I.idEntry = E.idEntry The query runs fine but I get no information back from it. What could be wrong? I ran the same query (replacing the placeholder with the value) on the database and it ran fine and returned information. Regards, Javier Moreno Systems Engineer - Transmissions "When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth" - Sherlock Holmes
RE: How to perform JOINs with DBI
Javier, This is not a DBI issue. What does the query do in SQL*Plus? Is the relationship between the tables mandatory, or should you be using an outer or inner join? -- Ron Reidy Sr, DBA Array BioPharma, Inc. -Original Message- From: Moreno, Javier [mailto:[EMAIL PROTECTED] Sent: Fri 7/23/2004 11:19 AM To: [EMAIL PROTECTED] Cc: Subject:How to perform JOINs with DBI Hi all, I am having issues trying to do the following: SELECT I.idIssue, I.Description, I.idEntry, I.idStatus, E.Description, E.CreateDate, E.idPriority, E.idSeverity, E.idUser, E.DueDate FROM MASTER_Issue I, MASTER_Entry E WHERE I.idIssue = ? AND I.idEntry = E.idEntry The query runs fine but I get no information back from it. What could be wrong? I ran the same query (replacing the placeholder with the value) on the database and it ran fine and returned information. Regards, Javier Moreno <> Systems Engineer - Transmissions "When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth" - Sherlock Holmes This electronic message transmission is a PRIVATE communication which contains information which may be confidential or privileged. The information is intended to be for the use of the individual or entity named above. If you are not the intended recipient, please be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. Please notify the sender of the delivery error by replying to this message, or notify us by telephone (877-633-2436, ext. 0), and then delete it from your system. <>
RE: How to perform JOINs with DBI
I have the same problem before. If the datatype of the field is not number, you will need to single quote it even though you are using place holder. -Original Message- From: Moreno, Javier [mailto:[EMAIL PROTECTED] Sent: Friday, July 23, 2004 1:19 PM To: [EMAIL PROTECTED] Subject: How to perform JOINs with DBI Hi all, I am having issues trying to do the following: SELECT I.idIssue, I.Description, I.idEntry, I.idStatus, E.Description, E.CreateDate, E.idPriority, E.idSeverity, E.idUser, E.DueDate FROM MASTER_Issue I, MASTER_Entry E WHERE I.idIssue = ? AND I.idEntry = E.idEntry The query runs fine but I get no information back from it. What could be wrong? I ran the same query (replacing the placeholder with the value) on the database and it ran fine and returned information. Regards, Javier Moreno ole0.bmp Systems Engineer - Transmissions "When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth" - Sherlock Holmes
RE: How to perform JOINs with DBI
Ron, This is the Oracle query SELECT I.idIssue, I.Description, I.idEntry, I.idStatus, E.Description, E.CreateDate, E.idPriority, E.idSeverity, E.idUser, E.DueDate FROM MASTER_Issue I, MASTER_Entry E WHERE I.idIssue = 'I4632362004' AND I.idEntry = E.idEntry Per Alan Kong's suggestion I tried single quoting the value but that did not work either. Regards, Javier Moreno -Original Message- From: Reidy, Ron [mailto:[EMAIL PROTECTED] Sent: Friday, July 23, 2004 12:24 PM To: Moreno, Javier; [EMAIL PROTECTED] Subject: RE: How to perform JOINs with DBI Javier, This is not a DBI issue. What does the query do in SQL*Plus? Is the relationship between the tables mandatory, or should you be using an outer or inner join? -- Ron Reidy Sr, DBA Array BioPharma, Inc. -Original Message- From: Moreno, Javier [mailto:[EMAIL PROTECTED] Sent: Fri 7/23/2004 11:19 AM To: [EMAIL PROTECTED] Cc: Subject:How to perform JOINs with DBI Hi all, I am having issues trying to do the following: SELECT I.idIssue, I.Description, I.idEntry, I.idStatus, E.Description, E.CreateDate, E.idPriority, E.idSeverity, E.idUser, E.DueDate FROM MASTER_Issue I, MASTER_Entry E WHERE I.idIssue = ? AND I.idEntry = E.idEntry The query runs fine but I get no information back from it. What could be wrong? I ran the same query (replacing the placeholder with the value) on the database and it ran fine and returned information. Regards, Javier Moreno <> Systems Engineer - Transmissions "When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth" - Sherlock Holmes This electronic message transmission is a PRIVATE communication which contains information which may be confidential or privileged. The information is intended to be for the use of the individual or entity named above. If you are not the intended recipient, please be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. Please notify the sender of the delivery error by replying to this message, or notify us by telephone (877-633-2436, ext. 0), and then delete it from your system.
RE: How to perform JOINs with DBI
Javier, What does it do in SQL*Plus? rr -Original Message- From: Moreno, Javier [mailto:[EMAIL PROTECTED] Sent: Fri 7/23/2004 11:31 AM To: Reidy, Ron; [EMAIL PROTECTED] Cc: Subject:RE: How to perform JOINs with DBI Ron, This is the Oracle query SELECT I.idIssue, I.Description, I.idEntry, I.idStatus, E.Description, E.CreateDate, E.idPriority, E.idSeverity, E.idUser, E.DueDate FROM MASTER_Issue I, MASTER_Entry E WHERE I.idIssue = 'I4632362004' AND I.idEntry = E.idEntry Per Alan Kong's suggestion I tried single quoting the value but that did not work either. Regards, Javier Moreno -Original Message- From: Reidy, Ron [mailto:[EMAIL PROTECTED] Sent: Friday, July 23, 2004 12:24 PM To: Moreno, Javier; [EMAIL PROTECTED] Subject: RE: How to perform JOINs with DBI Javier, This is not a DBI issue. What does the query do in SQL*Plus? Is the relationship between the tables mandatory, or should you be using an outer or inner join? -- Ron Reidy Sr, DBA Array BioPharma, Inc. -Original Message- From: Moreno, Javier [mailto:[EMAIL PROTECTED] Sent: Fri 7/23/2004 11:19 AM To: [EMAIL PROTECTED] Cc: Subject:How to perform JOINs with DBI Hi all, I am having issues trying to do the following: SELECT I.idIssue, I.Description, I.idEntry, I.idStatus, E.Description, E.CreateDate, E.idPriority, E.idSeverity, E.idUser, E.DueDate FROM MASTER_Issue I, MASTER_Entry E WHERE I.idIssue = ? AND I.idEntry = E.idEntry The query runs fine but I get no information back from it. What could be wrong? I ran the same query (replacing the placeholder with the value) on the database and it ran fine and returned information. Regards, Javier Moreno <> Systems Engineer - Transmissions "When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth" - Sherlock Holmes This electronic message transmission is a PRIVATE communication which contains information which may be confidential or privileged. The information is intended to be for the use of the individual or entity named above. If you are not the intended recipient, please be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. Please notify the sender of the delivery error by replying to this message, or notify us by telephone (877-633-2436, ext. 0), and then delete it from your system. This electronic message transmission is a PRIVATE communication which contains information which may be confidential or privileged. The information is intended to be for the use of the individual or entity named above. If you are not the intended recipient, please be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. Please notify the sender of the delivery error by replying to this message, or notify us by telephone (877-633-2436, ext. 0), and then delete it from your system.
RE: How to perform JOINs with DBI
Ron, It returns the row I need. Regards, Javier Moreno -Original Message- From: Reidy, Ron [mailto:[EMAIL PROTECTED] Sent: Friday, July 23, 2004 12:33 PM To: Moreno, Javier; [EMAIL PROTECTED] Subject: RE: How to perform JOINs with DBI Javier, What does it do in SQL*Plus? rr -Original Message- From: Moreno, Javier [mailto:[EMAIL PROTECTED] Sent: Fri 7/23/2004 11:31 AM To: Reidy, Ron; [EMAIL PROTECTED] Cc: Subject:RE: How to perform JOINs with DBI Ron, This is the Oracle query SELECT I.idIssue, I.Description, I.idEntry, I.idStatus, E.Description, E.CreateDate, E.idPriority, E.idSeverity, E.idUser, E.DueDate FROM MASTER_Issue I, MASTER_Entry E WHERE I.idIssue = 'I4632362004' AND I.idEntry = E.idEntry Per Alan Kong's suggestion I tried single quoting the value but that did not work either. Regards, Javier Moreno -Original Message- From: Reidy, Ron [mailto:[EMAIL PROTECTED] Sent: Friday, July 23, 2004 12:24 PM To: Moreno, Javier; [EMAIL PROTECTED] Subject: RE: How to perform JOINs with DBI Javier, This is not a DBI issue. What does the query do in SQL*Plus? Is the relationship between the tables mandatory, or should you be using an outer or inner join? -- Ron Reidy Sr, DBA Array BioPharma, Inc. -Original Message- From: Moreno, Javier [mailto:[EMAIL PROTECTED] Sent: Fri 7/23/2004 11:19 AM To: [EMAIL PROTECTED] Cc: Subject:How to perform JOINs with DBI Hi all, I am having issues trying to do the following: SELECT I.idIssue, I.Description, I.idEntry, I.idStatus, E.Description, E.CreateDate, E.idPriority, E.idSeverity, E.idUser, E.DueDate FROM MASTER_Issue I, MASTER_Entry E WHERE I.idIssue = ? AND I.idEntry = E.idEntry The query runs fine but I get no information back from it. What could be wrong? I ran the same query (replacing the placeholder with the value) on the database and it ran fine and returned information. Regards, Javier Moreno <> Systems Engineer - Transmissions "When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth" - Sherlock Holmes This electronic message transmission is a PRIVATE communication which contains information which may be confidential or privileged. The information is intended to be for the use of the individual or entity named above. If you are not the intended recipient, please be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. Please notify the sender of the delivery error by replying to this message, or notify us by telephone (877-633-2436, ext. 0), and then delete it from your system. This electronic message transmission is a PRIVATE communication which contains information which may be confidential or privileged. The information is intended to be for the use of the individual or entity named above. If you are not the intended recipient, please be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. Please notify the sender of the delivery error by replying to this message, or notify us by telephone (877-633-2436, ext. 0), and then delete it from your system.
RE: How to perform JOINs with DBI
Javier, Post your Perl code (relevant peices only). rr -Original Message- From: Moreno, Javier [mailto:[EMAIL PROTECTED] Sent: Fri 7/23/2004 11:35 AM To: Reidy, Ron; [EMAIL PROTECTED] Cc: Subject:RE: How to perform JOINs with DBI Ron, It returns the row I need. Regards, Javier Moreno -Original Message- From: Reidy, Ron [mailto:[EMAIL PROTECTED] Sent: Friday, July 23, 2004 12:33 PM To: Moreno, Javier; [EMAIL PROTECTED] Subject: RE: How to perform JOINs with DBI Javier, What does it do in SQL*Plus? rr -Original Message- From: Moreno, Javier [mailto:[EMAIL PROTECTED] Sent: Fri 7/23/2004 11:31 AM To: Reidy, Ron; [EMAIL PROTECTED] Cc: Subject:RE: How to perform JOINs with DBI Ron, This is the Oracle query SELECT I.idIssue, I.Description, I.idEntry, I.idStatus, E.Description, E.CreateDate, E.idPriority, E.idSeverity, E.idUser, E.DueDate FROM MASTER_Issue I, MASTER_Entry E WHERE I.idIssue = 'I4632362004' AND I.idEntry = E.idEntry Per Alan Kong's suggestion I tried single quoting the value but that did not work either. Regards, Javier Moreno -Original Message- From: Reidy, Ron [mailto:[EMAIL PROTECTED] Sent: Friday, July 23, 2004 12:24 PM To: Moreno, Javier; [EMAIL PROTECTED] Subject: RE: How to perform JOINs with DBI Javier, This is not a DBI issue. What does the query do in SQL*Plus? Is the relationship between the tables mandatory, or should you be using an outer or inner join? -- Ron Reidy Sr, DBA Array BioPharma, Inc. -Original Message- From: Moreno, Javier [mailto:[EMAIL PROTECTED] Sent: Fri 7/23/2004 11:19 AM To: [EMAIL PROTECTED] Cc: Subject:How to perform JOINs with DBI Hi all, I am having issues trying to do the following: SELECT I.idIssue, I.Description, I.idEntry, I.idStatus, E.Description, E.CreateDate, E.idPriority, E.idSeverity, E.idUser, E.DueDate FROM MASTER_Issue I, MASTER_Entry E WHERE I.idIssue = ? AND I.idEntry = E.idEntry The query runs fine but I get no information back from it. What could be wrong? I ran the same query (replacing the placeholder with the value) on the database and it ran fine and returned information. Regards, Javier Moreno <> Systems Engineer - Transmissions "When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth" - Sherlock Holmes This electronic message transmission is a PRIVATE communication which contains information which may be confidential or privileged. The information is intended to be for the use of the individual or entity named above. If you are not the intended recipient, please be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. Please notify the sender of the delivery error by replying to this message, or notify us by telephone (877-633-2436, ext. 0), and then delete it from your system. This electronic message transmission is a PRIVATE communication which contains information which may be confidential or privileged. The information is intended to be for the use of the individual or entity named above. If you are not the intended recipient, please be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. Please notify the sender of the delivery error by replying to this message, or notify us by telephone (877-633-2436, ext. 0), and then delete it from your system. This electronic message transmission is a PRIVATE communication which contains information which may be confidential or privileged. The information is intended to be for the use of the individual or entity named above. If you are not the intended recipient, please be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. Please notify the sender of the delivery error by replying to this message, or notify us by telephone (877-633-2436, ext. 0), and then delete it from your system.
RE: Segmentation fault in test 02simple.t
The driver manager I need to use is provided by DataDirect. The SqlServer test fails too: bash-2.01# make test PERL_DL_NONLAZY=1 /usr/local/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/01base.ok t/02simple...dubious Test returned status -1 (wstat 139, 0x8b) test program seems to have generated a core DIED. FAILED tests 19-21 Failed 3/21 tests, 85.71% okay t/03dbattok t/05meth.ok t/07bind.ok t/08bind2ok t/09multiok t/20SqlServerFAILED test 27 Failed 1/28 tests, 96.43% okay t/30Oracle...skipped all skipped: Oracle tests not supported using Microsoft SQL Server Failed Test Stat Wstat Total Fail Failed List of Failed --- t/02simple.t -1 139216 28.57% 19-21 t/20SqlServer.t 281 3.57% 27 1 test skipped. Failed 2/9 test scripts, 77.78% okay. 4/96 subtests failed, 95.83% okay. make: *** [test_dynamic] Error 2 The test 27 is not ok: ok 23 ok 24 odbc_async_exec is: 1 ok 25 ===> state: 01000 msg: Trace option(s) not enabled for this connection. Use 'DBCC TRACEON()'. nativeerr: 7941 ===> state: 01000 msg: DBCC execution completed. If DBCC printed error messages, contact your system administrator. nativeerr: 2528 ok 26 ===> state: 42S02 msg: Invalid object name 'perl_dbd_table1'. nativeerr: 208 ===> state: 42S02 msg: Invalid object name 'perl_dbd_table1'. nativeerr: 208 not ok 27 imp_drh is defined ok 28 Based on the suggestions, I saw several things by modifying the 02simple.t: The failing test on it's own is use DBI; my $dbh3 = DBI->connect("unexistingx", "whateverlogin", "whateverpassword", {RaiseError=>0, PrintError=>0}); print "Test Ok if Errstr not undef: " . $DBI::errstr . "\n"; and runs fine. 3) I trimed down the test script to the minimum I could: $| = 1; use DBI qw(:sql_types); use ODBCTEST; print " Test 2: connecting to the database\n"; my $dbh = DBI->connect() || die "Connect failed: $DBI::errstr\n"; $dbh->{AutoCommit} = 1; my $rc = ODBCTEST::tab_create($dbh); $rc = ODBCTEST::tab_insert($dbh); $rc = select_long($dbh); $rc = ODBCTEST::tab_delete($dbh); { my $dbh2 = DBI->connect(); $dbh2->disconnect; } { print " Test 19: test connection success when DBI DSN is invalid\n"; my $dbh3 = DBI->connect($ENV{DBI_DSN} . "x", $ENV{DBI_USER}, $ENV{DBI_PASS}, {RaiseError=>0, PrintError=>0}); print "Test Ok if Errstr not undef: " . $DBI::errstr . "\n"; $dbh3->disconnect if (defined($dbh3)); } print "the end\n"; exit(0); sub select_long { my $dbh = shift; my @row; my $sth; my $rc = undef; $dbh->{RaiseError} = 1; $sth = $dbh->prepare("SELECT COL_A,COL_C FROM $ODBCTEST::table_name WHERE COL_A=4"); if ($sth) { $sth->execute(); eval { while (@row = $sth->fetchrow()) { } }; $rc = 1 unless ($@) ; } $rc; } __END__ There are some observation I could make: - As it is, the script fails on a segmentation fault at "my $dbh3 = DBI->connect(..." - By removing the $dbh2 test, the $dbh3 connection doesn't kill the script there, but the script still fails with a segmentation fault when hitting the exit statement. - If I remove the $dbh3 test, then the script fails with an "Illegal instruction (core dumped)" on exit. - All parts of the select_long are needed for the segmentation fault. - If I remove both the $dbh2 abd $dbh3 tests, then the script runs and finishes without problem.
RE: How to perform JOINs with DBI
Ron, Here goes # Retrieve all infomation for this issue and store on variables $::sql = "SELECT I.idIssue, I.Description, I.idEntry, I.idStatus, E.Description,"; $::sql.= " E.CreateDate, E.idPriority, E.idSeverity, E.idUser, E.DueDate"; $::sql.= " FROM MASTER_Issue I, MASTER_Entry E"; $::criteria_var = "I.idIssue"; $::criteria = $::in{'MASTER_Issue.idIssue'}; $::add_criteria = "AND I.idEntry = E.idEntry"; $::reference = &SQL_Select($::sql, $::criteria_var, $::criteria, $::add_criteria); # This routine will select information from the database depending on the parameters passed on to it sub SQL_Select { my ($sql, $criteria_field, $criteria, $add_criteria) = @_; # Append criteria if present if ($criteria_field && $criteria) { $sql.= " WHERE $criteria_field = ?"; } # Any AND, OR or additional clauses if ($add_criteria) { $sql.= " $add_criteria"; } # Prepare a SQL statement my $sth = $::dbh->prepare( $sql ) or &Error("Unable to prepare statement."); # Execute the SQL statement prepared above, use with or without criteria depending on if it is present # or not if ($criteria) { my $rc = $sth->execute ( $criteria ) or &Error("Unable to execute statement", "$sql with criteria $criteria"); } else { my $rc = $sth->execute or &Error("Unable to execute statement", $sql); } # Return an array reference pointing to the results return my $result = $sth->fetchall_arrayref; } -Original Message- From: Reidy, Ron [mailto:[EMAIL PROTECTED] Sent: Friday, July 23, 2004 12:54 PM To: Moreno, Javier; [EMAIL PROTECTED] Subject: RE: How to perform JOINs with DBI Javier, Post your Perl code (relevant peices only). rr -Original Message- From: Moreno, Javier [mailto:[EMAIL PROTECTED] Sent: Fri 7/23/2004 11:35 AM To: Reidy, Ron; [EMAIL PROTECTED] Cc: Subject:RE: How to perform JOINs with DBI Ron, It returns the row I need. Regards, Javier Moreno -Original Message- From: Reidy, Ron [mailto:[EMAIL PROTECTED] Sent: Friday, July 23, 2004 12:33 PM To: Moreno, Javier; [EMAIL PROTECTED] Subject: RE: How to perform JOINs with DBI Javier, What does it do in SQL*Plus? rr -Original Message- From: Moreno, Javier [mailto:[EMAIL PROTECTED] Sent: Fri 7/23/2004 11:31 AM To: Reidy, Ron; [EMAIL PROTECTED] Cc: Subject:RE: How to perform JOINs with DBI Ron, This is the Oracle query SELECT I.idIssue, I.Description, I.idEntry, I.idStatus, E.Description, E.CreateDate, E.idPriority, E.idSeverity, E.idUser, E.DueDate FROM MASTER_Issue I, MASTER_Entry E WHERE I.idIssue = 'I4632362004' AND I.idEntry = E.idEntry Per Alan Kong's suggestion I tried single quoting the value but that did not work either. Regards, Javier Moreno -Original Message- From: Reidy, Ron [mailto:[EMAIL PROTECTED] Sent: Friday, July 23, 2004 12:24 PM To: Moreno, Javier; [EMAIL PROTECTED] Subject: RE: How to perform JOINs with DBI Javier, This is not a DBI issue. What does the query do in SQL*Plus? Is the relationship between the tables mandatory, or should you be using an outer or inner join? -- Ron Reidy Sr, DBA Array BioPharma, Inc. -Original Message- From: Moreno, Javier [mailto:[EMAIL PROTECTED] Sent: Fri 7/23/2004 11:19 AM To: [EMAIL PROTECTED] Cc: Subject:How to perform JOINs with DBI Hi all, I am having issues trying to do the following: SELECT I.idIssue, I.Description, I.idEntry, I.idStatus, E.Description, E.CreateDate, E.idPriority, E.idSeverity, E.idUser, E.DueDate FROM MASTER_Issue I, MASTER_Entry E WHERE I.idIssue = ? AND I.idEntry = E.idEntry The query runs fine but I get no information back from it. What could be wrong? I ran the same query (replacing the placeholder with the value) on the database and it ran fine and returned information. Regards, Javier Moreno <> Systems Engineer - Transmissions "When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth" - Sherlock Holmes This electronic message transmission is a PRIVATE communication which contains information which may be confidential or privileged. The information is intended to be for the use of the individual or entity named above. If you are not the intended recipient, please be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. Please notify the sender of the delivery error by replying to this message, or notify us by telephone (877-633-2436, ext. 0), and then delete it from your system. This electronic message transmission is a PRIVATE communication which contains information which may be confidential or privileged. The information is intended to be for the use of
DBI and DBD::Oracle install
Hello, Is there a problem with ftp.esoftmatic.com? I tried doing: ppm install ftp://ftp.esoftmatic.com/outgoing/DBI/5.8.3/DBI.ppd per the instructions in an email here from Jeff Urlwin a month ago. The install fails, so I tried to ftp there manually. The ftp timed out, and I can't ping ftp.esoftmatic.com. Ping finds the name and IP address for ftp.esoftmatic.com but "Request times out". We're a Java shop so I don't have Visual C++ or any C compiler to build them from source code. Is there an alternate site where I can get the DBI and DBD::Oracle packages for Windows? Thanks, -Greg Fischer Perot Systems Healthcare Blue Cross & Blue Shield of Rhode Island account ** MAILSWEEPER This e-mail and any files transmitted with are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking of any action in reliance on the information contained in this e-mail is prohibited. If you have received this e-mail in error, please immediately notify your e-mail administrator. Blue Cross & Blue Shield of Rhode Island in state: 401.751.1673 out of state: 1.800.343.5743 **
Re: DBI and DBD::Oracle install
"Greg Fischer/Bcbsri" wrote in message news:[EMAIL PROTECTED] > Hello, > > Is there a problem with ftp.esoftmatic.com? > > I tried doing: > > ppm install ftp://ftp.esoftmatic.com/outgoing/DBI/5.8.3/DBI.ppd > > per the instructions in an email here from Jeff Urlwin a month ago. The > install fails, so > I tried to ftp there manually. The ftp timed out, and I can't ping > ftp.esoftmatic.com. > Ping finds the name and IP address for ftp.esoftmatic.com but "Request > times out". > > We're a Java shop so I don't have Visual C++ or any C compiler to build > them from > source code. > > Is there an alternate site where I can get the DBI and DBD::Oracle > packages for Windows? > > Thanks, > > -Greg Fischer > Perot Systems Healthcare > Blue Cross & Blue Shield of Rhode Island account > There was a not for prime time release there. I asked a question about it and it was removed but he didn't put the older 1.15 version back up. :-( Robert
Oddity using placeholders w/ Oracle
Maybe I've just missed a known bug, but this seems kinda odd... The code below is running againsed Oracle-9.2.0.4 on RHE-3.0. Called with the same variable interpolated and as a placeholder it works or doesn't. I have any amount of code floating around here that uses placeholders and DOES work... Any suggesions? $ perl example; DBI Version: 1.43 DBD Version: 1.15 Value is: 'Q8R2H7' Result A: '133387' Result B: '' $ cat example; use DBI; use DBD::Oracle; use Data::Dumper; print "\n\tDBI Version: $DBI::VERSION\n"; print "\n\tDBD Version: $DBD::Oracle::VERSION\n"; my @connect_args = ( "dbi:Oracle:host=$ENV{ORACLE_HOST};sid=$ENV{ORACLE_SID}", $ENV{ORACLE_USER}, $ENV{ORACLE_PASS}, { RaiseError => 1 } ); my $dbh = DBI->connect( @connect_args ); my $value = 'Q8R2H7'; print "\n\tValue is: '$value'\n"; my $a = qq{ select entry_id from entry where entry_accno = '$value' }; my $b = q{ select entry_id from entry where entry_accno = ? }; { # this works... my $handle_a = $dbh->prepare( $a ); $handle_a->execute; my @row = $handle_a->fetchrow_array; print "\n\tResult A: '@row'\n"; } { # this doesn't my $handle_b = $dbh->prepare( $b ); $handle_b->execute( $value ); my @row = $handle_b->fetchrow_array; print "\n\tResult B: '@row'\n"; } -- Steven Lembark 9 Music Square South, Box 344 Workhorse ComputingNashville, TN 37203 [EMAIL PROTECTED] 1 888 359 3508