Professional Web Applications Themes

DBD ERROR - PERL Beginners

Hi! With this piece of code foreach $gif (files){ gif_parts = split(/_/,$gif); print "Inserting into id=$gif_parts[0], name=$gif: "; # Read file into scalar open(IN, $gif ) or die $!; binmode(IN); my $doc_len = read IN, $doc, $max_len; close(IN); print qq{$doc_len bytes\n}; my $tmp=<STDIN>; #just to make it one by one... # Insert doent into the database. # Prepare the insert statement. #my $sth=$dbh->prepare(qq{INSERT INTO PELRER_TEST(id,name,data) VALUES (SEQ_PERLER_TEST.nextval,?,?) }); $sth=$dbh->prepare(qq{UPDATE dla15_download_content set web_sample_file1=? where id=?}); # Bind variables to columns. print "$gif_parts[0]\n"; $sth->bind_param(1, $doc, {ora_type => ORA_BLOB} ); $sth->bind_param(2, $gif_parts[0] ); # Insert/Update my $rv = $sth->execute(); } I get : ...

  1. #1

    Default DBD ERROR

    Hi!

    With this piece of code

    foreach $gif (files){
    gif_parts = split(/_/,$gif);
    print "Inserting into id=$gif_parts[0], name=$gif: ";

    # Read file into scalar
    open(IN, $gif ) or die $!;
    binmode(IN);
    my $doc_len = read IN, $doc, $max_len;
    close(IN);
    print qq{$doc_len bytes\n};
    my $tmp=<STDIN>; #just to make it one by one...
    # Insert doent into the database.
    # Prepare the insert statement.
    #my $sth=$dbh->prepare(qq{INSERT INTO PELRER_TEST(id,name,data) VALUES
    (SEQ_PERLER_TEST.nextval,?,?) });
    $sth=$dbh->prepare(qq{UPDATE dla15_download_content set
    web_sample_file1=? where id=?});

    # Bind variables to columns.
    print "$gif_parts[0]\n";
    $sth->bind_param(1, $doc, {ora_type => ORA_BLOB} );
    $sth->bind_param(2, $gif_parts[0] );

    # Insert/Update
    my $rv = $sth->execute();
    }
    I get :

    DBD::Oracle::st execute failed: (DBD ERROR: Need bind_param(..., {
    ora_field=>... }) attribute to identify table LOB field names) at
    dbi2.pl line 45, <STDIN> chunk 1.
    DBD::Oracle::st execute failed: (DBD ERROR: Need bind_param(..., {
    ora_field=>... }) attribute to identify table LOB field names) at
    dbi2.pl line 45, <STDIN> chunk 1.
    Issuing rollback() for database handle being DESTROY'd without explicit
    disconnect(), <STDIN> chunk 1.


    Can anyone suggest?

    Ant.




    Anton Arhipov Guest

  2. #2

    Default Re: DBD ERROR

    Quote Originally Posted by Anton Arhipov View Post
    Hi!

    With this piece of code

    Code:
    foreach $gif (files){
    gif_parts = split(/_/,$gif);
    print "Inserting into id=$gif_parts[0], name=$gif: ";
    
    # Read file into scalar
    open(IN, $gif ) or die $!;
    binmode(IN);
    my $doc_len = read IN, $doc, $max_len;
    close(IN);
    print qq{$doc_len bytes\n};
    my $tmp=<STDIN>; #just to make it one by one...
    # Insert doent into the database.
    # Prepare the insert statement.
    #my $sth=$dbh->prepare(qq{INSERT INTO PELRER_TEST(id,name,data) VALUES
    (SEQ_PERLER_TEST.nextval,?,?) });
    $sth=$dbh->prepare(qq{UPDATE dla15_download_content set
    web_sample_file1=? where id=?});
    
    # Bind variables to columns.
    print "$gif_parts[0]\n";
    $sth->bind_param(1, $doc, {ora_type => ORA_BLOB} );
    $sth->bind_param(2, $gif_parts[0] );
    
    # Insert/Update
    my $rv = $sth->execute();
    }
    I get :
    
    DBD::Oracle::st execute failed:  (DBD ERROR: Need bind_param(..., {
    ora_field=>... }) attribute to identify table LOB field names) at
    dbi2.pl line 45, <STDIN> chunk 1.
    DBD::Oracle::st execute failed:  (DBD ERROR: Need bind_param(..., {
    ora_field=>... }) attribute to identify table LOB field names) at
    dbi2.pl line 45, <STDIN> chunk 1.
    Issuing rollback() for database handle being DESTROY'd without explicit
    disconnect(), <STDIN> chunk 1.
    Can anyone suggest?

    Ant.

    use: SQLT_BIN instead of ORA_BLOB
    Unregistered Guest

Similar Threads

  1. Error Message "A drawing error ocurrred which is probably due to an out-of-memory condition. Try qu
    By wendy_matarazzo@adobeforums.com in forum Adobe Acrobat Macintosh
    Replies: 2
    Last Post: May 11th, 06:12 PM
  2. Replies: 0
    Last Post: March 29th, 09:49 PM
  3. Replies: 0
    Last Post: November 10th, 05:24 PM
  4. Replies: 0
    Last Post: September 25th, 03:23 AM
  5. Replies: 1
    Last Post: August 7th, 07:13 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139