Copying long raw to other table??
Hi everyone....
I'm using oracle 10g.
In my table i have a LONG RAW column to store images.
Now i need to copy the data in LONG RAW to another table...
Is this possible.. if yes then whats the procedure to copy the data from LONG RAW ??
please help me in this query.....
its very urgent.......
is it possible using oracle 8i ??
Thanks in advance....
Regards,
Santosh.Minupurey
Edited by: Santosh.minupurey on Feb 16, 2009 11:23 PM
No one could answer my query ?
very strange......
Similar Messages
-
Copy Long raw from oracle table to table
Hi
I am wondering if someone help me to move (copy) long raw data from one table to another. I want to do:
select long_raw_data from table1;
insert into table2 values (previously selected long raw value).
I wrote the following small java code, but it doesn't work. I get the following exception:
java.sql.SQLException: ORA-00936: missing expression.
---------- Code: ---------
import java.net.URL;
import java.sql.*;
class myJDBC
public static void main (String args[])
try {
Class.forName ("oracle.jdbc.driver.OracleDriver");
String url = "jdbc:oracle:thin:@test:1521:devtest";
Connection con = DriverManager.getConnection (url, "test", "test");
Statement stmt = con.createStatement ();
Statement insStmt = con.createStatement ();
ResultSet res = stmt.executeQuery (
"SELECT resume_data FROM resume where rownum < 26 ");
while (res.next ()) {
byte[] bytes = res.getBytes(1);
insStmt.executeUpdate("INSERT INTO TMP_RESUME VALUES (" + bytes + ")");
// clean-up
stmt.close ();
con.close ();
catch (Exception e) {
System.out.println (e.getMessage ());
e.printStackTrace ();
------------ Code ends ---------------
Thanks for your help
V Prakashuse PreparedStatement :
PreparedStatement insStmt = connect.prepareStatement("INSERT INTO TMP_RESUME VALUES (?)");
while (res.next ())
byte[] bytes = res.getBytes(1);
insStmt.setBytes(1,bytes);
insStmt.executeUpdate();
I don't remember very querys with ORACLE,
but you may be do this in one time with
SELECT ...... INTO ....
or
INSERT ..... INTO ..... SELECT
One of this is valid for ORACLE and the other for SYBASE ... -
Copy Long raw from one table to another.
Hi
I am trying to copy data from one table to another. Source has one Long Raw column. There are about million rows in source table. And I am using Oracle 8.1.5. Whenever I execute the copy command, I get the following error message: Can someone help me?
SQL> set long 64000000
SQL> set copycommit 1
SQL> set arraysize 100
SQL> COPY to test/test@testfix CREATE resume_bkup1 using select * from resume;
Array fetch/bind size is 100. (arraysize is 100)
Will commit after every array bind. (copycommit is 1)
Maximum long size is 64000000. (long is 64000000)
ERROR:
ORA-01084: invalid argument in OCI call
SQL>
Thanks
V Prakashinsert into emp_personal(emp_no, emp_pic) select emp_no, emp_pic from emp_personal_old where empno = '10059'
Read the documentation as suggested by sol.beach.
And fix your front-end to use supported datatypes. -
Copying Long Raw Column Data to another table
hi everyone,
i am trying to Copy Long Raw Column Data to another table in the same schema. this is the situation
Table A (col1 number,col2 long raw) with 100 records
Table B (col1 number,col2 long raw) with 0 records
now i want to copy col2 of the table A into the column 2 of the table B. but long raw data cant be retrieved in a select statement so is there any specific procedure that will copy long raw data or there is any simple way.
i will be really grateful for anybody's help.
thanx
shakeelDust off that old SQL*PLUS command "COPY" ...
create table tablea (col1 number,col2 long raw)
insert into tablea values (1, testrawio.chartoraw('this is line one'));
insert into tablea values (2, testrawio.chartoraw('this is line two'));
insert into tablea values (3, testrawio.chartoraw('this is line three'));
create table tableb (col1 number,col2 long raw)
copy from scott/tiger@larry insert tableb (col1, col2) using select col1, col2 from tablea
Array fetch/bind size is 15. (arraysize is 15)
Will commit when done. (copycommit is 0)
Maximum long size is 80. (long is 80)
3 rows selected from scott@tiger.
3 rows inserted into TABLEB.
3 rows committed into TABLEB at DEFAULT HOST connection.
SQL>Now to prove it has worked :
begin
for lr in (select col1, col2 from tableb)
loop
dbms_output.put_line('col1 = '||lr.col1||
' and col2 contains long raw equivalent of '||testrawio.rawtochar(lr.col2));
end loop;
end;
col1 = 1 and col2 contains long raw equivalent of this is line one
col1 = 2 and col2 contains long raw equivalent of this is line two
col1 = 3 and col2 contains long raw equivalent of this is line three
PL/SQL procedure successfully completed.
SQL> Note : In order to load some test data and prove the method works I made use of a package called "testrawio" located at http://www.classicity.com/oracle/htdocs/forums/ClsyForumID125/7.html
AMM -
Copy Long Raw from table 1 to another table in Oracle 8i
I have 2 similar tables in Oracle 8i.
Table 1:
Id number;
blob_obj long raw;
Table 2:
Table 1:
Id number;
blob_obj long raw;
Is there any way to copy the data from table to table 2 ?
Is it possible to do some conversions are load it ?
Kindly provide pointers for this issue.See this thread Re: Getting LONG RAW from remote database for some useful ideas.
Regards Nigel -
Moving Long Raw from one table to another
How to copy the record stored in a table which has Long Raw column and insert into another table
The follwoing code is giving a numeric or value error
declare
BLOB_ID NUMBER(12);
BLOB_FILE LONG RAW;
Cursor c1 is select
BLOB_ID ,
BLOB_FILE from test ;
Begin
Open c1;
Loop
Fetch c1 into
blob_id,
blob_file;
Exit when c1%notfound;
End loop;
Close c1;
End;I don't see any problem with your code. Are you sure that the type of your variables matches the datatypes of blob_id and blob_file?
sql>create table test (blob_id number(12), blob_file long raw);
Table created.
sql>create table test_copy (blob_id number(12), blob_file long raw);
Table created.
sql>insert into test values (1, utl_raw.cast_to_raw(lpad('x', 40, 'x')));
1 row created.
sql>declare
2 blob_id test.blob_id%type;
3 blob_file test.blob_file%type;
4 cursor c1 is
5 select blob_id, blob_file from test;
6 begin
7 open c1;
8 loop
9 fetch c1 into blob_id, blob_file;
10 exit when c1%notfound;
11 insert into test_copy values (blob_id, blob_file);
12 end loop;
13 close c1;
14 commit;
15 end;
16 /
PL/SQL procedure successfully completed.
sql>select * from test_copy;
BLOB_ID B
1 7 -
How tu update a column having type 'Long raw' in oracle table with an image
Hello,
I must change the image loading in a column with 'long raw' type in the table. I find an image data already in the table.
I have my new imgae in a file .bmp.
What SQL instruction I mut use to update this column to load my new image ?
I work in Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod.
thanks for your helps.
Regards.Unless I'm missing something MSFT are making it unecessarily complex by not implementing the SQL/XML standard...
SQL> alter table emp add ( emp_xml xmltype)
2 /
Table altered.
SQL> update emp set emp_xml = XMLELEMENT("EMPLOYEE",xmlattributes(EMPNO as "id"), XMLElement("Name",ENAME))
2
SQL> /
14 rows updated.
SQL> set pages 0
SQL> select EMPNO, EMP_XML from EMP
2 /
7369
<EMPLOYEE id="7369">
<Name>SMITH</Name>
</EMPLOYEE>
7499
<EMPLOYEE id="7499">
<Name>ALLEN</Name>
</EMPLOYEE>
7521
<EMPLOYEE id="7521">
<Name>WARD</Name>
</EMPLOYEE>
7566
<EMPLOYEE id="7566">
<Name>JONES</Name>
</EMPLOYEE>
7654
<EMPLOYEE id="7654">
<Name>MARTIN</Name>
</EMPLOYEE>
7698
<EMPLOYEE id="7698">
<Name>BLAKE</Name>
</EMPLOYEE>
7782
<EMPLOYEE id="7782">
<Name>CLARK</Name>
</EMPLOYEE>
7788
<EMPLOYEE id="7788">
<Name>SCOTT</Name>
</EMPLOYEE>
7839
<EMPLOYEE id="7839">
<Name>KING</Name>
</EMPLOYEE>
7844
<EMPLOYEE id="7844">
<Name>TURNER</Name>
</EMPLOYEE>
7876
<EMPLOYEE id="7876">
<Name>ADAMS</Name>
</EMPLOYEE>
7900
<EMPLOYEE id="7900">
<Name>JAMES</Name>
</EMPLOYEE>
7902
<EMPLOYEE id="7902">
<Name>FORD</Name>
</EMPLOYEE>
7934
<EMPLOYEE id="7934">
<Name>MILLER</Name>
</EMPLOYEE>
14 rows selected.
SQL> -
How to find the long/raw datatype tables
HI ppl,
I want to find out the long/raw datatype tables in Oracle database.
Please provide the query..
Plz help.
Oracle version :10gr2
platform:HP-UNIXHi,
is this is what you are looking for?
SELECT
TABLE_NAME,
COLUMN_NAME,
OWNER
FROM
DBA_TAB_COLUMNS
WHERE
DATA_TYPE IN('LONG','RAW')Regards -
Getting LONG RAW from remote database
Hi,
I have a table in my local database that has a LONG RAW column . I have another table of similar structure in a remote database (so it has LONG RAW as well). I would like to transfer data including LONG RAW data from the remote database into the local database table using PL/SQL. I know it is not possible to copy LONG RAW over dblink directly. Can anyone suggest an approach to accomplish this?
The local table cannot be changed to BLOB, but I have the flexibility to change the remote table to use BLOB. So, can anyone tell me if the following solution would work. If so, can you shed some light on what PL/SQL libraries to use or can you provide me with some sample code to implement steps 3 and 4 below?:
1. Change the remote table to use BLOB
2. Create a new temporary table with BLOB in the local database.
3. Copy data using PL/SQL from remote BLOB to local temporary table BLOB.
4. Copy data using PL/SQL from BLOB to LONG RAW within the local database from temporary table (w/ BLOB) to the actual target table (w/ LONG RAW).
I think step 3 can be a direct Insert-Select from remote table (I'll try this myself), but not sure how to go about step 4.
Thanks for your help.There is a chapter in the Oracle Application Developer's Guide on calling external procedures
I don't know enough about VB and the available VB APIs to know for sure. I would assume that VB could be configured to generate a DLL with a C call specification. I would also assume that there was a VB API that would allow you to manipulate LONG RAW and BLOB data. Unfortunately, though, I don't know which VB API's have that functionality.
Justin -
ORA-22835: buffer too small when trying to save pdf file in LONG RAW column
Hi,
I get "ORA-22835: Buffer too small for CLOB to CHAR or BLOB to RAW conversion (real : 125695, maximum : 2000)" when i trying to save a 120k pdf file in an Oracle Long Raw column using dotnet 4.0 and Entity FrameWork.
Dim db As New OracleEntities
Try
Dim myEntity = (From e In db.TEXTE _
Where e.TEXT_ID = txtTextId.Text _
Select e).Single
With myEntity
If txtTextypeId.Text <> "" Then
.TEXTYPE_ID = txtTextypeId.Text
Else
.TEXTYPE_ID = Nothing
End If
.TEXT_NUM = txtTextNum.Text
.TEXT_NAME = txtTextName.Text
.TEXT_DATE = dtTextDate.SelectedDate
If DocAdded Then
.TEXT_DOC = Document
ElseIf DocDeleted Then
.TEXT_DOC = Nothing
End If
End With
db.SaveChanges()
Document is an array of Byte and TEXT_DOC also (mapped to a long row column).
is it possible to increase the size of the buffer ? how may i do it ?
Thx in advance.
Regards.Using a custom UPDATE or INSERT stored procedure for LONG RAW column with
exceed-limit data may still get the following error.
"ORA-01460: unimplemented or unreasonable conversion requested".
One option is to use BLOB instead of LONG RAW in your table and regenerate your
data model from the table. Then using the default UPDATE or INSERT statement
(created by EF) should work.
The following will modify your LONG RAW column to BLOB column.
Disclaimers:
1. It's irreversible--you cannot modify BLOB back to LONG RAW.
2. I have not tried that when there are huge data in LONG RAW column.
So be careful.
alter table <your_table_name> modify <your_long_raw_type_column> blob; -
[ORACLE 10G] Extract Long Raw data to disc
Hi All,
I want to extract a column which contain long raw data (pdf file) into files on my disque, but i don't know how to do it in SQL or PL/SQL, any help ???Or maybe just an alter table statement will do it for you...
SQL> create table xx (x long raw);
Table created.
SQL> desc xx;
Name Null? Type
X LONG RAW
SQL> alter table xx modify (x blob);
Table altered.
SQL> desc xx;
Name Null? Type
X BLOB
SQL>I've not really used LONG RAW's before but apparently (according to sources on the net) the simlple alter table statement above will do the job. -
I wish to migrate records of a col. FILETYPE (LONG RAW) of existing table to col. DOCTYPE (CLOB) of a new table.
But the function to_lob() is unable to carry out the required migration. The Error message is : " Inconsistent Data Types expected - binary .... ".
Moreover LONG RAW to BLOB conversion works fine from a simple INSERT statement but the same fails when insertion is done using a CURSOR.
Can u guyz help me in doing the same !
Oracle Version used - 9i
Regards,
Chinmay <Infocker>You can transfer data from
LONG to CLOB
LONG RAW to BLOB only..
In Oracle9i -- there is a very cool "alter table t modify long_col CLOB" to do
this as well....
you could convert a clob to a blob, or a blob to a clob using utl_raw.cast_to_varchar2/raw and doing it 32k at a time. -
How to read LONG RAW data from one table and insert into another table
Hello EVERYBODY
I have a table called sound with the following attributes. in the music attribute i have stored some messages in the different language like hindi, english etc. i want to concatinate all hindi messages and store in the another table with only one attribute of type LONG RAW.and this attribute is attached with the sound item.
when i click the play button of sound item the all the messages recorded in hindi will play one by one automatically. for that i'm doing the following.
i have written the following when button pressed trigger which will concatinate all the messages of any selected language from the sound table, and store in another table called temp.
and then sound will be played from the temp table.
declare
tmp sound.music%type;
temp1 sound.music%type;
item_id ITEM;
cursor c1
is select music
from sound
where lang=:LIST10;
begin
open c1;
loop
fetch c1 into tmp; //THIS LINE GENERATES THE ERROR
temp1:=temp1||tmp;
exit when c1%notfound;
end loop;
CLOSE C1;
insert into temp values(temp1);
item_id:=Find_Item('Music');
go_item('music');
play_sound(item_id);
end;
but when i'm clicking the button it generates the following error.
WHEN-BUTTON-PRESSED TRIGGER RAISED UNHANDLED EXCEPTION ORA-06502.
ORA-06502: PL/SQL: numeric or value error
SQL> desc sound;
Name Null? Type
SL_NO NUMBER(2)
MUSIC LONG RAW
LANG CHAR(10)
IF MY PROCESS TO SOLVE THE ABOVE PROBLEM IS OK THEN PLESE TELL ME THE SOLUTION FOR THE ERROR. OTHER WISE PLEASE SUGGEST ME,IF ANY OTHER WAY IS THERE TO SOLVE THE ABOVE PROBLEM.
THANKS IN ADVANCE.
D. PrasadYou can achieve this in many different ways, one is
1. Create another VO based on the EO which is based on the dest table.
2. At save, copy the contents of the source VO into the dest VO (see copy routine in dev guide).
3. commiting the transaction will push the data into the dest table on which the dest VO is based.
I understand that if we attach VO object instance to region/page, we only can pull and put data in to only one table.
if by table you mean a DB table, then no, you can have a VO based on multiple EOs which will do DMLs accordingly.Thanks
Tapash -
HOW TO RETRIEVE A LONG RAW COLUMN FROM A TABLE AND WRITE TO OS FILE
Good evening.
Please how can I read a long raw datatype from a table and insert into an operating system file using PL/SQL.
Thank you.What does this have to do with LONG RAW? It is about UTL_FILE and not especially great code.
The question is how to retrieve and write LONG RAW and that is quite a different matter.
First you must convert it to BLOB.
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:13213885403654
Then you can write it out to the file system
http://www.morganslibrary.org/reference/utl_file.html
Look at the "Extract Blob" demo -
How to insert records with LONG RAW columns from one table to another
Does anybody know how to use subquery to insert records with columns of LONG RAW datatype from one table to another? Can I add a WHERE clause in the subquery statement? Thanks.
Insert into ... Select statements are not supported for long or long raw. You will have to either use PL/SQL or convert your long raw to blobs.
Maybe you are looking for
-
Do I need a computer to use my ipad for the very first time?
I would like to know if I buy an iPad, shall I need to have a computer to start it for the very first time? I mean do I need to do plug in or can I start without plug in?
-
How to use "imgPlot" to draw on a control of VC++??
Detail of yesterday question---- I want to show a image on a static picture control on dialog by vc++, the function I used was a NI-IMAQ "imgPlot" to draw image on the control, beacuse it is easier and faster with capture card. imgPlot ((GUIHNDL)hFra
-
Convert Photoshop Elements trial to permanent
How do I change photoshop elements 10 from a trial to permanent now that I have the serial number?
-
Re: Skype calls can someone help me
Hi i have just brought a skype number and i want people to call the number and for me to answer it on skype when i ring the number nothing happens i dont know how to use it can someone help?? Thanks
-
I have an Agilent 34970A DAQ that I am trying to set the NPLC to 10 and keep it set when I issue a temp measurement command to the channels. Right now I can issue the NPLC 10 command to set the channels and it works but when I send the measure chann