Home » SQL & PL/SQL » SQL & PL/SQL » Duplicating Long Raw Datatype Record
Duplicating Long Raw Datatype Record [message #21403] Thu, 01 August 2002 07:41 Go to next message
Lee Hope
Messages: 6
Registered: August 2002
Junior Member
Greetings Gurus,

Suppose I have a table abc

with the following structure

desc abc;
Name Type Null?
------- --------------- -----
ID varchar2(30) NOT NULL
ID_BLOB long raw NOT NULL

if there is a record in the table which I would like to make a duplicate of in the same table, how can I do it

The long raw table supposedly carries an image of a certain process - can you please tell me more about this data type?

Thank you

Lee Hope
Re: Duplicating Long Raw Datatype Record [message #21405 is a reply to message #21403] Thu, 01 August 2002 09:16 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
SQL> desc a;
 Name                                                  Null?    Type
 ----------------------------------------------------- -------- ------------------------------------
 ID                                                             LONG RAW

SQL> select count(*) from a;

  COUNT(*)
----------
         4

SQL> declare
  2  cursor c1 is select id from a;
  3  begin
  4  for mag in c1
  5  loop
  6     insert into a values (mag.id);
  7  end loop;
  8  commit;
  9  end;
 10  /

PL/SQL procedure successfully completed.

SQL> select count(*) from a;

  COUNT(*)
----------
         8

Re: Duplicating Long Raw Datatype Record [message #21409 is a reply to message #21403] Thu, 01 August 2002 12:25 Go to previous messageGo to next message
Lee Hope
Messages: 6
Registered: August 2002
Junior Member
Thank you Mahesh,

If I wanted to insert a word document CREDIT_REPORT.doc into the long raw field how would I do that.

Looking forward to hearing from you

Lee
Re: Duplicating Long Raw Datatype Record [message #21428 is a reply to message #21403] Fri, 02 August 2002 06:35 Go to previous messageGo to next message
Lee Hope
Messages: 6
Registered: August 2002
Junior Member
I am trying to do insert data from a Win2000 machine using the Oracle Client.

Also I am getting an error when I am executing the PL/SQL block in my test and production environment. The block was executing properly in the test environment but suddenly I started getting this error

*
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at line 7

SQL> !oerr ora 6502
06502, 00000, "PL/SQL: numeric or value error%s"
// *Cause:
// *Action:

SQL> !oerr ora 6512
06512, 00000, "at %sline %s"
// *Cause: Backtrace message as the stack is unwound by unhandled
// exceptions.
// *Action: Fix the problem causing the exception or write an exception
// handler for this condition. Or you may need to contact your
// application administrator or DBA.

The same block executes properly in the Production environment. What is going on ????

Thank you

Lee Hope
Re: Duplicating Long Raw Datatype Record [message #21430 is a reply to message #21403] Fri, 02 August 2002 07:17 Go to previous messageGo to next message
Lee Hope
Messages: 6
Registered: August 2002
Junior Member
That makes sense - how do I determine the length of my long raw datatype string? The length function does not work. Also what do you mean by

"u have to user OCI.."

Thank you

Lee
Re: Duplicating Long Raw Datatype Record [message #21432 is a reply to message #21430] Fri, 02 August 2002 07:35 Go to previous message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
"u have to user OCI.."

was typo.
I meant, u have to use OCI (pro*C).
I dont think it is possible to get length of long from sql/plsql. Again you need to use pro*c. I am not very sure about this.
Previous Topic: Built in Packages
Next Topic: IF Condition in SQL Query?
Goto Forum:
  


Current Time: Thu Apr 18 19:13:01 CDT 2024