Oracle CLOB using DBI

Ask a Question related to PERL Miscellaneous, Design and Development.

  1. #1

    Default Oracle CLOB using DBI

    Does someone have a working code sample of Perl/DBI returning a CLOB
    column from Oracle. Here is what I came up with, I counld not get
    ORA_CLOB to work.

    $sth1 = $dbh->prepare(q{
    BEGIN OPEN :cursor FOR
    SELECT dbms_lob.substr( comments, 30000, 1)
    FROM comments WHERE id_comment = 46;
    END;
    });

    $sth1->bind_param_inout(":cursor", \$sth2, 30000, { ora_type
    => ORA_RS
    ET } );
    $sth1->execute();

    while ( @row = $sth2->fetchrow ) {
    print "row = @row\n";
    }

    Thanks
    Ken Chesak Guest

  2. Similar Questions and Discussions

    1. #39103 [Opn]: Oracle CLOB Charset Incorrect
      ID: 39103 User updated by: jhtpeter at gmail dot com Reported By: jhtpeter at gmail dot com Status: Open Bug Type: ...
    2. Updating Oracle Clob field
      I am having some trouble updating an oracle db that has a clob field, this is the part of the query that is getting the form data: <cfqueryparam...
    3. Oracle CLOB Columns Failing With ColdFusion 7
      I am using ColdFusion 7 Enterprise, updater 1 with DataDirect version 3.4 drivers and Oracle 8i. ColdFusion 7 is returning no data for CLOB...
    4. Oracle CLOB Truncation > 64K
      We have an update and insert query for a large text field (Oracle CLOB). When we run the query on long text, it truncates the excess. ...
    5. Oracle CLOB Update in CF
      We have a form with two textareas. The action page updates two Oracle clob fields with the content from the textareas. If at least one of the...
  3. #2

    Default Re: Oracle CLOB using DBI

    What error (if any) are you getting? Did you 'perldoc DBD::Oracle' and
    look at the section entitled 'Handling LOBS'? Did you set
    LongReadLen/LongTruncOK on the $dbh?

    --
    Ron Reidy
    Oracle DBA

    Ken Chesak wrote:
    > Does someone have a working code sample of Perl/DBI returning a CLOB
    > column from Oracle. Here is what I came up with, I counld not get
    > ORA_CLOB to work.
    >
    > $sth1 = $dbh->prepare(q{
    > BEGIN OPEN :cursor FOR
    > SELECT dbms_lob.substr( comments, 30000, 1)
    > FROM comments WHERE id_comment = 46;
    > END;
    > });
    >
    > $sth1->bind_param_inout(":cursor", \$sth2, 30000, { ora_type
    > => ORA_RS
    > ET } );
    > $sth1->execute();
    >
    > while ( @row = $sth2->fetchrow ) {
    > print "row = @row\n";
    > }
    >
    > Thanks

    --
    Ron Reidy
    Oracle DBA

    Ron Reidy Guest

  4. #3

    Default Re: Oracle CLOB using DBI

    On 24 Jun 2003 13:55:40 -0700, [email]datavector@hotmail.com[/email] (Ken Chesak)
    wrote:
    >Does someone have a working code sample of Perl/DBI returning a CLOB
    >column from Oracle. Here is what I came up with, I counld not get
    >ORA_CLOB to work.
    >
    >$sth1 = $dbh->prepare(q{
    > BEGIN OPEN :cursor FOR
    > SELECT dbms_lob.substr( comments, 30000, 1)
    > FROM comments WHERE id_comment = 46;
    > END;
    > });
    >
    > $sth1->bind_param_inout(":cursor", \$sth2, 30000, { ora_type
    >=> ORA_RS
    >ET } );
    > $sth1->execute();
    >
    > while ( @row = $sth2->fetchrow ) {
    > print "row = @row\n";
    > }
    >
    >Thanks
    Markus Stueker Guest

  5. #4

    Default Re: Oracle CLOB using DBI

    From metalink Note 19792.1:

    Error: ORA 3115

    Text: unsupported network datatype or representation

    -------------------------------------------------------------------------------

    Cause: A user bind or define, or an Oracle function, is not supported by
    this

    heterogeneous SQL*Net connection.

    Action: Upgrade the older version of Oracle and try again.

    Do you have an old Oracle install on the machine the code is running on?
    If so, this is your problem.

    --
    Ron Reidy
    Oracle DBA

    Ken Chesak wrote:
    > Would you email my hotmail account again, I delete by mistake since
    > 99% is junk mail.
    >
    > I get the following error,
    >
    > DBD::Oracle::db prepare failed: ORA-03115: unsupported network
    > datatype or repre
    > sentation (DBD: odescr failed) at clob.pl line 26.
    >
    > It runs if I use dbms_lob.substr( comments, 30000, 1).
    >
    > $dbh->{LongReadLen} = 512 * 1024 ;
    > $dbh->{LongTruncOk} = 1;
    >
    > $sth1 = $dbh->prepare(q{
    > SELECT cd_type, comments
    > FROM comments WHERE id_comment = 53
    > });
    >
    > $sth1->execute();
    >
    > while ( ($name, $data) = $sth1->fetchrow_array ) {
    >
    > print "row = $name $data \n";
    >
    > }

    --
    Ron Reidy
    Oracle DBA

    Ron Reidy Guest

Posting Permissions

  • You may not post new threads
  • You may 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