in reply to Re: Extracting long raw data from Oracle
in thread Extracting long raw data from Oracle

Careful. When you do an insert for LONG datatypes, you may need to use bind_param. Otherwise data over 255 or so bytes gets cut off when inserted.

UPDATE: Some example code is below:

  my $sql = qq{ INSERT INTO Object (Key, LongData) VALUES (?, ?) };
  my $sth = $dbh->prepare( $sql ) or croak $DBI::errstr;

  $sth->bind_param(1, $key,      { TYPE=>DBI::SQL_INTEGER } );
  $sth->bind_param(2, $longdata, { TYPE=>DBI::SQL_LONGVARCHAR } );

Replies are listed 'Best First'.
Re: Re: Re: Extracting long raw data from Oracle
by BigJoe (Curate) on Feb 13, 2001 at 18:28 UTC
    to make this a little shorter you can add
    use DBI qw(:sql_types);
    then instead of { TYPE=>DBI::SQL_INTEGER } you can just type SQL_INTEGER

    --BigJoe

    Learn patience, you must.
    Young PerlMonk, craves Not these things.
    Use the source Luke.