Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: DBI and Oracle 8i

by CiceroLove (Monk)
on Mar 09, 2001 at 20:06 UTC ( #63258=note: print w/replies, xml ) Need Help??


in reply to DBI and Oracle 8i

Next time you should post some code so that we can see what you are actually doing. But I know I had a lot of trouble with Oracle and the use of quotation marks for different types of data when trying to do updates or inserts. Numbers couldn't have quotations marks (even if it was a variable) but strings had to have them. It was messy at best.

CiceroLove
Fates! We will know your pleasures: That we shall die, we know; 'Tis but the time, and drawing days out, that men stand upon. - Act III,I, Julius Caesar

Replies are listed 'Best First'.
Re: Re: DBI and Oracle 8i
by ko (Initiate) on Mar 09, 2001 at 21:03 UTC
    Thanks. Here's the code I'm trying..
    my $sth = $dbh->prepare("INSERT INTO MY_TABLE(KEY,DATA) values (?,?)") +; my $key = 'key_worked'; my $data = 'data_worked'; $sth->bind_param(1, $key, { TYPE=>DBI::SQL_VARCHAR } ); $sth->bind_param(2, $data, { TYPE=>DBI::SQL_VARCHAR } ); $sth->execute; $sth->finish;
    I'm thinking it may be a driver problem, I'm using dbd::oracle::version=1.03.
    The error I'm getting is: DBD::Oracle::st execute failed: ORA-01461: can bind a LONG value only for insert into a LONG column
    cheers ko
      Try:
      use DBD::Oracle qw(:ora_types);

      and then you can bind $data with:
      $sth->bind_param( 2, $data, { ora_types => 'ORA_LONG'} )

      which'll almost certainly work.

      Hope you have more fun than I did

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2021-06-24 07:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What does the "s" stand for in "perls"? (Whence perls)












    Results (123 votes). Check out past polls.

    Notices?