RE: DBD::ODBC SQLCancel?

2002-12-06 Thread martin
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

I may have missed some of this thread but isn't SQLCancel just used to cancel:

[1] a function running asynchronously
[2] a function on a statement that needs data
[3] a function running on the statement in another thread

Your code doesn't seem to fit any of those.

[1] I don't see any setting for ASYNCHRONOUS execution
[2] you execute is returning a result-set and does not need any data (i.e. it
is not parameterised with SQL_DATA_AT_EXEC.
[3] there are no threads.

Any code doing:

SQLPrepare
SQLExecute (select * from table)
SQLCancel

is going to fail in ODBC if asynchronous execution is turned off (it is by
default). If asynchronous execution was enabled and the SQLExecute need to take
a very long time then the SQLExecute call comes back with SQL_STILL_EXECUTING
and THEN you can call SQLCancel.

Martin
- -- 
Martin J. Evans
Easysoft Ltd, UK
Development


On 04-Dec-2002 Vassiliy Truskov wrote:
 Hello everybody.
 
 I call SQLCancel function to cancel my query and got an error:
 DBD: no statement executing err=-1.
 It looks like statement is not defined in DBIc_ACTIVE(imp_sth).
 I run it on osf1 unix 4, DBI 1.31, DBD::ODBC 0.45_18.
 I use SDK iODBC driver manager version 3.
 
 The trace is following:
 
 - prepare for DBD::ODBC::db (DBI::db=HASH(0x140087e68)~0x140087dd8
 'select count(*) from amount where amount  1200' HASH(0x1402f6b60))
 New DBI::st (for DBD::ODBC::st, parent=DBI::db=HASH(0x140087dd8),
 id=)
 
 dbih_setup_handle(DBI::st=HASH(0x140087e58)=DBI::st=HASH(0x140089508),
 DBD::ODBC::st, 140087e78, Null!)
 dbih_make_com(DBI::db=HASH(0x140087dd8), DBD::ODBC::st, 368) thr#0
 dbih_setup_attrib(DBI::st=HASH(0x140089508), Err,
 DBI::db=HASH(0x140087dd8)) SCALAR(0x14022f240) (already defined)
 dbih_setup_attrib(DBI::st=HASH(0x140089508), State,
 DBI::db=HASH(0x140087dd8)) SCALAR(0x14022f1e0) (already defined)
 dbih_setup_attrib(DBI::st=HASH(0x140089508), Errstr,
 DBI::db=HASH(0x140087dd8)) SCALAR(0x14022f210) (already defined)
 dbih_setup_attrib(DBI::st=HASH(0x140089508), Debug,
 DBI::db=HASH(0x140087dd8)) 0 (already defined)
 dbih_setup_attrib(DBI::st=HASH(0x140089508), FetchHashKeyName,
 DBI::db=HASH(0x140087dd8)) 'NAME' (already defined)
 dbih_setup_attrib(DBI::st=HASH(0x140089508), HandleError,
 DBI::db=HASH(0x140087dd8)) undef (not defined)
 - prepare= DBI::st=HASH(0x140087e58) at psql_m.pl line 1036 via
 psql_m.pl line 865
 - execute for DBD::ODBC::st (DBI::st=HASH(0x140087e58)~0x140089508)
 
 1   - cancel for DBD::ODBC::st (DBI::st=HASH(0x140087e58)~0x140089508)
 !! ERROR: -1 '(DBD: no statement executing err=-1)'
 1   - cancel= undef at psql_m.pl line 3540 via psql_m.pl line 1060
 - $DBI::errstr () FETCH from lasth=HASH
  DBD::ODBC::st::errstr
 - $DBI::errstr= '(DBD: no statement executing err=-1)'
 !! ERROR: -1 '(DBD: st_execute/SQLExecute err=-1)'
 
 Thanks in advance,
 Vassiliy
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE98GwijLvsvprkFrMRAkxbAJ0byKurxDVqsZ9ZvErEvBNCNXsKaACfQ94i
8awIFTtDZhDkCZz/VX6jG4M=
=g7zP
-END PGP SIGNATURE-



Re: DBI, DBD-PG, Windows 2000

2002-12-06 Thread Stephan Harren


Do you have the PostgreSQL client libraries installed? Are you running 
under Cygwin? IIRC, the PostgreSQL client libraries require Cygwin.

HTH,

David

Just for compiling or at runtime?

Best regards,

Stephan


--
Stephan Harren
Manager Site Operations
MFN - Internet Services
---
Tel. : +49 69 90554 153
Cell : +49 173 7011126
Mail : [EMAIL PROTECTED]




SQL_LONVARBINARY question

2002-12-06 Thread Brad Smith
I was just looking at the 'longbin.pl' test script that is bundled with 
DBD::ODBC, which has raised a few questions:

1.  To place a blob in an Access database, as per the example script, is 
it necessary to use the Digest::MD5 module, or is it's use an optional 
step that is ultimately suggested?

2.  Unlike a text field or an integer field (etc.), a blob field has both a file 
name and file data.  When reading the data, as per the example, I see 
that the SELECT statement gets just 'picture'.  At what point does it 
parse the file name from the file data?

Having not ever used the Digest::MD5 module, I suspect that it is what 
handles all of this, but I just wanted qualified verification before I dove 
in and got too deep.

Thanks in advance.

Brad Smith



DBD::mysql install frails update

2002-12-06 Thread David Driscoll
Follow up to my post of 12/05
I found some suggestions on the MYSQL site  tried them all:
libmysqlclient.so already was in /usr/lib
compile with perl Makefile.PL -static -config
add path to /usr/lib to /etc/ld.so.conf
set  LD_RUN_PATH to /usr/lib

No change:  make generates an error saying it can't find mysql.so
and quits.

Any help would be apprieciated
Dave Driscoll





RE: :ODBC SQLCancel?

2002-12-06 Thread Jeff Urlwin

 Sorry, I didn't reply-all.
 
 I use Nucleus ODBC driver for Sand Analytic Server.
 I agree that the problem may be in the driver, but
 SQLExecute would finished successful if I don't stop it.
 it uses the same statement handler imp_sth-hstmt.
 I commented checking for active statement in dbdimp.c and 
 execute this code. The error I got is '[iODBC][Driver 
 Manager]Function sequence error' I checked odbc driver trace 
 and didn't find call SQLCancel after SQLExecute. The trace now is:
 
 Thu Dec  5 14:27:53 2002
 Returning from SQLPrepare()
 Retcode = SQL_SUCCESS
 
 Thu Dec  5 14:27:53 2002
 Entering SQLExecute()
 hstmt: 4049b018
 
 
 Thu Dec  5 14:27:57 2002
 Entering SQLGetDiagRec()
 HandleType: SQL_HANDLE_STMT
 Handle: 4049b018
 RecNumber: 1
 Sqlstate: 1fffcf00
 NativeErrorPtr: 1fffcef0
 Message: 1fffcf50
 BufferLength: 511
 TextLengthPtr: 1fffcef8
 
 
 Thu Dec  5 14:27:57 2002
 Returning from SQLGetDiagRec()
 Retcode = SQL_NO_DATA_FOUND

Hmm -- is this a valid query?  It could be the specific query, since no
data is found, is ending itself.

 
 Is there a way to set a trace of Driver Manager to see
 what it goes to the odbc driver exactly?


I'm not sure about iODBC, but you can with UnixODBC.  You can try to
switch to that.


 
 Vassiliy
 
 Jeff Urlwin wrote:
 
  
   It works for me on Windows as well. The problem occurred only on 
   unix. ODBC Driver doesn't read data to the buffer yet 
 according the 
   driver trace:
  
   Thu Dec  5 10:07:43 2002
   Entering SQLPrepare()
   hstmt: 4049b018
   StatementText: select count(*) from amount where amount  1200
   TextLength: 47
  
   Thu Dec  5 10:07:43 2002
   Returning from SQLPrepare()
   Retcode = SQL_SUCCESS
  
   Thu Dec  5 10:07:43 2002
   Entering SQLExecute()
   hstmt: 4049b018
  
   Execute doesn't finished yet. Also I checked on the 
 server, query is 
   in 'execute' mode. Any ideas?
 
  Which driver are you using?  The iODBC is the driver manager.  What 
  type of database are you trying to use?
 
  (I'm betting on a driver bug, BTW)
 
  Regards
 
  Jeff
 
  
   Vassiliy
  
  
   Jeff Urlwin wrote:
  

 Hello everybody.

 I call SQLCancel function to cancel my query and got an error:
 DBD: no statement executing err=-1.
 It looks like statement is not defined in 
 DBIc_ACTIVE(imp_sth). 
 I run it on osf1 unix 4, DBI 1.31, DBD::ODBC 0.45_18. I use
   SDK iODBC
 driver manager version 3.
   
I'm not getting that error on Windows, using DBI 1.30.  
 Which ODBC 
driver are you using?  It may be that the driver isn't
   returning any
rows for the query or only returning one row since it's 
 a count() 
query and the driver has already read that row into a 
 buffer and 
finished the execution.  Can you try it with a query 
 that will 
return multiple rows ( than the number of rows being buffered)?
   
Jeff
   

 The trace is following:

 - prepare for DBD::ODBC::db 
 (DBI::db=HASH(0x140087e68)~0x140087dd8
 'select count(*) from amount where amount  1200'
   HASH(0x1402f6b60))
 New DBI::st (for DBD::ODBC::st, 
 parent=DBI::db=HASH(0x140087dd8),
 id=)

 dbih_setup_handle(DBI::st=HASH(0x140087e58)=DBI::st=HASH(0x14
 0089508),
 DBD::ODBC::st, 140087e78, Null!)
 dbih_make_com(DBI::db=HASH(0x140087dd8),
   DBD::ODBC::st, 368) thr#0
 dbih_setup_attrib(DBI::st=HASH(0x140089508), Err,
 DBI::db=HASH(0x140087dd8)) SCALAR(0x14022f240) 
 (already defined)
 dbih_setup_attrib(DBI::st=HASH(0x140089508), State,
 DBI::db=HASH(0x140087dd8)) SCALAR(0x14022f1e0) 
 (already defined)
 dbih_setup_attrib(DBI::st=HASH(0x140089508), Errstr,
 DBI::db=HASH(0x140087dd8)) SCALAR(0x14022f210) 
 (already defined)
 dbih_setup_attrib(DBI::st=HASH(0x140089508), Debug,
 DBI::db=HASH(0x140087dd8)) 0 (already defined)
 dbih_setup_attrib(DBI::st=HASH(0x140089508), 
 FetchHashKeyName,
 DBI::db=HASH(0x140087dd8)) 'NAME' (already defined)
 dbih_setup_attrib(DBI::st=HASH(0x140089508), HandleError,
 DBI::db=HASH(0x140087dd8)) undef (not defined)
 - prepare= DBI::st=HASH(0x140087e58) at psql_m.pl
   line 1036 via
 psql_m.pl line 865
 - execute for DBD::ODBC::st
 (DBI::st=HASH(0x140087e58)~0x140089508)

 1   - cancel for DBD::ODBC::st
 (DBI::st=HASH(0x140087e58)~0x140089508)
 !! ERROR: -1 '(DBD: no statement executing err=-1)'
 1   - cancel= undef at psql_m.pl line 3540 via psql_m.pl
   line 1060
 - $DBI::errstr () FETCH from lasth=HASH
  DBD::ODBC::st::errstr
 - $DBI::errstr= '(DBD: no statement executing err=-1)'
 !! ERROR: -1 '(DBD: st_execute/SQLExecute err=-1)'

 Thanks in advance,
 Vassiliy



  
 
 





Re: SQL_LONVARBINARY question

2002-12-06 Thread Bart Lateur
On Fri, 06 Dec 2002 06:50:57 -0500, Brad Smith wrote:

I was just looking at the 'longbin.pl' test script that is bundled with 
DBD::ODBC, which has raised a few questions:

Hmm... I don't seem to have it, but I could find it on CPAN.

http://search.cpan.org/src/JURL/DBD-ODBC-0.45_18/mytest/

1.  To place a blob in an Access database, as per the example script, is 
it necessary to use the Digest::MD5 module, or is it's use an optional 
step that is ultimately suggested?

Heh?!? Don't be silly. It's not necessary at all. Digest::MD5 is module
to create some kind of checksum, much like CRC but bigger (128 bit or 16
bytes, often displayed in hex (32 characters) or base64 (Jee, I don't
know... 22 or so. time 4/3 and round up)) It's one way to check if all
bytes in a large binary string of data is intact. Any bit that changes
will result in at several bits of the checksum flipping. All small
corruptions will be detected. If your data has the same length and the
same checksum as calculated earlier, you may be virtually sure that your
data is still intact.

2.  Unlike a text field or an integer field (etc.), a blob field has both a file 
name and file data.  When reading the data, as per the example, I see 
that the SELECT statement gets just 'picture'.  At what point does it 
parse the file name from the file data?

A blob is a binary string. It will only contain the contents of the
file. If you want to store other features, like the file name, size, MD5
checksum, modification date, ... then you need to provide more fields
for those. It's that simple.

Having not ever used the Digest::MD5 module, I suspect that it is what 
handles all of this, but I just wanted qualified verification before I dove 
in and got too deep.

It does nothing of the kind.

-- 
Bart.



Re: Can't compile Pg on Mac OS 10.2.2

2002-12-06 Thread Randall Perry
 Well, here on the DBI list, we can help you with DBD::Pg, as it's the
 PostgreSQL DBI driver. But for pgperl, you'll have to ask the
 PostgreSQL folks.

Right-o. Below is my output trying to compile DBD::Pg.

My system:
Mac OS 10.2.2 server
Perl 5.8 compiled with thread support
PostgreSQL 7.2.3 in /usr/local/pgsql

My env:
[systame1:local/src/DBD-Pg-1.20] randy% env
USER=randy
LOGNAME=randy
HOME=/Users/randy
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin
MAIL=/var/mail/randy
SHELL=/bin/tcsh
SSH_CLIENT=192.168.2.1 49204 22
SSH_TTY=/dev/ttyp1
TERM=vt100
HOSTTYPE=macintosh
VENDOR=apple
OSTYPE=darwin
MACHTYPE=powerpc
SHLVL=1
PWD=/usr/local/src/DBD-Pg-1.20
GROUP=staff
HOST=systame1
REMOTEHOST=192.168.2.1
POSTGRES_INCLUDE=/usr/local/pgsql/include
POSTGRES_LIB=/usr/local/pgsql/lib:/usr/local/lib:/usr/lib
LC_ALL=C
LANG=en_US
LD_LIBRARY_PATH=/usr/local/pgsql/lib:/usr/local/lib:/usr/lib



DBD::PG 1.13


Configuring Pg
Remember to actually read the README file !
OS: darwin
Multiple copies of Driver.xst found in:
/Library/Perl/darwin-thread-multi/auto/DBI
/Library/Perl/darwin-thread-multi/auto/DBI at Makefile.PL line 33
Using DBI 1.19 installed in /Library/Perl/darwin-thread-multi/auto/DBI
Checking if your kit is complete...
Looks good
Note (probably harmless): No library found for -lpq
Writing Makefile for DBD::Pg

[systame1:local/src/DBD-Pg-1.13] randy% make
cc -c  -I/usr/local/pgsql/include
-I/Library/Perl/darwin-thread-multi/auto/DBI -pipe -fno-common
-no-cpp-precomp -fno-strict-aliasing -O3   -DVERSION=\1.13\
-DXS_VERSION=\1.13\  -I/Library/Perl/darwin-thread-multi/CORE   Pg.c
cc -c  -I/usr/local/pgsql/include
-I/Library/Perl/darwin-thread-multi/auto/DBI -pipe -fno-common
-no-cpp-precomp -fno-strict-aliasing -O3   -DVERSION=\1.13\
-DXS_VERSION=\1.13\  -I/Library/Perl/darwin-thread-multi/CORE   dbdimp.c
dbdimp.c: In function `dbd_bind_ph':
dbdimp.c:1041: internal error: Bus error
Please submit a full bug report,
with preprocessed source if appropriate.
See URL:http://developer.apple.com/bugreporter for instructions.
{standard input}:1407:FATAL:.abort  detected.  Assembly stopping.
make: *** [dbdimp.o] Error 1



DBD::PG 1.20


Configuring Pg
Remember to actually read the README file !
OS: darwin
Using DBI 1.19 installed in /Library/Perl/darwin-thread-multi/auto/DBI
Checking if your kit is complete...
Looks good
Note (probably harmless): No library found for -lpq
Writing Makefile for DBD::Pg

[systame1:local/src/DBD-Pg-1.20] randy% make
cc -c  -I/usr/local/pgsql/include
-I/Library/Perl/darwin-thread-multi/auto/DBI -pipe -fno-common
-no-cpp-precomp -fno-strict-aliasing -O3   -DVERSION=\1.20\
-DXS_VERSION=\1.20\  -I/Library/Perl/darwin-thread-multi/CORE   Pg.c
cc -c  -I/usr/local/pgsql/include
-I/Library/Perl/darwin-thread-multi/auto/DBI -pipe -fno-common
-no-cpp-precomp -fno-strict-aliasing -O3   -DVERSION=\1.20\
-DXS_VERSION=\1.20\  -I/Library/Perl/darwin-thread-multi/CORE   dbdimp.c
dbdimp.c: In function `dbd_bind_ph':
dbdimp.c:1092: internal error: Bus error
Please submit a full bug report,
with preprocessed source if appropriate.
See URL:http://developer.apple.com/bugreporter for instructions.
{standard input}:1405:FATAL:.abort  detected.  Assembly stopping.
make: *** [dbdimp.o] Error 1



-- 
Randall Perry
sysTame

Xserve Web Hosting/Co-location
Website Development/Promotion
Mac Consulting/Sales

http://www.systame.com/





MySQL and Data manipulation

2002-12-06 Thread Chris Rogers
I have a question about the configuration of mysql.  Let's say I have a
field that is defined as a decimal(10,3).  To my understanding that field
will hold values up to 999.999.  My problem is that if I do an insert or
using that field with a value that exceeds the preset limits (ie:
12345678.123), mysql will change the value to the maximum allowed for that
field and perform the requested action without an error.  If you do this in
the mysql, it produces a warning.  If you do this via DBI, the action is
performed and no indication is returned that there was a problem.  OK,
finally, here is my question:  Can mysql be configured to fail on the insert
or update a field with invalid data?  If it cannot, is there a way to inform
my perl script that there was a warning associated with the action?

Thanks,
Chris



Re: MySQL and Data manipulation

2002-12-06 Thread Michael Ragsdale
At 09:55 AM 12/6/2002, Chris Rogers wrote:

I have a question about the configuration of mysql.  Let's say I have a
field that is defined as a decimal(10,3).  To my understanding that field
will hold values up to 999.999.  My problem is that if I do an insert or
using that field with a value that exceeds the preset limits (ie:
12345678.123), mysql will change the value to the maximum allowed for that
field and perform the requested action without an error.  If you do this in
the mysql, it produces a warning.  If you do this via DBI, the action is
performed and no indication is returned that there was a problem.  OK,
finally, here is my question:  Can mysql be configured to fail on the insert
or update a field with invalid data?  If it cannot, is there a way to inform
my perl script that there was a warning associated with the action?

Thanks,
Chris


Use $dbh-{'info'} to notify yourself of warnings.  This is the Perl 
equivalent of the C API function mysql_info().  See the MySQL manual for 
details.

-Mike



Re: DBI, DBD-PG, Windows 2000

2002-12-06 Thread David Wheeler
On Friday, December 6, 2002, at 02:31  AM, Stephan Harren wrote:


Do you have the PostgreSQL client libraries installed? Are you 
running under Cygwin? IIRC, the PostgreSQL client libraries require 
Cygwin.
HTH,
David
Just for compiling or at runtime?


Both. They're dynamically loaded at runtime, and need to be around at 
compile time so that DBD::Pg knows what it's going to be loading.

David

--
David Wheeler AIM: dwTheory
[EMAIL PROTECTED] ICQ: 15726394
http://david.wheeler.net/  Yahoo!: dew7e
   Jabber: [EMAIL PROTECTED]



Re: Can't compile Pg on Mac OS 10.2.2

2002-12-06 Thread David Wheeler
On Friday, December 6, 2002, at 06:24  AM, Randall Perry wrote:


Note (probably harmless): No library found for -lpq
Writing Makefile for DBD::Pg


This is your problem. Unset POSTGRES_LIB and POSTGRES_INCLUDE and try 
again. If Makefile.PL can't find your libraries and includes, then set 
these environment variables to each point to a single directory.

HTH,

David

--
David Wheeler AIM: dwTheory
[EMAIL PROTECTED] ICQ: 15726394
http://david.wheeler.net/  Yahoo!: dew7e
   Jabber: [EMAIL PROTECTED]



Problem with DBD::Oracle on HP-UX

2002-12-06 Thread Markus Trenkle
Hello again,

I recently asked for help getting DBD::Oracle on HP-UX to work. In the 
meantime I succeeded in installing it on another machine. The software 
does what it is supposed to do. However, during testing it complained 
about some Oracle Libraries that were not found. I worked around this 
by creating the directories

/hpx/work/ee/8.1.7.4/hpx32/src_0424/lib

and putting links to the Oracle libraries there (I have no access to 
the system now, so I can not provide the exact names. The path is 
correct). This is not good because I must not create files under root 
(/). I found another guy in some hp support forum who has the same 
problem, but no solution so far. I even could not find any hint where 
this path is coming from. Maybe somebody of you could point me in the 
right direction.

Thanks,
Markus



RE: SQL_LONVARBINARY question

2002-12-06 Thread Jeff Urlwin
 
 
 I was just looking at the 'longbin.pl' test script that is 
 bundled with 
 DBD::ODBC, which has raised a few questions:
 
 1.  To place a blob in an Access database, as per the example 
 script, is 
 it necessary to use the Digest::MD5 module, or is it's use an 
 optional 
 step that is ultimately suggested?

Neither, actually.  The MD5 algorithm is good for *testing* that you got
what you put in, but I'd not necessarily use that in production code.  I
only used it to make sure, in the example, the inserted data is the same
as the retrieved data.  The steps are:
The MD5 hash is created on the source data
Then the data is inserted
The data is selected from the database
The second MD5 hash is created on the retrieved data
and then they are compared to ensure accuracy of the data.

The issue I was having was verifying correctness and that example is
good to use when designing the system and testing with arbitrary binary
inserts.  I used some graphics files to test.  For example, I found that
under Access, I had to do something special (tell Access what type the
data being bound was) to ensure data  64K worked.  So -- it's a good
sanity test for your application during development, not necessarily
during production.  
 
 2.  Unlike a text field or an integer field (etc.), a blob 
 field has both a file 
 name and file data.  When reading the data, as per the example, I see 
 that the SELECT statement gets just 'picture'.  At what point does it 
 parse the file name from the file data?

Actually, in this example, I didn't insert the file name, thus it wasn't
in the database.  I simply inserted the data to test inserting long
binary objects with different databases.  If you want/need to store the
file name too, then add that as another column.  

 
 Having not ever used the Digest::MD5 module, I suspect that 
 it is what 
 handles all of this, but I just wanted qualified verification 
 before I dove 
 in and got too deep.

Nope.  That's not what it does.  [Over simplifying here -- sorry if this
comes across the wrong way] Digest::MD5 creates a special value based
upon the data passed into it.  If you pass the same data through the MD5
algorithm, you'll get the same value from it.  If you pass different
data, you'll get a different value.  I was simply using this instead of
a byte-by-byte comparison of the data.  If you'll notice a lot of FTP
sites and file repositories have a file and a .md5 file in the same
directory.  So you have: foo.tar.gz and foo.tar.gz.md5.  The .md5 file
is just the MD5 digest of the file itself.  This is to allow you, after
you download it, to compare the file to what's on the server.  If the
MD5 values don't match, you didn't get the file correctly (or it's been
altered since the MD5 value was generated). 

While I wouldn't necessarily use MD5 in my production code, there are
some good reasons to use it: you want to verify what you put in is what
you get out.  I.e. nothing has corrupted the data since you put it in.
There are security and other reasons you might want to do this.  I had
an example where I was sending data over a slow, unreliable link, so I
built some perl scripts to send the data in smaller size chunks and the
other side got both the data and the MD5 hash.  If they didn't match,
the other side requested a new version of that file.  This is just
plain handy for a lot of things -- but may not be what you want.

Also -- _typically_, I don't recommend storing image files in the
database itself.  For some applications, it's fine, but if performance
is your issue, then storing the files on the file system and storing a
filename in the database is just faster, for *most* applications.  Keep
in mind, that I'm saying typically and mostthese are not hard
rules per say, just things I've learned over the years.  
Regards,

Jeff






RE: dbiproxy vs. ODBC on UNIX with regard to maintenance

2002-12-06 Thread Jeff Urlwin
 
 
 Hi all,
 
 I am accessing a Win2K-based MS SQL Server database from Unix-based 
 (mod_)perl scripts. I am doing this using DBD::Proxy and the dbiproxy 
 from the DBI distribution.
 
 Now I am about to leave my job and management is concerned 
 about who is 
 going to maintain the setup. As nobody has got any experience 
 with the 
 Perl DBI they don't want to maintain the proxy. They've got 
 to maintain 
 the SQL Server and ODBC anyway, so the question would be: will it be 
 easier to dig up some ODBC-libraries for Unix and maintain 
 them rather 
 than the current setup.

The easier question is one of politics, funding, etc.  I use, in
testing, EasySoft's ODBC-ODBC bridge which is a supported, commercial
product.  There are other commercial products, but nothing free that I'm
aware of.  This is in the DBI FAQ, FYI.  You may get some mileage out of
DBI with DBD::Sybase (or DBD::ODBC) using FreeTDS, too -- but I'll
presume the argument against FreeTDS (for example) would be the same as
against dbi-proxy.  (Of course, not knowing the Unix platform you're on,
may affect the product availability).

So the question will become (for them) use something free that's working
or buy something commercial that will be supported...and the costs of
the commercial ODBC driver would need to weigh in on that.

Regards,

Jeff







Re: Can't compile Pg on Mac OS 10.2.2

2002-12-06 Thread Randall Perry
 On Friday, December 6, 2002, at 06:24  AM, Randall Perry wrote:
 
 Note (probably harmless): No library found for -lpq
 Writing Makefile for DBD::Pg
 
 This is your problem. Unset POSTGRES_LIB and POSTGRES_INCLUDE and try
 again. If Makefile.PL can't find your libraries and includes, then set
 these environment variables to each point to a single directory.
 
Thanks, changing POSTGRES_LIB and POSTGRES_INCLUDE to point to single
directories got rid of the config error 'No library found for -lpq', but I'm
still getting make errors (see below).

Wondering if I should try recompiling perl without thread support; could
that be a possibility?



[systame1:local/src/DBD-Pg-1.13] randy% perl Make*
Configuring Pg
Remember to actually read the README file !
OS: darwin
Multiple copies of Driver.xst found in:
/Library/Perl/darwin-thread-multi/auto/DBI
/Library/Perl/darwin-thread-multi/auto/DBI at Makefile.PL line 33
Using DBI 1.19 installed in /Library/Perl/darwin-thread-multi/auto/DBI
Checking if your kit is complete...
Looks good
Writing Makefile for DBD::Pg

[systame1:local/src/DBD-Pg-1.13] randy% make
cc -c  -I/usr/local/pgsql/include
-I/Library/Perl/darwin-thread-multi/auto/DBI -pipe -fno-common
-no-cpp-precomp -fno-strict-aliasing -O3   -DVERSION=\1.13\
-DXS_VERSION=\1.13\  -I/Library/Perl/darwin-thread-multi/CORE   Pg.c
cc -c  -I/usr/local/pgsql/include
-I/Library/Perl/darwin-thread-multi/auto/DBI -pipe -fno-common
-no-cpp-precomp -fno-strict-aliasing -O3   -DVERSION=\1.13\
-DXS_VERSION=\1.13\  -I/Library/Perl/darwin-thread-multi/CORE   dbdimp.c
dbdimp.c: In function `dbd_bind_ph':
dbdimp.c:1041: internal error: Bus error
Please submit a full bug report,
with preprocessed source if appropriate.
See URL:http://developer.apple.com/bugreporter for instructions.
{standard input}:1407:FATAL:.abort  detected.  Assembly stopping.
make: *** [dbdimp.o] Error 1

-- 
Randall Perry
sysTame

Xserve Web Hosting/Co-location
Website Development/Promotion
Mac Consulting/Sales

http://www.systame.com/





Re: Can't compile Pg on Mac OS 10.2.2

2002-12-06 Thread David Wheeler
On Friday, December 6, 2002, at 08:51  AM, Randall Perry wrote:


dbdimp.c: In function `dbd_bind_ph':
dbdimp.c:1041: internal error: Bus error
Please submit a full bug report,
with preprocessed source if appropriate.
See URL:http://developer.apple.com/bugreporter for instructions.
{standard input}:1407:FATAL:.abort  detected.  Assembly stopping.
make: *** [dbdimp.o] Error 1


Never seen that before. I build DBD::Pg on Mac OS X, myself. I suggest 
you follow Apple's instructions, though.

Sorry,

David

--
David Wheeler AIM: dwTheory
[EMAIL PROTECTED] ICQ: 15726394
http://david.wheeler.net/  Yahoo!: dew7e
   Jabber: [EMAIL PROTECTED]



(Fwd) Question about Oracle DBD:DBI

2002-12-06 Thread Tim Bunce
- Forwarded message from Pauley, Alan [EMAIL PROTECTED] -

Delivered-To: [EMAIL PROTECTED]
From: Pauley, Alan [EMAIL PROTECTED]
To: '[EMAIL PROTECTED]' [EMAIL PROTECTED]
Subject: Question about Oracle DBD:DBI
Date: Thu, 5 Dec 2002 16:24:02 -0700 


I'm a little confused can you help me understand this. I'm installing a
application called RptView on my
Solaris system. One of the requirements is to have Perl 5.002 which I have
or above with Oracle DBD:DBI libraries.
I went to www.perl.org and downloaded DBD-Oracle-1.12. Is this what I need
or am I missing something?

Thanks for you help
Alan Pauley




*

This e-mail and any files transmitted with it are the property of Americas Mining 
Corporation and/or its affiliates, are confidential, and are intended solely for the 
use of 
the individual or entity to whom this e-mail is addressed. If you are not a named 
recipient or otherwise have reason to believe that you have received this message in 
error, 
please notify the sender and delete this message immediately from your computer. Any 
other use, retention, dissemination forwarding, printing or copying of this e-mail is 
strictly prohibited.  Although this email and any attachments are believed to be free 
of any virus or other defect that might affect any computer system into which it is 
received, and opened, it is the responsibility of the recipient to ensure that it is 
virus free and no responsibility is accepted by Americas Mining Corporation and/or its 
affiliates for any loss or damage arising in any way from its use

This e-mail has been scanned and cleared by MailMarshal 
www.marshalsoftware.com

*

- End forwarded message -



RE: (Fwd) Question about Oracle DBD:DBI

2002-12-06 Thread Sterin, Ilya (I.)
I'd also recommend getting Perl 5.6.1 or above, with 5.8.* available now.

Ilya

-Original Message-
From: Tim Bunce [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 06, 2002 12:37 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: (Fwd) Question about Oracle DBD:DBI


- Forwarded message from Pauley, Alan [EMAIL PROTECTED] -

Delivered-To: [EMAIL PROTECTED]
From: Pauley, Alan [EMAIL PROTECTED]
To: '[EMAIL PROTECTED]' [EMAIL PROTECTED]
Subject: Question about Oracle DBD:DBI
Date: Thu, 5 Dec 2002 16:24:02 -0700 


I'm a little confused can you help me understand this. I'm installing a
application called RptView on my
Solaris system. One of the requirements is to have Perl 5.002 which I have
or above with Oracle DBD:DBI libraries.
I went to www.perl.org and downloaded DBD-Oracle-1.12. Is this what I need
or am I missing something?

Thanks for you help
Alan Pauley




*

This e-mail and any files transmitted with it are the property of Americas
Mining Corporation and/or its affiliates, are confidential, and are intended
solely for the use of 
the individual or entity to whom this e-mail is addressed. If you are not a
named recipient or otherwise have reason to believe that you have received
this message in error, 
please notify the sender and delete this message immediately from your
computer. Any other use, retention, dissemination forwarding, printing or
copying of this e-mail is 
strictly prohibited.  Although this email and any attachments are believed
to be free of any virus or other defect that might affect any computer
system into which it is 
received, and opened, it is the responsibility of the recipient to ensure
that it is virus free and no responsibility is accepted by Americas Mining
Corporation and/or its 
affiliates for any loss or damage arising in any way from its use

This e-mail has been scanned and cleared by MailMarshal 
www.marshalsoftware.com

*

- End forwarded message -



DBIx::Chart problems

2002-12-06 Thread Krause, Lucas
Greetings, 

 I have redhat linux 7.2 running postgresql 7.1.3 and perl 5.6.0 with
many modules installed.  I have a postgresql database with all different
data-type columns in it, when I try to do a simple chart generation using
DBIx::Chart using just integers it works great, but when I specify a field
with a datatype other then integer (time, date, timestamp, varchar) I get
errors about an error:

DBD::Chart::st execute failed: Non-numeric domain value 01:00:00. at
/usr/bin/perl5/site_perl/5.6.0/DBIx/Chart.pm line 527.

 

In my select statement if I change it to testtbl2 which has a mystamp as
integer and int as integer it works fine.

Here is my code:

START_CODE#

#!/usr/bin/perl

 

use strict;

use DBIx::Chart;

use DBI qw(:sql_types);

 

my $dbhtb = DBIx::Chart-connect('dbi:Pg:dbname=AS5400LOGS', 'test', 'test')
or die Can't connect;

 

#my $buf;

 

sub dump_img

{

my ($row, $fmt, $fname) = @_;

open (OUTF, t$fname.$fmt);

binmode  OUTF;

print OUTF $$row[0];

close OUTF;

 

}

 

#my $sth = $dbhtb-prepare(SELECT mystamp,int FROM testtbl1 RETURNING
LINEGRAPH(mystamp,int) WHERE #X_AXIS='Modems Available' AND Y_AXIS='Time'
AND SHOWGRID=1 AND SHOWPOINTS=1 AND WIDTH=400 AND #HEIGHT=400 AND
TITLE='Modems Available'AND FORMAT='PNG', {chart_type_map = [ { NAME =
'mystamp', #TYPE = SQL_TIME }, { NAME = 'int', TYPE = SQL_INTEGER }]});



my $sth = $dbhtb-prepare(SELECT mystamp, int FROM testtbl1

RETURNING LINEGRAPH(*) 

WHERE X_AXIS='Modems Available' 

AND Y_AXIS='Time' 

AND SHOWGRID=1 

AND SHOWPOINTS=1 

AND WIDTH=400 

AND HEIGHT=400 

AND TITLE='Modems Available' 

AND COLOR IN ('red','green') 

AND BACKGROUND='lgray' 

AND FORMAT='PNG');

 

$sth-execute;

 

my $row = $sth-fetchrow_arrayref;

dump_img($row, 'png', 'testimage1');

 

$sth-finish;

$dbhtb-disconnect;

ENDCODE###




DBI::Shell new release.

2002-12-06 Thread Enrique Castilla
Hello.

I'm working with your DBI::Shell module:

I need to test a Teradata application made of stored procedures and macros. I think 
your DBI::Shell module may be a good solution for making automated tests in this form:

1.- Adding the functionality of read/write commands/results from/to an input/output 
filehandle distinct of STDIN/STDOUT.
2.- Give the user-tester a thingy (named $CURSOR for example) that permits him iterate 
over $sh-{rhistory} (this permits to get rows obtained in previous commands and reuse 
them to execute some code against the SGBD with the /perl command).

I've fixed your Shell.pm for 1, but no for 2 and I'm asking if you are planning to 
make a new release with something like this.

Thanks for your time.







DBI and ODBC installation

2002-12-06 Thread Anil Anand
I have a Perl program trying to connect to a Microsoft Access Database. I am 
trying to install DBI.pm from a web site and having problems.

Can someone guide me through the following:

1) From which Website should I get the latest version and how to install it.

2) I also need a ODBC driver to help in the connection. Where can I get the 
driver and the steps for installing.

Anil

email: [EMAIL PROTECTED]












_
Add photos to your messages with MSN 8. Get 2 months FREE*. 
http://join.msn.com/?page=features/featuredemail



RE: DBI and ODBC installation

2002-12-06 Thread Jeff Urlwin
You need to give some more information, but I suggest you read through
the FAQ before posting again, there's a lot of information there:


DBI FAQ (www.xmlproj.com/cgi/fom.cgi)

If the FAQ doesn't answer your questions, it will probably give you some
guidance.  If not, then you'll need to provide: Which platform
(Unix/Linux/Windows)?
If windows: which perl (ActiveState or custom build)?


There's probably some more questions, but that will depend upon some of
the answers above.


Regards,

Jeff

 -Original Message-
 From: Anil Anand [mailto:[EMAIL PROTECTED]] 
 Sent: Thursday, December 05, 2002 5:35 PM
 To: [EMAIL PROTECTED]
 Subject: DBI and ODBC installation
 
 
 I have a Perl program trying to connect to a Microsoft Access 
 Database. I am 
 trying to install DBI.pm from a web site and having problems.
 
 Can someone guide me through the following:
 
 1) From which Website should I get the latest version and how 
 to install it.
 
 2) I also need a ODBC driver to help in the connection. Where 
 can I get the 
 driver and the steps for installing.
 
 Anil
 
 email: [EMAIL PROTECTED]
 
 
 
 
 
 
 
 
 
 
 
 
 _
 Add photos to your messages with MSN 8. Get 2 months FREE*. 
 http://join.msn.com/?page=features/featuredemail
 
 





Re: DBD::ODBC SQLCancel?

2002-12-06 Thread Vassiliy Truskov
Thank you Martin!

I set :
$db_handler[$iSess]-{odbc_async_exec} = 1;
$db_handler[$iSess]-{odbc_async_type} = 'SQL_AM_STATEMENT';
and it works for me now.
Thanks Jeff for your help as well!
The only one thing, if the default for async is OFF why this script works on
Windows
without these settings ?

Vassiliy


[EMAIL PROTECTED] wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 I may have missed some of this thread but isn't SQLCancel just used to cancel:

 [1] a function running asynchronously
 [2] a function on a statement that needs data
 [3] a function running on the statement in another thread

 Your code doesn't seem to fit any of those.

 [1] I don't see any setting for ASYNCHRONOUS execution
 [2] you execute is returning a result-set and does not need any data (i.e. it
 is not parameterised with SQL_DATA_AT_EXEC.
 [3] there are no threads.

 Any code doing:

 SQLPrepare
 SQLExecute (select * from table)
 SQLCancel

 is going to fail in ODBC if asynchronous execution is turned off (it is by
 default). If asynchronous execution was enabled and the SQLExecute need to take
 a very long time then the SQLExecute call comes back with SQL_STILL_EXECUTING
 and THEN you can call SQLCancel.

 Martin
 - --
 Martin J. Evans
 Easysoft Ltd, UK
 Development

 On 04-Dec-2002 Vassiliy Truskov wrote:
  Hello everybody.
 
  I call SQLCancel function to cancel my query and got an error:
  DBD: no statement executing err=-1.
  It looks like statement is not defined in DBIc_ACTIVE(imp_sth).
  I run it on osf1 unix 4, DBI 1.31, DBD::ODBC 0.45_18.
  I use SDK iODBC driver manager version 3.
 
  The trace is following:
 
  - prepare for DBD::ODBC::db (DBI::db=HASH(0x140087e68)~0x140087dd8
  'select count(*) from amount where amount  1200' HASH(0x1402f6b60))
  New DBI::st (for DBD::ODBC::st, parent=DBI::db=HASH(0x140087dd8),
  id=)
 
  dbih_setup_handle(DBI::st=HASH(0x140087e58)=DBI::st=HASH(0x140089508),
  DBD::ODBC::st, 140087e78, Null!)
  dbih_make_com(DBI::db=HASH(0x140087dd8), DBD::ODBC::st, 368) thr#0
  dbih_setup_attrib(DBI::st=HASH(0x140089508), Err,
  DBI::db=HASH(0x140087dd8)) SCALAR(0x14022f240) (already defined)
  dbih_setup_attrib(DBI::st=HASH(0x140089508), State,
  DBI::db=HASH(0x140087dd8)) SCALAR(0x14022f1e0) (already defined)
  dbih_setup_attrib(DBI::st=HASH(0x140089508), Errstr,
  DBI::db=HASH(0x140087dd8)) SCALAR(0x14022f210) (already defined)
  dbih_setup_attrib(DBI::st=HASH(0x140089508), Debug,
  DBI::db=HASH(0x140087dd8)) 0 (already defined)
  dbih_setup_attrib(DBI::st=HASH(0x140089508), FetchHashKeyName,
  DBI::db=HASH(0x140087dd8)) 'NAME' (already defined)
  dbih_setup_attrib(DBI::st=HASH(0x140089508), HandleError,
  DBI::db=HASH(0x140087dd8)) undef (not defined)
  - prepare= DBI::st=HASH(0x140087e58) at psql_m.pl line 1036 via
  psql_m.pl line 865
  - execute for DBD::ODBC::st (DBI::st=HASH(0x140087e58)~0x140089508)
 
  1   - cancel for DBD::ODBC::st (DBI::st=HASH(0x140087e58)~0x140089508)
  !! ERROR: -1 '(DBD: no statement executing err=-1)'
  1   - cancel= undef at psql_m.pl line 3540 via psql_m.pl line 1060
  - $DBI::errstr () FETCH from lasth=HASH
   DBD::ODBC::st::errstr
  - $DBI::errstr= '(DBD: no statement executing err=-1)'
  !! ERROR: -1 '(DBD: st_execute/SQLExecute err=-1)'
 
  Thanks in advance,
  Vassiliy
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.2.1 (GNU/Linux)

 iD8DBQE98GwijLvsvprkFrMRAkxbAJ0byKurxDVqsZ9ZvErEvBNCNXsKaACfQ94i
 8awIFTtDZhDkCZz/VX6jG4M=
 =g7zP
 -END PGP SIGNATURE-




erros of installing DBI

2002-12-06 Thread Daniel Tong
I am new with perl and DBI, I have a trouble to install DBI over HPUX11i
machine. 

environment: HPUX 11i,
perl: 5.8
DBI 1.3.2
Oracle 9.2

There is no error to build makefile and make process. However, when I
run make test, I got error (please referr to the error message
attached.), If I continue to install DBD:Oracle driver, it will fail. 

Please help. 

Thanks


Daniel 

 error.txt 

# make test
PERL_DL_NONLAZY=1 /usr/local/bin/perl -MExtUtils::Command::MM -e 
test_harness(0, 'blib/lib', 'blib/arch') t/*.t
t/01basics./usr/lib/dld.sl: Bad magic number for shared library: 
/u02/other_app/perl-5.8/DBI-1.32/blib/arch/auto/DBI/DBI.sl
/usr/lib/dld.sl: Exec format error
Can't load '/u02/other_app/perl-5.8/DBI-1.32/blib/arch/auto/DBI/DBI.sl' for module 
DBI: Exec format error at /usr/local/lib/perl5/5.8.0/PA-RISC2.0/DynaLoader.pm line 2
29.
 at /u02/other_app/perl-5.8/DBI-1.32/blib/lib/DBI.pm line 250
BEGIN failed--compilation aborted at /u02/other_app/perl-5.8/DBI-1.32/blib/lib/DBI.pm 
line 250.
Compilation failed in require at t/01basics.t line 21.
BEGIN failed--compilation aborted at t/01basics.t line 21.
t/01basics.dubious
Test returned status 255 (wstat 65280, 0xff00)
t/02dbidrv./usr/lib/dld.sl: Bad magic number for shared library: 
/u02/other_app/perl-5.8/DBI-1.32/blib/arch/auto/DBI/DBI.sl
/usr/lib/dld.sl: Exec format error
Can't load '/u02/other_app/perl-5.8/DBI-1.32/blib/arch/auto/DBI/DBI.sl' for module 
DBI: Exec format error at /usr/local/lib/perl5/5.8.0/PA-RISC2.0/DynaLoader.pm line 2
29.
 at /u02/other_app/perl-5.8/DBI-1.32/blib/lib/DBI.pm line 250
BEGIN failed--compilation aborted at /u02/other_app/perl-5.8/DBI-1.32/blib/lib/DBI.pm 
line 250.
Compilation failed in require at t/02dbidrv.t line 3.
BEGIN failed--compilation aborted at t/02dbidrv.t line 3.
t/02dbidrv.dubious
Test returned status 255 (wstat 65280, 0xff00)
t/03hleak../usr/lib/dld.sl: Bad magic number for shared library: 
/u02/other_app/perl-5.8/DBI-1.32/blib/arch/auto/DBI/DBI.sl
/usr/lib/dld.sl: Exec format error
Can't load '/u02/other_app/perl-5.8/DBI-1.32/blib/arch/auto/DBI/DBI.sl' for module 
DBI: Exec format error at /usr/local/lib/perl5/5.8.0/PA-RISC2.0/DynaLoader.pm line 2
29.
 at /u02/other_app/perl-5.8/DBI-1.32/blib/lib/DBI.pm line 250
BEGIN failed--compilation aborted at /u02/other_app/perl-5.8/DBI-1.32/blib/lib/DBI.pm 
line 250.
Compilation failed in require at t/03hleak.t line 8.
BEGIN failed--compilation aborted at t/03hleak.t line 8.
t/03hleak..dubious
Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1-10
Failed 10/10 tests, 0.00% okay
t/04mods.../usr/lib/dld.sl: Bad magic number for shared library: 
/u02/other_app/perl-5.8/DBI-1.32/blib/arch/auto/DBI/DBI.sl
/usr/lib/dld.sl: Exec format error
Can't load '/u02/other_app/perl-5.8/DBI-1.32/blib/arch/auto/DBI/DBI.sl' for module 
DBI: Exec format error at /usr/local/lib/perl5/5.8.0/PA-RISC2.0/DynaLoader.pm line 2
29.
 at /u02/other_app/perl-5.8/DBI-1.32/blib/lib/DBI.pm line 250
BEGIN failed--compilation aborted at /u02/other_app/perl-5.8/DBI-1.32/blib/lib/DBI.pm 
line 250.
Compilation failed in require at t/04mods.t line 8.
BEGIN failed--compilation aborted at t/04mods.t line 8.
t/04mods...dubious
Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1-3
  at t/04mods.t line 8.s, 0.00% okay
bad time specification.skipped
#   all skipped: perl 5.008 not configured to support iThreads
t/06attrs../usr/lib/dld.sl: Bad magic number for shared library: 
/u02/other_app/perl-5.8/DBI-1.32/blib/arch/auto/DBI/DBI.sl
/usr/lib/dld.sl: Exec format error
Can't load '/u02/other_app/perl-5.8/DBI-1.32/blib/arch/auto/DBI/DBI.sl' for module 
DBI: Exec format error at /usr/local/lib/perl5/5.8.0/PA-RISC2.0/DynaLoader.pm line 2
29.
 at /u02/other_app/perl-5.8/DBI-1.32/blib/lib/DBI.pm line 250
BEGIN failed--compilation aborted at /u02/other_app/perl-5.8/DBI-1.32/blib/lib/DBI.pm 
line 250.
Compilation failed in require at t/06attrs.t line 5.
BEGIN failed--compilation aborted at t/06attrs.t line 5.
t/06attrs..dubious
Test returned status 255 (wstat 65280, 0xff00)
t/07kids.../usr/lib/dld.sl: Bad magic number for shared library: 
/u02/other_app/perl-5.8/DBI-1.32/blib/arch/auto/DBI/DBI.sl
/usr/lib/dld.sl: Exec format error
Can't load '/u02/other_app/perl-5.8/DBI-1.32/blib/arch/auto/DBI/DBI.sl' for module 
DBI: Exec format error at /usr/local/lib/perl5/5.8.0/PA-RISC2.0/DynaLoader.pm line 2
29.
 at /u02/other_app/perl-5.8/DBI-1.32/blib/lib/DBI.pm line 250
BEGIN failed--compilation aborted at /u02/other_app/perl-5.8/DBI-1.32/blib/lib/DBI.pm 
line 250.
Compilation failed in require at t/07kids.t line 5.
BEGIN failed--compilation aborted at t/07kids.t line 5.
t/07kids...dubious
Test returned status 255 (wstat 

Re: Fetching large Oracle CLOBS

2002-12-06 Thread Tim Bunce
The t/long.t test script in the distribution tests with 64KB strings.
Take a look at that.

Your bind_param_inout call is wrong. You're missing the maxlen param.

Tim.

On Thu, Dec 05, 2002 at 10:08:25PM +0100, Johann Kandlbauer wrote:
 Hi all,
 
 we're trying to read Oracle 9.0.1/2 CLOBS which are larger than 32 kb using
 an unnamed PL/SQL block as data source. We always get the error ORA-06502
 which means 'Numeric or value error'. If the CLOB is smaller than 32 kb,
 everything goes ok.
 
 It seems as if it is not possible to read more than 32 kb at once with
 DBI/DBD-Oracle.
 
 DBD::Oracle::VERSION = '1.12';
 DBI Version: 1.30
 
 Here is an extract of the code:
 snip-
   $csr = $dbh-prepare (q {
 declare
   l_objecthandle  NUMBER;
   l_objectDataCLOB;
   l_object_type varchar2(20) := 'VIEW';
   l_out varchar2(8196);
 BEGIN
   l_objectHandle := DBMS_METADATA.OPEN(l_object_type);
   DBMS_METADATA.SET_COUNT(l_objecthandle, 1000);
   l_objectData := DBMS_METADATA.FETCH_CLOB(l_objecthandle);
   DBMS_METADATA.CLOSE(l_objecthandle);
   :text := l_objectData;
 END;
   }
);
   $csr-bind_param_inout (:text, \$text, { ora_type = ORA_BLOB });
   $csr-execute();
 -snap-
 
 Any suggestions how to solve this problem (without creating database tables
 to store intermediate results)?
 
 thanks for your time.
 Johann Kandlbauer
 
 GAMED mbH
 Harterstr.48
 A-8053 Graz
 AUSTRIA
 Tel +43 (316) 278 660-14
 Fax +43 (316) 278 660-10
 
 http://www.gamed.com
 



RE: Aargh! - Access BLOB revisited

2002-12-06 Thread Jeff Urlwin


 
 Ok, y'all built my confidence up enugh to set up this test 
 script, but it 
 isn't working.  Can someone decipher what I am still doing wrong 
 inserting a BLOB in a Access database?
 
 code here
 
 my $dbh = DBI-connect(dbi:ODBC:test) || die DBI::errstr;
 my $sth = $dbh-prepare(INSERT INTO test (attachment1)
  VALUES (?)
 ) || die DBI::errstr; 
 $sth-bind_param(1,binmode($in{'file'}), 
 DBI::SQL_LONGVARBINARY);
 $sth-execute;
 $dbh-disconnect();


Binmode doesn't read the file, it just sets the read mode of a the file.
Read the file into a variable, then insert it.  Note, in my longbin,
there's a function that does this and returns the contents of the file.

Regards,

Jeff