Re: TextPtr function(in SQL server)=? in Oracle

From: Thomas J. Kyte <tkyte_at_us.oracle.com>
Date: 2000/06/14
Message-ID: <8i8k30$a57$1_at_nnrp1.deja.com>#1/1


In article <p6w15.1259$Qf6.50317_at_nuq-read.news.verio.net>,   "SP" <spant1_at_aol.com> wrote:
> I have a function TEXTPTR in SQL server. Following is the definition
 of
> TEXTPTR :
> The TEXTPTR function returns a pointer to the text or image column in
 the
> specified row or to the text or image column in the last row returned
 by the
> query if more than one row is returned. Because the TEXTPTR function
 returns
> a 16-byte binary string, it is best to declare a local variable to
 hold the
> text pointer
>
> I would appreciate if anyone could give me the equivalent function in
> Oracle.
> SP
>
>

no such function, just create a table with a column of type BLOB or CLOB and "select it"

eg:

ops$tkyte_at_8i> create table t ( x int, y clob ); Table created.

ops$tkyte_at_8i> insert into t values ( 1, empty_clob() ); 1 row created.

ops$tkyte_at_8i> declare

  2          my_var clob;
  3          str    varchar2(25) default 'Hello World';
  4  begin
  5          select y into my_var from T where x = 1 for update;
  6
  7          dbms_lob.writeappend( my_var, length(str), str );
  8 end;
  9 /
PL/SQL procedure successfully completed.

ops$tkyte_at_8i> select * from t;

         X Y

---------- -------------------------------------------------------------
-------------------
         1 Hello World


Our CLOB/BLOB datatype is their textptr function.

--
Thomas Kyte (tkyte_at_us.oracle.com) Oracle Service Industries
Howtos and such: http://osi.oracle.com/~tkyte/index.html
Oracle Magazine: http://www.oracle.com/oramag
Opinions are mine and do not necessarily reflect those of Oracle Corp


Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Wed Jun 14 2000 - 00:00:00 CEST

Original text of this message