comp.lang.ada
 help / color / mirror / Atom feed
From: ltost@systemautomation.com
Subject: SQL*Module:  selecting an Oracle LONG datatype into Ada
Date: 1997/08/07
Date: 1997-08-07T00:00:00+00:00	[thread overview]
Message-ID: <870962945.1073@dejanews.com> (raw)


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




                 reply	other threads:[~1997-08-07  0:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox