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

Home -> Community -> Usenet -> c.d.o.server -> Re: select and insert long column in a stored procedure

Re: select and insert long column in a stored procedure

From: Karen <karen.abgarian_at_fmr.com>
Date: 2000/08/09
Message-ID: <3991A1AF.E581D631@fmr.com>#1/1

Sir,

It looks strange that it is not a query but uses define() functions.

What does Oracle tell you?

Regards
Karen

luio wrote:

> create table tb2(.., xlong long);
> PROCEDURE copyLong IS
> p_query varchar2(256);
> l_cursor integer default dbms_sql.open_cursor;
> l_n number;
> l_long_val varchar2(250);
> l_long_len number;
> l_buflen number := 250;
> l_curpos number := 0;
> myvar long default '';
> BEGIN
> p_query := 'insert into tb2(xlong ,cl1,cl2,cl3) select
> xlong ,cl1,cl2,cl3 from tb2 where ruleid = 2';
> dbms_sql.parse(l_cursor,p_query,dbms_sql.native);
> dbms_sql.define_column_long(l_cursor,1);
> dbms_sql.define_column_long(l_cursor,5);
> l_n := dbms_sql.execute(l_cursor);
> dbms_sql.close_cursor(l_cursor);
> exception
> when others then
> if dbms_sql.is_open(l_cursor) then
> dbms_sql.close_cursor(l_cursor);
> end if;
>
> raise;
>
> end copyLong;
>
> what's wrong with this procedure? any suggestiON?
>
> -----------------------------------------------------------
>
> Got questions? Get answers over the phone at Keen.com.
> Up to 100 minutes free!
> http://www.keen.com
Received on Wed Aug 09 2000 - 00:00:00 CDT

Original text of this message

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