Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> SQL*Module: selecting an Oracle LONG datatype into Ada

SQL*Module: selecting an Oracle LONG datatype into Ada

From: <ltost_at_systemautomation.com>
Date: 1997/08/07
Message-ID: <870962945.1073@dejanews.com>#1/1

We're trying to select an Oracle LONG datatype into an Ada variable using
SQL*Module. When we do a select that should return either 0 or 1 row, we
get an SQL error of -932 (which sounds like incompatible datatypes from
the error text).

Here's the DECLARE CURSOR:
DECLARE cursor_t_policy CURSOR FOR

    SELECT b.policy_text
        FROM  sac.t_plcy_idx a,
              sac.t_plcytext b
        WHERE to_char(a.effective_date) = to_char(sysdate)
        AND b.policy_key = a.policy_key


 ...and here's the FETCH:
PROCEDURE Fetch_t_policy_data (

        :policy_text     CHARACTER(8192),
        SQLCODE);

    FETCH cursor_t_policy
        INTO :policy_text;

(8192 bytes is more than big enough for our purposes, but remember that
the LONG in Oracle is <= 2 Gb).

The open cursor works, but the fetch returns -932.

The variable we're putting it into is declared in Ada as:

    Policy_Text : Sql_Standard.Char (1 .. 8192);     (we tried it declared as Ada's CHAR with the same results).

    Sqlcode : Sql_Standard.Sqlcode_Type := 0;

And the call to fetch looks like:
 Gtp.Fetch_T_Policy_Data (Policy_Text, Sqlcode);

Any ideas?
Thanks.
Please email your response... news service isn't great here.

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet
Received on Thu Aug 07 1997 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US