RE: Error on DBI

2006-04-17 Thread Raymond Wong
Hi Alexander,

Thanks for your reply. We have checked the table and DISP_MODFY_DT does
exist. In fact, when we re run the query using DBI or through query
analyzer, the query can return data. This is an intermittent problem
which makes the troubleshooting much more challenging. From your
experience, could this be a problem with DBI reporting false error? Or
could it be an intermittent problem over on the Database side? If that's
the case, could you send us an debug module so that we can capture more
clearly the state of the Database when this problem re-occurs?

Thanks a lot for your help.

-Original Message-
From: Alexander Foken [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 13, 2006 6:29 PM
To: Raymond Wong
Cc: dbi-users@perl.org; Tricia Koh
Subject: Re: Error on DBI

Your SQL statement in
d:\inetpub\wwwroot\S_script\Qdr\Reports\rpt_preview.plx line 99 contains
the column name DISP_MODFY_DT that does not exist in your database.
This is not a DBI problem, DBI is just reporting it. It is a problem
with your SQL statement, your Database and perhaps your connect string.

Alexander

On 13.04.2006 12:11, Raymond Wong wrote:

Hi,

I encountered this intermittent server error which I had been trying to

resolved :

*** 'd:\inetpub\wwwroot\S_script\Qdr\Reports\rpt_preview.plx' error 
message at: 2006/04/12 21:08:23 DBD::ODBC::st execute failed: 
[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid column name 
'DISP_MODFY_DT'. (SQL-S0022) [Microsoft][ODBC SQL Server Driver][SQL 
Server]Invalid column name 'DISP_MODFY_DT'. (SQL-S0022) 
[Microsoft][ODBC SQL Server Driver][SQL Server]Statement(s) could not 
be prepared. (SQL-37000)(DBD: st_execute/SQLExecute err=-1) at 
d:\inetpub\wwwroot\S_script\Qdr\Reports\rpt_preview.plx line 99.
Unable to execute the SQL statement. 
 Affected Item: [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid 
column name 'DISP_MODFY_DT'. (SQL-S0022) [Microsoft][ODBC SQL Server 
Driver][SQL Server]Invalid column name 'DISP_MODFY_DT'. (SQL-S0022) 
[Microsoft][ODBC SQL Server Driver][SQL Server]Statement(s) could not 
be prepared. (SQL-37000)(DBD: st_execute/SQLExecute err=-1)

This is an SQL query. When I tried to run the query shown in the error 
log, it works. The DB is Microsoft SQL 2000. May I know if anyone has 
encountered this error and share with me what is wrong with the above?
I've tried debugging using DBI trace but its provide the same error 
message as the server. I've also approached my DB administrator for 
help, but it could be application problem. Is it the application 
problem or DB problem?


  



--
Alexander Foken
mailto:[EMAIL PROTECTED]  http://www.foken.de/alexander/



Re: last insert id

2006-04-17 Thread Dr.Ruud
Ron Savage schreef:

 sub last_insert_id [...]
 if ($self - db_vendor() =~ /(?:mysql|Pg)/)

That regex can be written as /mysql|Pg/.

Notice that 'CertainlyNotPgAtAll' matches, so maybe you were looking for
  /\A(?:mysql|pg)\z/i

MySQL's native LAST_INSERT_ID() will return the *first* id from a multi
row insert. I don't now what DBI does with that.

DBI doc last_insert_id() For some drivers the $catalog, $schema,
$table, and $field parameters are required (e.g., Pg), for others they
are ignored (e.g., mysql).

-- 
Affijn, Ruud

Gewoon is een tijger.



Re: problem DBD-Oracle-1.17 linux enterprise AS

2006-04-17 Thread Oscar Gomez
the solution is to duplicate one of the fields of select. it is problem of the
module?. for example:
select
itmpar, texpar, texpar
from par
where ciapar = :p1 
and  fampar = :p2 '

--
Open WebMail Project (http://openwebmail.org)


-- Original Message ---
From: Kevin Moore [EMAIL PROTECTED]
To: Oscar Gomez [EMAIL PROTECTED]
Sent: Tue, 11 Apr 2006 20:11:44 -0700
Subject: Re: problem DBD-Oracle-1.17 linux enterprise AS

 Oscar,
 
 Are there errors in your alert log? The ora-600 is a generic 
 message. It's quite possible oracle generated a trace file that may 
 also help.
 
 Kevin
 
 Oscar Gomez wrote:
 
 i have this error when i made interface program perl with oracle 10g trough
 DBD module.
 DBD::Oracle::st execute failed: ORA-00600: internal error code, arguments:
 [kpofdr-long], [], [], [], [], [], [], [] (DBD ERROR: error possibly near *
 indicator at char 37 in 'select
 itmpar, texpar
 from useru.*par
 where ciapar = :p1 
 and  fampar = :p2 ') [for Statement select
 itmpar, texpar
 from useru.par
 where ciapar = ? 
 and  fampar = ?  with ParamValues: :p1=0, :p2='py-ley'] at
 ./1230.pl line 28.
 
 but,if I execute it for the second time it work ok.
 
 thanks 
 --
 Open WebMail Project (http://openwebmail.org)
 --- End of Forwarded Message ---
 
 
 --
 Open WebMail Project (http://openwebmail.org)
 
 
 
   
 
--- End of Original Message ---



DBD::Oracle install problems

2006-04-17 Thread MIKE VANOLE
Hi,

I've googled my error and have seen similar problems, but no solutions are
found.

/usr/local/sparc-sun-solaris2.8/bin/ld: cannot find -lclntsh

I'm trying to install any version of DBD::Oracle on Solaris 2.8, with perl
5.6.1. Currently trying DBD-Oracle 1.17. My Oracle environment is set up and
working as far as I can tell by using sqlplus successfully. My current
solution for Perl and Oracle invloves using open3 and sqlplus,  and I have
to get away from this.

My problem may be library related but I've tried numerous combinations of
LD_LIBRARY_PATH, etc...

Many thanks in advance. Mike

Here's the output from my latest attempt:

# perl Makefile.PL

Using DBI 1.40 (for perl 5.006001 on sun4-solaris) installed in
/usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris/auto/DB

I

Configuring DBD::Oracle for perl 5.006001 on solaris (sun4-solaris)

Remember to actually *READ* the README file! Especially if you have any
problems.

Using Oracle in /apps/oracle/product/9.2.0

DEFINE _SQLPLUS_RELEASE = 902000100 (CHAR)

Oracle version 9.2.0.1 (9.2)

Found /apps/oracle/product/9.2.0/rdbms/demo/demo_rdbms.mk

Found /apps/oracle/product/9.2.0/precomp/demo/proc/demo_proc.mk

Using /apps/oracle/product/9.2.0/rdbms/demo/demo_rdbms.mk

Your LD_LIBRARY_PATH env var is set to
'/apps/oracle/product/9.2.0/lib64:/apps/oracle/product/9.2.0/lib32'

Reading /apps/oracle/product/9.2.0/rdbms/demo/demo_rdbms.mk

Reading /apps/oracle/product/9.2.0/rdbms/lib/env_rdbms.mk

Attempting to discover Oracle OCI build rules

gcc -c DBD_ORA_OBJ.c

by executing: [make -f /apps/oracle/product/9.2.0/rdbms/demo/demo_rdbms.mk
build ECHODO=echo ECHO=echo GENCLNTSH='echo ge

nclntsh' CC=true OPTIMIZE= CCFLAGS= EXE=DBD_ORA_EXE OBJS=DBD_ORA_OBJ.o]

Oracle oci build prolog:

[Building client shared library libclntsh.so ...]

[Call script /apps/oracle/product/9.2.0/bin/genclntsh ...]

[genclntsh]

[Built /apps/oracle/product/9.2.0/lib/libclntsh.so ... DONE]

Oracle oci build command:

[true -L/apps/oracle/product/9.2.0/lib32/ -L/apps/oracle/product/9.2.0/rdbms
/lib32/ -o DBD_ORA_EXE DBD_ORA_OBJ.o

-lclntsh `cat
/apps/oracle/product/9.2.0/lib/sysliblist` -R/apps/oracle/product/9.2.0/lib 
-laio -lposix4 -lkstat -lm

-lthread]

Found header files in /apps/oracle/product/9.2.0/rdbms/demo
/apps/oracle/product/9.2.0/rdbms/public.

Checking for functioning wait.ph



System: perl5.006001 sunos solaris 5.8 generic sun4u sparc sunw,ultra-5_10

Compiler:
gcc -O -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE
_OFFSET_BITS=64

Linker: /usr/ccs/bin/ld

Sysliblist: -lnsl -lsocket -lgen -ldl -lsched

Oracle makefiles would have used these definitions but we override them:

CC: cc

CFLAGS: $(GFLAG) $(OPTIMIZE) $(CDEBUG) $(CCFLAGS) $(PFLAGS)\

$(SHARED_CFLAG) $(USRFLAGS)

[$(GFLAG) -xO3 $(CDEBUG) -Xa $(PROFILE) -xstrconst -dalign -xF $(XS)
$(MR) -xildoff -errtags=yes -v -xarch=v9

-xchip=ultra3 -W2,-AKNR_S -Wd,-xsafe=unboundsym -Wc,-Qiselect-funcalign=32 -
xcode=abs44 -Wc,-Qgsched-trace_late=1 -Wc,-Qg

sched-T5 -xalias_level=weak -D_REENTRANT -DSS_64BIT_SERVER -DBIT64 -DMACHINE
64 -K PIC -I/apps/oracle/product/9.2.0/rdbms/

demo -I/apps/oracle/product/9.2.0/rdbms/public -I/apps/oracle/product/9.2.0/
plsql/public -I/apps/oracle/product/9.2.0/net

work/public -DSLMXMX_ENABLE -DSLTS_ENABLE -D_SVID_GETTOD -D_REENTRANT
$(LPFLAGS) $(USRFLAGS)]

LDFLAGS: -o $@ $(LDPATHFLAG)$(PRODLIBHOME) $(LDPATHFLAG)$(LIBHOME)

[-o $@ -L/apps/oracle/product/9.2.0/rdbms/lib/ -L$(LIBHOME)]

Linking with OTHERLDFLAGS
= -L/apps/oracle/product/9.2.0/lib32/ -L/apps/oracle/product/9.2.0/rdbms/lib
32/ -lclntsh `c

at
/apps/oracle/product/9.2.0/lib/sysliblist` -R/apps/oracle/product/9.2.0/lib 
-laio -lposix4 -lkstat -lm -lthread [fro

m 'build' rule]



WARNING: If you have problems you may need to rebuild perl with threading
enabled.

WARNING: If you have problems you may need to rebuild perl
with -Uusemymalloc.

Checking if your kit is complete...

Looks good

LD_RUN_PATH=/apps/oracle/product/9.2.0/lib32:/apps/oracle/product/9.2.0/rdbm
s/lib32

Using DBD::Oracle 1.17.

Using DBI 1.40 (for perl 5.006001 on sun4-solaris) installed in
/usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris/auto/DB

I

Writing Makefile for DBD::Oracle

*** If you have problems...

read all the log printed above, and the README and README.help.txt files.

(Of course, you have read README by now anyway, haven't you?)



# make

Skip blib/lib/DBD/Oracle.pm (unchanged)

Skip blib/lib/DBD/Oracle/GetInfo.pm (unchanged)

Skip blib/arch/auto/DBD/Oracle/mk.pm (unchanged)

Skip blib/arch/auto/DBD/Oracle/dbdimp.h (unchanged)

Skip blib/arch/auto/DBD/Oracle/ocitrace.h (unchanged)

Skip blib/arch/auto/DBD/Oracle/Oracle.h (unchanged)

Skip blib/lib/oraperl.ph (unchanged)

Skip blib/lib/Oraperl.pm (unchanged)

/bin/sh -c true

/bin/sh -c true

/usr/bin/perl -p -e s/~DRIVER~/Oracle/g
/usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris/auto/DBI/Driver.xst 
Oracle.

xsi

/usr/bin/perl 

Re: DBD::Oracle install problems

2006-04-17 Thread John Scoles
 Using DBI 1.40 (for perl 5.006001 on sun4-solaris) installed in
 /usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris/auto/DB


That version of  DBI is over 2 years old so I doubt it will work with
DBD::Oracle 1.17.  You might want to try upgrading your DBI first.


MIKE VANOLE [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi,

 I've googled my error and have seen similar problems, but no solutions are
 found.

 /usr/local/sparc-sun-solaris2.8/bin/ld: cannot find -lclntsh

 I'm trying to install any version of DBD::Oracle on Solaris 2.8, with perl
 5.6.1. Currently trying DBD-Oracle 1.17. My Oracle environment is set up
and
 working as far as I can tell by using sqlplus successfully. My current
 solution for Perl and Oracle invloves using open3 and sqlplus,  and I have
 to get away from this.

 My problem may be library related but I've tried numerous combinations of
 LD_LIBRARY_PATH, etc...

 Many thanks in advance. Mike

 Here's the output from my latest attempt:

 # perl Makefile.PL

 Using DBI 1.40 (for perl 5.006001 on sun4-solaris) installed in
 /usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris/auto/DB

 I

 Configuring DBD::Oracle for perl 5.006001 on solaris (sun4-solaris)

 Remember to actually *READ* the README file! Especially if you have any
 problems.

 Using Oracle in /apps/oracle/product/9.2.0

 DEFINE _SQLPLUS_RELEASE = 902000100 (CHAR)

 Oracle version 9.2.0.1 (9.2)

 Found /apps/oracle/product/9.2.0/rdbms/demo/demo_rdbms.mk

 Found /apps/oracle/product/9.2.0/precomp/demo/proc/demo_proc.mk

 Using /apps/oracle/product/9.2.0/rdbms/demo/demo_rdbms.mk

 Your LD_LIBRARY_PATH env var is set to
 '/apps/oracle/product/9.2.0/lib64:/apps/oracle/product/9.2.0/lib32'

 Reading /apps/oracle/product/9.2.0/rdbms/demo/demo_rdbms.mk

 Reading /apps/oracle/product/9.2.0/rdbms/lib/env_rdbms.mk

 Attempting to discover Oracle OCI build rules

 gcc -c DBD_ORA_OBJ.c

 by executing: [make -f /apps/oracle/product/9.2.0/rdbms/demo/demo_rdbms.mk
 build ECHODO=echo ECHO=echo GENCLNTSH='echo ge

 nclntsh' CC=true OPTIMIZE= CCFLAGS= EXE=DBD_ORA_EXE OBJS=DBD_ORA_OBJ.o]

 Oracle oci build prolog:

 [Building client shared library libclntsh.so ...]

 [Call script /apps/oracle/product/9.2.0/bin/genclntsh ...]

 [genclntsh]

 [Built /apps/oracle/product/9.2.0/lib/libclntsh.so ... DONE]

 Oracle oci build command:


[true -L/apps/oracle/product/9.2.0/lib32/ -L/apps/oracle/product/9.2.0/rdbms
 /lib32/ -o DBD_ORA_EXE DBD_ORA_OBJ.o

 -lclntsh `cat

/apps/oracle/product/9.2.0/lib/sysliblist` -R/apps/oracle/product/9.2.0/lib
 -laio -lposix4 -lkstat -lm

 -lthread]

 Found header files in /apps/oracle/product/9.2.0/rdbms/demo
 /apps/oracle/product/9.2.0/rdbms/public.

 Checking for functioning wait.ph



 System: perl5.006001 sunos solaris 5.8 generic sun4u sparc sunw,ultra-5_10

 Compiler:

gcc -O -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE
 _OFFSET_BITS=64

 Linker: /usr/ccs/bin/ld

 Sysliblist: -lnsl -lsocket -lgen -ldl -lsched

 Oracle makefiles would have used these definitions but we override them:

 CC: cc

 CFLAGS: $(GFLAG) $(OPTIMIZE) $(CDEBUG) $(CCFLAGS) $(PFLAGS)\

 $(SHARED_CFLAG) $(USRFLAGS)

 [$(GFLAG) -xO3 $(CDEBUG) -Xa $(PROFILE) -xstrconst -dalign -xF $(XS)
 $(MR) -xildoff -errtags=yes -v -xarch=v9

 -xchip=ultra3 -W2,-AKNR_S -Wd,-xsafe=unboundsym -Wc,-Qiselect-funcalign=32
 -
 xcode=abs44 -Wc,-Qgsched-trace_late=1 -Wc,-Qg


sched-T5 -xalias_level=weak -D_REENTRANT -DSS_64BIT_SERVER -DBIT64 -DMACHINE
 64 -K PIC -I/apps/oracle/product/9.2.0/rdbms/


demo -I/apps/oracle/product/9.2.0/rdbms/public -I/apps/oracle/product/9.2.0/
 plsql/public -I/apps/oracle/product/9.2.0/net

 work/public -DSLMXMX_ENABLE -DSLTS_ENABLE -D_SVID_GETTOD -D_REENTRANT
 $(LPFLAGS) $(USRFLAGS)]

 LDFLAGS: -o $@ $(LDPATHFLAG)$(PRODLIBHOME) $(LDPATHFLAG)$(LIBHOME)

 [-o $@ -L/apps/oracle/product/9.2.0/rdbms/lib/ -L$(LIBHOME)]

 Linking with OTHERLDFLAGS

= -L/apps/oracle/product/9.2.0/lib32/ -L/apps/oracle/product/9.2.0/rdbms/lib
 32/ -lclntsh `c

 at

/apps/oracle/product/9.2.0/lib/sysliblist` -R/apps/oracle/product/9.2.0/lib
 -laio -lposix4 -lkstat -lm -lthread [fro

 m 'build' rule]



 WARNING: If you have problems you may need to rebuild perl with threading
 enabled.

 WARNING: If you have problems you may need to rebuild perl
 with -Uusemymalloc.

 Checking if your kit is complete...

 Looks good


LD_RUN_PATH=/apps/oracle/product/9.2.0/lib32:/apps/oracle/product/9.2.0/rdbm
 s/lib32

 Using DBD::Oracle 1.17.

 Using DBI 1.40 (for perl 5.006001 on sun4-solaris) installed in
 /usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris/auto/DB

 I

 Writing Makefile for DBD::Oracle

 *** If you have problems...

 read all the log printed above, and the README and README.help.txt files.

 (Of course, you have read README by now anyway, haven't you?)



 # make

 Skip blib/lib/DBD/Oracle.pm (unchanged)

 Skip blib/lib/DBD/Oracle/GetInfo.pm (unchanged)

 Skip blib/arch/auto/DBD/Oracle/mk.pm (unchanged)

 Skip 

Re: last insert id

2006-04-17 Thread Ron Savage
On Mon, 17 Apr 2006 15:29:03 +0200, Dr.Ruud wrote:

Hi

 sub last_insert_id [...]
 if ($self - db_vendor() =~ /(?:mysql|Pg)/)

 That regex can be written as /mysql|Pg/.

Correct.

 Notice that 'CertainlyNotPgAtAll' matches, so maybe you were
 looking for /\A(?:mysql|pg)\z/i

Nope. Method db_vendor() extracts the vendor's name from the connect string
passed to DBI, so I don't see how it could return that :-))).

 MySQL's native LAST_INSERT_ID() will return the *first* id from a
 multi row insert. I don't now what DBI does with that.

Good point. But then my code doesn't come with a written guarantee to work with
multi-row inserts...

 DBI doc last_insert_id() For some drivers the $catalog, $schema,
 $table, and $field parameters are required (e.g., Pg), for others
 they are ignored (e.g., mysql).

Right. That's why they are undef for MySQL, and it seems the last time I tested
it under Pg, undef worked there too, but that was months ago. Proof to the
contrary should be published here.

--
Cheers
Ron Savage, [EMAIL PROTECTED] on 18/04/2006
http://savage.net.au/index.html
Let the record show: Microsoft is not an Australian company




Re: last insert id

2006-04-17 Thread Greg Sabino Mullane

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


 DBI doc last_insert_id() For some drivers the $catalog, $schema,
 $table, and $field parameters are required (e.g., Pg), for others
 they are ignored (e.g., mysql).

 Right. That's why they are undef for MySQL, and it seems the last time I 
 tested
 it under Pg, undef worked there too, but that was months ago. Proof to the
 contrary should be published here.

Yes, undef is fine for Pg: the only required attribute is the tablename, and 
even
that can be left off if a sequence name is passed in via the %attrib. I've been
meaning to get that part of the doc updated for a while, so thanks for the
reminder. A patch would be overkill: could someone with commit access simply
remove the (e.g., Pg) bit from that line in DBI.pm? Thanks much.

- --
Greg Sabino Mullane [EMAIL PROTECTED]
PGP Key: 0x14964AC8 200604172137
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8

-BEGIN PGP SIGNATURE-

iD8DBQFERELdvJuQZxSWSsgRAn7sAKDGdWPleJJjRevHBSxe71+/NLRAjQCg11/W
O61U4cWfQXrAufsUtWoK350=
=p7GB
-END PGP SIGNATURE-