Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Re: How to select/insert/update on Oracle clob column

by Starky (Chaplain)
on Apr 21, 2001 at 07:17 UTC ( [id://74382]=note: print w/replies, xml ) Need Help??


in reply to Re: How to select/insert/update on Oracle clob column
in thread How to select/insert/update on Oracle clob column

Though this is a bit off topic, note that the
{ ora_type => ORA_CLOB }
while seemingly trivial, can be terribly important.

DBD::Oracle by default binds CLOBs to Oracle datatype VARCHAR2, which truncates whitespace; that is, if you do a

UPDATE users SET firstname='Bob   ' WHERE userid='bob'
then later do a
$db->prepare("SELECT firstname FROM users WHERE userid='bob');
$db->execute();
my ($firstname) = $db->fetchrow_array()
you will get
$firstname eq 'Bob'
While this seems trivial, if you ever put something like a frozen data structure (via the FreezeThaw module) in a CLOB, you'll end up getting errors all over the place when you later try to thaw it if the frozen structure happens to have whitespace at the end.

elwarren is obviously wise in the ways of Perl and Oracle ;-)

  • Comment on Re: Re: How to select/insert/update on Oracle clob column

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://74382]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2024-04-19 22:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found