Working with longs in Oracle
Date: Mon, 27 Apr 1998 11:26:24 -0600
Message-ID: <3544BFC0.E0CA19E6_at_novell.com>
I am trying to use the long datatype with oracle and perl, but I am having
problems inserting if the data is longer than 2k or so bytes. I have read the README.longs included with the DBD, but the code snippet is incomplete. If anyone has used longs or has a clue as to how they work,
please let me know.
The column MYTABLE.VALUE is a long, and I am currently doing something like this:
$lda = &ora_login("xxx","xxx","xxx") || die("Unable to connect to
Database");
$query = "select MYTABLE_KEY.NEXTVAL from dual";
$csr = &ora_open($lda,$query) || die("$ora_errstr - $query");
($currval) = &ora_fetch($csr);
&ora_close($csr);
$query = "insert into MYTABLE (MYTABLE_KEY,NAME,VALUE) values
($currval,'COMP_BACKGROUND','$COMP_BACKGROUND')";
&ora_do($lda,$query);
&ora_commit($lda);
&ora_logoff($lda);
print "bedebedebede thats all folks";
exit(0);
It works fine if the value of $COMP_BACKGROUND is shorter than approx 2K, but if it is longer, it doesn't work.
Thanks,
agifford_at_novell.com
Received on Mon Apr 27 1998 - 19:26:24 CEST