Storing documents into Oracle
Hi,
What is the apropriate field type for storing documents such as pdf and doc?
I suppose that these formats use xml for storing data so it's possible to se CLOB?
What do you think?
Regards
Peter
Handle: user10484841
Status Level: Newbie
Registered: Jul 12, 2010
Total Posts: 45
Total Questions: 24 (21 unresolved)
so many questions & so few answers.
What is the apropriate field type for storing documents such as pdf and doc?BLOB
What is the apropriate field type for storing documents such as pdf and doc?CLOB for XML
Similar Messages
-
Storing pdf documents into oracle apps form
Hi Experts,
My requirement is in AP invoices form, I want to insert scanned documents (which is in .pdf format) .
i have nearly 4000 documents. is there any API to inset multiple documents .
How oracle handles to store these documenst ..there is no column in base table with data type blob,clob
Thanks
AshokPl post details of OS, database and EBS versions.
Pl see solution in MOS Doc 281130.1 (Attaching A File To An Object via A Public API)
Also, use the search feature of these forums to find other related threads - https://forums.oracle.com/forums/search.jspa?threadID=&q=FND_ATTACHED_DOCUMENTS&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
HTH
Srini -
How do I get stored documents into iCloud?
How do I get documents stored on my MacBook into ICloud?
If that document has been created by an application that supports iCloud, open the document in that application, then use the "File" menu command "File > Move to". Select iCloud.
That's it. -
Hello,
I have oracle 10g expree edition. I want to store pdf files in my oracle database. How can I do it using apex. I got some forums to do this but I culdn't get what blocks and web util they are talking about. Can anyone please guide me how to do it. I am new to oracle and need help.
Thanks.Blocks and webitil has nothing to do with Apex. Go to the Apex forum.
-
How to scan document into forms directly ?
hi all
how to scan any document into oracle developer form directly
(we are using forms 4.5 ..on win 98)
thanks
Abu zaid Saad
[email protected]First I would suggest that you read the documentation about working with Active/X.
The online version is in the documentation section of Forms on OTN.
Then, you insert the scan.ocx into your form. you use the ole importer to create a pl/sql package to communicate with the ocx and you are ready to start calling methods such as scan etc... -
Very urgent help needed- Error while passing XML document to Oracle stored
Hi !
I have been struggling a lot to call Oracle 9i stored procedure passing Stringbuilder object type from ASP.NET
I am using Visual Studio 2008 Professional, OS: Windows XP and Oracle: 9.2.0.1.0
Following is the procedure:
CREATE or REPLACE PROCEDURE loadCompanyInfo (clobxml IN clob) IS
-- Declare a CLOB variable
ciXML clob;
BEGIN
-- Store the Purchase Order XML in the CLOB variable
ciXML := clobxml;
-- Insert the Purchase Order XML into an XMLType column
INSERT INTO companyinfotbl (companyinfo) VALUES (XMLTYPE(ciXML));
commit;
--Handle the exceptions
EXCEPTION
WHEN OTHERS THEN
raise_application_error(-20101, 'Exception occurred in loadCompanyInfo procedure :'||SQLERRM);
END loadCompanyInfo ;
And following is the ASP.net code:
StringBuilder b = new StringBuilder();
b.Append("<?xml version=\"1.0\" encoding=\"utf-8\" ?>");
b.Append("<item>");
b.Append("<price>500</price>");
b.Append("<description>some item</description>");
b.Append("<quantity>5</quantity>");
b.Append("</item>");
//Here you'll have the Xml as a string
string myXmlString1 = b.ToString();
//string result;
using (OracleConnection objConn = new OracleConnection("Data Source=testdb; User ID=testuser; Password=pwd1"))
OracleCommand objCmd = new OracleCommand();
objCmd.Connection = objConn;
objCmd.CommandText = "loadCompanyInfo";
objCmd.CommandType = CommandType.StoredProcedure;
//OracleParameter pmyXmlString1 = new OracleParameter("pmyXmlString1", new OracleString(myXmlString1));
objCmd.Parameters.Add("myXmlString1", OracleType.clob);
objCmd.Parameters.Add(myXmlString1).Direction = ParameterDirection.Input;
//objCmd.Parameters.Add("result", OracleType.VarChar).Direction = ParameterDirection.Output;
try
objConn.Open();
objCmd.ExecuteNonQuery();
catch (Exception ex)
Label1.Text = "Exception: {0}" + ex.ToString();
objConn.Close();
When I am trying to execute it, I am getting the following error:
Exception: {0}System.Data.OracleClient.OracleException: ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 'LOADCOMPANYINFO' ORA-06550: line 1, column 7: PL/SQL: Statement ignored at System.Data.OracleClient.OracleConnection.CheckError(OciErrorHandle errorHandle, Int32 rc) at System.Data.OracleClient.OracleCommand.Execute(OciStatementHandle statementHandle, CommandBehavior behavior, Boolean needRowid, OciRowidDescriptor& rowidDescriptor, ArrayList& resultParameterOrdinals) at System.Data.OracleClient.OracleCommand.ExecuteNonQueryInternal(Boolean needRowid, OciRowidDescriptor& rowidDescriptor) at System.Data.OracleClient.OracleCommand.ExecuteNonQuery() at Default.Button1Click(Object sender, EventArgs e)
I understand from this that the .net type is not the correct one, but I am not sure how to correct it. I could not find any proper example in any documentation that I came across. Most of the examples give information on how to read but not how to insert XML into Oracle table by calling Stored Procedure.
Can you please help me to solve this problem? I hope that you can help solve this.
Also, can you please give me an example of passing XML document XMLdocument to Oracle Stored procedure.
In both the cases, if you can provide the working code then it would be of great help.
Thanks,Hi ,
Additional to the Above error details my BPEL code looks like this:
<process name="BPELProcess1"
targetNamespace="http://xmlns.oracle.com/Application10/Project10/BPELProcess1"
xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
xmlns:client="http://xmlns.oracle.com/Application10/Project10/BPELProcess1"
xmlns:ora="http://schemas.oracle.com/xpath/extension"
xmlns:bpelx="http://schemas.oracle.com/bpel/extension"
xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/">
<partnerLinks>
<partnerLink name="bpelprocess1_client" partnerLinkType="client:BPELProcess1" myRole="BPELProcess1Provider" partnerRole="BPELProcess1Requester"/>
</partnerLinks>
<variables>
<variable name="inputVariable" messageType="client:BPELProcess1RequestMessage"/>
<variable name="outputVariable" messageType="client:BPELProcess1ResponseMessage"/>
</variables>
<sequence name="main">
<receive name="receiveInput" partnerLink="bpelprocess1_client" portType="client:BPELProcess1" operation="process" variable="inputVariable" createInstance="yes"/>
<invoke name="callbackClient" partnerLink="bpelprocess1_client" portType="client:BPELProcess1Callback" operation="processResponse" inputVariable="outputVariable"/>
</sequence>
</process>
Kindly help if anyone has faced this Issue before.
Regards,
Rakshitha -
Convert flat file to XML document and store into Oracle database
First:
I have a flatfile and created external table to read that file in Oracle
Now I want to create an XML document for each row and insert into Oracle database, I think that XMLtype.
Could you please provide me some information/steps.
Second:
Is there performance issues, because everyday I need to check that XML document stored in the database against the in coming file.
Thank You.Oracle 11g R2 Sun Solaris
Flat file is | (pipe delimited), so I did create an EXTERNAL Table
row1 a|1|2|3|4
row2 b|2|3|4|5
row3 c|6|7|8|9
I want to store each record as XML document. So it will be easy to compare with next day's load and make insert or update.
The reason is:
First day the file comes with 5 columns
after some days, the file may carry on some additional columns more than 5
In this case I do not want to alter table to capture those values, if I use XML than I can capture any number of columns, CORRECT!. Please make me correct If I am wrong.
This is the only reason to try to use the XMLType (XML Document)
On Everyday load we will be matching these XML documents and update it if there is any column's value changes
daily average load will be 10 millions and initial setup will be 60-80 millions
Do I have anyother option to capture the new values without altering the table.
Please advise!. -
Storing PDF and Word document in oracle database
any idea, how to store PDF and word document using oracle database.
thanksThe common approach is store as BLOB in database, use DBMS_LOB package to handle the loading and reading, sample script source asktom
Also check this thread in Asktom
SQL> create table demo
2 ( id INT PRIMARY KEY,
3 theBlob blob,
4 dummy_col VARCHAR2(1)
5 )
6 /
Table created.
SQL> -- --------------------------------------------------------------
SQL> -- Load a PDF file into a BLOB field and compress the BLOB.
SQL> -- --------------------------------------------------------------
SQL> declare
2 l_blob blob;
3 l_bfile bfile;
4
5 begin
6 insert into demo (id, theBLOB) values ( 1, empty_blob() )
7 returning theBlob into l_blob;
8
9 l_bfile := bfilename( 'BLOB_DIR', 'Test.PDF' );
10 dbms_lob.fileopen( l_bfile );
11
12 dbms_lob.loadfromfile( l_blob,
13 l_bfile,
14 dbms_lob.getlength( l_bfile ) );
15
16 UPDATE demo
17 SET theBlob = utl_compress.lz_compress(l_blob, 6)
18 WHERE id = 1;
19 -- If you don't want compress the LOB just update directly
20 dbms_lob.fileclose( l_bfile );
21 COMMIT;
22 end;
23 /
PL/SQL procedure successfully completed -
Extracting Tiff files stored into Oracle 8.1.7 as Long Raw
I have around 1 million tiff images stored into Oracle 8.1.7. The field type is Long Raw. The frontend used to store images into the database is SQL Windows 5 from Gupta Corporation, now called Centura. I guess the images are stored in binary format in the database. I need to extract these images at the OS level. Each Rec_no contains one tiff file in database. The table structure is as follows:
Rec_no Number(8)
image Long Raw
My goal is to convert these tiff files to JPG files so that my web application written in ASP.Net can use them and show in IE. The files are required to be converted to jpg as IE does not have native support for showing the tiff files(I hope I am not wrong in this assumption). Can i convert these tiffs to jpg directly inside the oracle database??? or i need to extract them first, save at OS level, convert them and then write back to the database?? Pls give code examples if possible. I plan to migrate the database also from 8i to 10g shortly and this is one of the migration taks. Thanks in advance...
Ravinder HoodaI have around 1 million tiff images stored into Oracle 8.1.7. The field type is Long Raw. The frontend used to store images into the database is SQL Windows 5 from Gupta Corporation, now called Centura. I guess the images are stored in binary format in the database. I need to extract these images at the OS level. Each Rec_no contains one tiff file in database. The table structure is as follows:
Rec_no Number(8)
image Long Raw
My goal is to convert these tiff files to JPG files so that my web application written in ASP.Net can use them and show in IE. The files are required to be converted to jpg as IE does not have native support for showing the tiff files(I hope I am not wrong in this assumption). Can i convert these tiffs to jpg directly inside the oracle database??? or i need to extract them first, save at OS level, convert them and then write back to the database?? Pls give code examples if possible. I plan to migrate the database also from 8i to 10g shortly and this is one of the migration taks. Thanks in advance...
Ravinder Hooda -
Storing JSON string into Oracle table
Hi,
What is appropriate way to store JSON string into Oracle table?
Regards
PeterIf JSON becomes more popular, ORACLE might write data cartridge extension for JSONDB (in the same way as XMLDB).
Till then CLOB and NCLOB is your best choice, and leave the parsing in your application layer. -
Error while loading valid, schema-related document into xdb
Hi Mark.
I tried to load other xml documents (ftp://ftp.tigr.org/pub/data/a_thaliana/ath1/PSEUDOCHROMOSOMES/) into the xdb.
The documents are related to the same schema as the documents i used until now.
I had to change the schema a bit. Three elements (protein_sequence, cds_sequence, transcript_sequence) are now stored as CLOB instead of VARCHAR2.
My first idea was, that the new documents are not valid, but they are.
The old documents still work. I get an ORA-00600 everytime.
I tried to get some information from the trace file but this did not help really.
I don't believe this will help you but i post it anyway:
Dump file d:\oracle\admin\pdw\udump\pdw_s000_6388.trc
Mon Jan 02 09:21:36 2006
ORACLE V9.2.0.7.0 - Production vsnsta=0
vsnsql=12 vsnxtr=3
Windows 2000 Version 5.0 Service Pack 4, CPU type 586
Oracle9i Enterprise Edition Release 9.2.0.7.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.7.0 - Production
Windows 2000 Version 5.0 Service Pack 4, CPU type 586
Instance name: pdw
Redo thread mounted by this instance: 1
Oracle process number: 10
Windows thread id: 6388, image: ORACLE.EXE
*** 2006-01-02 09:21:36.218
*** SESSION ID:(23.9078) 2006-01-02 09:21:36.187
QMHD escaped text too long: dstlen=0 dstbuf=/
QMHD escaped text too long: dstlen=0 dstbuf=home
QMHD escaped text too long: dstlen=0 dstbuf=public
QMHD escaped text too long: dstlen=0 dstbuf=sys
QMHD escaped text too long: dstlen=0 dstbuf=xdbconfig.xml
QMHD escaped text too long: dstlen=0 dstbuf=/
QMHD escaped text too long: dstlen=0 dstbuf=home
QMHD escaped text too long: dstlen=0 dstbuf=public
QMHD escaped text too long: dstlen=0 dstbuf=sys
QMHD escaped text too long: dstlen=0 dstbuf=xdbconfig.xml
QMHD escaped text too long: dstlen=0 dstbuf=home
QMHD escaped text too long: dstlen=0 dstbuf=RSCHULZE
QMHD escaped text too long: dstlen=0 dstbuf=PDV70
QMHD escaped text too long: dstlen=0 dstbuf=SCOTT
QMHD escaped text too long: dstlen=0 dstbuf=SCOTT1
QMHD escaped text too long: dstlen=0 dstbuf=SCOTT2
QMHD escaped text too long: dstlen=0 dstbuf=hbachman
QMHD escaped text too long: dstlen=0 dstbuf=pdw_biowh31
QMHD escaped text too long: dstlen=0 dstbuf=pdw_stage
QMHD escaped text too long: dstlen=0 dstbuf=pdw_tigr_chromosome
QMHD escaped text too long: dstlen=0 dstbuf=uniprot
QMHD escaped text too long: dstlen=0 dstbuf=pdw_tigr_chromosome
QMHD escaped text too long: dstlen=0 dstbuf=data
QMHD escaped text too long: dstlen=0 dstbuf=xsd
QMHD escaped text too long: dstlen=0 dstbuf=data
QMHD escaped text too long: dstlen=0 dstbuf=seq1.txt
QMHD escaped text too long: dstlen=0 dstbuf=seq2.txt
QMHD escaped text too long: dstlen=0 dstbuf=seq3.txt
QMHD escaped text too long: dstlen=0 dstbuf=seq4.txt
QMHD escaped text too long: dstlen=0 dstbuf=seq5.txt
*** 2006-01-02 09:36:57.421
ksedmp: internal or fatal error
ORA-00600: internal error code, arguments: [kokbgcip1], [196609], [63], [], [], [], [], []
Current SQL statement for this session:
INSERT /*+ NO_REF_CASCADE */ INTO "PDW_TIGR_CHROMOSOME"."SYS_NT0upV7+xbRnu3KquZIaRFgQ=="("NESTED_TABLE_ID","ARRAY_INDEX","SYS_NC_ROWINFO$") VALUES(:1,:2,:3)
----- Call Stack Trace -----
calling call entry argument values in hex
location type point (? means dubious value)
ksedmp+327 CALLrel ksedst+0
ksfdmp.108+14 CALLrel ksedmp+0 3
_kgerinv+131 CALLreg 00000000 D3E4368 3
kgeasnmierr+19 CALLrel kgerinv+0 D3E4368 4BE2A94 1AF86D4 2
4B56B40
kokbgcip+343 CALLrel kgeasnmierr+0 D3E4368 4BE2A94 1AF86D4 2 4
30001 4 3F
qerocImageIterStar CALLrel kokbgcip+0
t+160
qerocStart+265 CALLrel qerocImageIterStar 237701B4 D3E41E0
t+0
_kokbint+242 CALL??? 00000000 81DFD20 1
kokbeva+338 CALLrel kokbint+0 237700B8 237700FC
..1.42_2.filter.9+1 CALLreg 00000000 D3E41E0
101
insolev.73+164 CALLrel evaopn2+0 237700B8
insbrp.73+1558 CALLrel insolev.73+0 2374A8B4 81DDFF8 1
insrow+173 CALLrel insbrp.73+0
insdrv.73+1302 CALLrel insrow+0 81DDFF8 4B584E4 0
..1.6_1.filter.73+2 CALLrel _insdrv.73+0 81DDFF8
28
..1.5_2.except.29+1 CALLrel _insexe+0 2374A8B4 4B58730
6740
..1.2_1.filter.25+3 CALLrel _opiexe+0 4 3 4B58B24
347
opikpr+512 CALLrel opiall0+0 65 22 4B58D20 0 0 4B58DB8 9C
20 0 0 0 0 0
..1.1_1.filter.34+1 CALLreg 00000000 65 14 4B59980
356
rpidrus.43+167 CALLrel opiodr+0 65 14 4B59980 0
_skgmstack+113 CALLreg 00000000 4B590A0
rpidru+109 CALLrel skgmstack+0 4B590B8 D3E41F0 F618 59941C
4B590A0
_rpiswu2+839 CALLreg 00000000 4B59498
kprball+1537 CALLrel rpiswu2+0 1EA8DD18 102 4B59414 4
1E833D34 102 4B59414 0 59932C
5991DC 4B59498 8
kokbint+1766 CALLrel kprball+0 4B59980 500
kokbeva+338 CALLrel kokbint+0 2374E498 2374E4DC
..1.42_2.filter.9+1 CALLreg 00000000 D3E41E0
101
insolev.73+164 CALLrel evaopn2+0 2374E498
insbrp.73+1558 CALLrel insolev.73+0 25EC7468 7D0BD90 1
insrow+173 CALLrel insbrp.73+0
insdrv.73+1302 CALLrel insrow+0 7D0BD90 4B5AD78 0
..1.6_1.filter.73+2 CALLrel _insdrv.73+0 7D0BD90
28
..1.5_2.except.29+1 CALLrel _insexe+0 25EC7468 4B5AFC4
6740
..1.2_1.filter.25+3 CALLrel _opiexe+0 4 3 4B5B3B8
347
opikpr+512 CALLrel opiall0+0 65 22 4B5B5B4 0 0 4B5B64C 77
20 0 0 0 0 0
..1.1_1.filter.34+1 CALLreg 00000000 65 14 4B5BE70
356
rpidrus.43+167 CALLrel opiodr+0 65 14 4B5BE70 0
_skgmstack+113 CALLreg 00000000 4B5B934
rpidru+109 CALLrel skgmstack+0 4B5B94C D3E41F0 F618 59941C
4B5B934
_rpiswu2+839 CALLreg 00000000 4B5BD2C
kprball+1537 CALLrel rpiswu2+0 1EA8DD18 102 1EA891BC 4
1E833D34 102 1EA8923C 0
59932C 5991DC 4B5BD2C 9
qmskInsertXmlType+ CALLrel kprball+0 4B5BE70 180
1203
qmskStoreXobWithIm CALLrel qmskInsertXmlType+
age+526 0
qmskStoreXob+16 CALLrel qmskStoreXobWithIm
age+0
qmskFlushXob+22 CALLrel qmskStoreXob+0 4BFCFCC 4BE6698 0
_qmeSaveContents+44 CALLreg 00000000
6
qmePreSave+2417 CALLrel qmeSaveContents+0 4BFE790 2 1
_qmtEventFire+259 CALLreg 00000000 D3E4368 3 4BFE8B0
qmxiWriteXobToImag CALLrel qmtEventFire+0 D3E4368 3 4BFE8B0
eInternal+60
qmxiWriteXobToImag CALLrel qmxiWriteXobToImag D3E4368 4B5D418 0 4BFE8B0
eWithHeap+82 eInternal+0 700ECBC 4B5D398 4B5D364
4B5D384 60A09FC 4B5C37C 0 6
D3E4368 C 4B5D418
qmxtgGetOpqImageFr CALLrel qmxiWriteXobToImag D3E4368 4B5D418 0 4BFE8B0
omXob+430 eWithHeap+0 700ECBC 4B5D398 4B5D364
4B5D384 4B5D470 C 6 700ECF8
4B5D418
qmskStoreXobWithIm CALLrel qmxtgGetOpqImageFr
age+370 omXob+0
qmskStoreXob+16 CALLrel qmskStoreXobWithIm
age+0
qmskFlushXob+22 CALLrel qmskStoreXob+0 4BFE8B0 4BFF740 4B5D6FC
_qmeInsertResRow+22 CALLreg 00000000
5
qmeInsertRes+1831 CALLrel qmeInsertResRow+0
qmeLinkInternal+47 CALLrel qmeInsertRes+0
12
qmeCreOrBindRes+33 CALLrel qmeLinkInternal+0 4BFE790 60A5D14 1DFE0323 1D 0
1 1 0 4B5D7A0 4B5D85C 0 0
qmeCreateRes+115 CALLrel qmeCreOrBindRes+0 4BFE790 60A5D14 1DFE0304 1F
1DFE0323 1D 0 1 0 4B5D85C 0 0
4B5D85C 0
qmeuCreateOrUpdate CALLrel qmeCreateRes+0 4BFE790 1DFE0304 1F 1DFE0323
Res+2232 1D 0 0 0
qmhput+393 CALLrel _qmeuCreateOrUpdate
Res+0
_qmhProcessRequestD CALLreg 00000000 1DFE4398
ata+2576
qmpsrun+1220 CALL??? 00000000
opitsk+838 CALLrel qmps_run+0 D3E4368
opiino+698 CALLrel opitsk+0 0 0 D3EA5C8 278A650 3 0
..1.1_1.filter.34+1 CALLreg 00000000 3C 4 4B5F448
356
opirip+662 CALLrel opiodr+0 3C 4 4B5F448 0
opidrv+654 CALLrel opirip+0 32 0 0
sou2o+25 CALLrel opidrv+0
opimai+336 CALLrel sou2o+0 4B5FE1C 32 0 0
BackgroundThreadSt CALLrel opimai+0
art@4+356
77E7B385 CALLreg 00000000
--------------------- Binary Stack Dump ---------------------
========== FRAME [1] (_ksedmp+327 -> _ksedst+0) ==========
Dump of memory from 0x04B56A68 to 0x04B56AE0
4B56A60 04B56AE0 00522AC8 [.j...*R.]
4B56A70 00000000 00000000 00000000 00000000 [................]
4B56A80 FFFFFFFF 0000003F 0D3E4444 01AF86D4 [....?...DD>.....]
4B56A90 0D3E444C 04B56ADC 0283676E 0D3E4444 [LD>..j..ng..DD>.]
4B56AA0 0D3E444C 00000000 00000000 01AF86D4 [LD>.............]
4B56AB0 00000002 00000009 0D3E4368 04BE2A94 [........hC>..*..]
4B56AC0 01A89F00 0D3E41E0 04B56A74 0D3E4368 [.....A>.tj..hC>.]
4B56AD0 04B571F8 015DDE00 02775F44 FFFFFFFF [.q....].D_w.....]
========== FRAME [2] (_ksfdmp.108+14 -> _ksedmp+0) ==========
Dump of memory from 0x04B56AE0 to 0x04B56AEC
4B56AE0 04B56AEC 0078468B 00000003 [.j...Fx.....]
========== FRAME [3] (_kgerinv+131 -> 00000000) ==========
Dump of memory from 0x04B56AEC to 0x04B56B0C
4B56AE0 04B56B0C [.k..]
4B56AF0 02836849 0D3E4368 00000003 081B3444 [Ih..hC>.....D4..]
4B56B00 0D3E41E0 081B3444 081B3444 [.A>.D4..D4..]
========== FRAME [4] (_kgeasnmierr+19 -> _kgerinv+0) ==========
Dump of memory from 0x04B56B0C to 0x04B56B28I have a new problem:
Due to the changes of the schema ( transcript_sequence ... stored as clob) i got an error in a view.
ORA-00932 : incosistent datatypes
The error occurs in V007 in the following rows
extractValue(value(tu),'/TU/TRANSCRIPT_SEQUENCE'),
extractValue(value(model),'/MODEL/CDS_SEQUENCE'),
extractValue(value(model),'/MODEL/PROTEIN_SEQUENCE')
But in V005 there is no error althought there is the row extractValue(value(tu),'/TU/TRANSCRIPT_SEQUENCE'),
the views
create or replace view V007_MODEL(FEAT_NAME,
GENE_SYNONYM,
GENE_SYNONYM_SYN_TYPE,
CHROMO_LINK,
TU_DATE,
TU_COORDSET_END5,
TU_COORDSET_END3,
TRANSCRIPT_SEQUENCE,
URL,
URL_URLNAME,
CURATED,
MODEL_COMMENT,
MODEL_FEAT_NAME,
PUB_LOCUS,
CDNA_SUPPORT_ACCESSION,
CDNA_SUPPORT_ACCESSION_DBXREF,
CDNA_SUPPORT_ACCESSION_IS_FLI,
CDNA_SA_UNIQUE_TO_ISOFORM,
CDNA_SA_ANNOT_INCORP,
MODEL_GENE_SYNONYM,
MODEL_GENE_SYNONYM_SYN_TYPE,
MODEL_CHROMO_LINK,
MODEL_DATE,
MODEL_COORDSET_END5,
MODEL_COORDSET_END3,
MA_AT_METHOD,
MA_AT_ATT_SCORE,
MA_AT_ATT_SCORE_DESC)
CDS_SEQUENCE,
PROTEIN_SEQUENCE)
as
select
distinct
extractValue(value(tu) ,'/TU/FEAT_NAME'),
extractValue(value(tu_gene_synonym) ,'/GENE_SYNONYM/text()'),
extractValue(value(tu_gene_synonym) ,'/GENE_SYNONYM/@SYN_TYPE'),
extractValue(value(tu_chromo_link) ,'/CHROMO_LINK/text()'),
extractValue(value(tu) ,'/TU/DATE'),
extractValue(value(tu) ,'/TU/COORDSET/END5'),
extractValue(value(tu) ,'/TU/COORDSET/END3'),
extractValue(value(tu) ,'/TU/TRANSCRIPT_SEQUENCE'),
extractValue(value(url) ,'/URL/text()'),
extractValue(value(url) ,'/URL/@URLNAME'),
extractValue(value(model) ,'/MODEL/@CURATED'),
extractValue(value(model) ,'/MODEL/@COMMENT'),
extractValue(value(model) ,'/MODEL/FEAT_NAME'),
extractValue(value(model) ,'/MODEL/PUB_LOCUS'),
extractValue(value(accession) ,'/ACCESSION/text()'),
extractValue(value(accession) ,'/ACCESSION/@DBXREF'),
extractValue(value(accession) ,'/ACCESSION/@IS_FLI'),
extractValue(value(accession) ,'/ACCESSION/@UNIQUE_TO_ISOFORM'),
extractValue(value(accession) ,'/ACCESSION/@ANNOT_INCORP'),
extractValue(value(model_gene_synonym),'/GENE_SYNONYM/text()'),
extractValue(value(model_gene_synonym),'/GENE_SYNONYM/@SYN_TYPE'),
extractValue(value(model_chromo_link) ,'/CHROMO_LINK/text()'),
extractValue(value(model) ,'/MODEL/DATE'),
extractValue(value(model) ,'/MODEL/COORDSET/END5'),
extractValue(value(model) ,'/MODEL/COORDSET/END3'),
extractValue(value(attribute_type) ,'/ATTRIBUTE_TYPE/@METHOD'),
extractValue(value(att_score) ,'/ATT_SCORE/text()'),
extractValue(value(att_score) ,'/ATT_SCORE/@DESC')--,
extractValue(value(model) ,'/MODEL/CDS_SEQUENCE'),
extractValue(value(model) ,'/MODEL/PROTEIN_SEQUENCE')
from TIGR t,
table(xmlsequence(extract(value(t) ,'/TIGR/PSEUDOCHROMOSOME'))) p,
table(xmlsequence(extract(value(p) ,'/PSEUDOCHROMOSOME/ASSEMBLY/GENE_LIST/PROTEIN_CODING/TU'))) tu,
table(xmlsequence(extract(value(tu) ,'/TU/GENE_SYNONYM'))) (+) tu_gene_synonym,
table(xmlsequence(extract(value(tu) ,'/TU/CHROMO_LINK'))) (+) tu_chromo_link,
table(xmlsequence(extract(value(tu) ,'/TU/URL'))) (+) url,
table(xmlsequence(extract(value(tu) ,'/TU/MODEL'))) model,
table(xmlsequence(extract(value(model) ,'/MODEL/CDNA_SUPPORT/ACCESSION'))) (+) accession,
table(xmlsequence(extract(value(model) ,'/MODEL/GENE_SYNONYM'))) (+) model_gene_synonym,
table(xmlsequence(extract(value(model) ,'/MODEL/CHROMO_LINK'))) (+) model_chromo_link,
table(xmlsequence(extract(value(model) ,'/MODEL/MODEL_ATTRIBUTE/ATTRIBUTE_TYPE'))) (+) attribute_type,
table(xmlsequence(extract(value(attribute_type),'/ATTRIBUTE_TYPE/ATT_SCORE'))) (+) att_score,
table(xmlsequence(extract(value(model) ,'/MODEL/EXON'))) exon
create or replace view V005_GENE_INFO(FEAT_NAME,
GENE_SYNONYM,
GENE_SYNONYM_SYN_TYPE,
CHROMO_LINK,
TU_DATE,
TU_COORDSET_END5,
TU_COORDSET_END3,
TRANSCRIPT_SEQUENCE,
URL,
URL_URLNAME,
LOCUS,
ALT_LOCUS,
PUB_LOCUS,
GENE_NAME,
GENE_NAME_IS_PRIMARY,
COM_NAME,
COM_NAME_CURATED,
COM_NAME_IS_PRIMARY,
GENE_INFO_COMMENT,
PUB_COMMENT,
EC_NUM,
EC_NUM_IS_PRIMARY,
GENE_SYM,
GENE_SYM_IS_PRIMARY,
IS_PSEUDOGENE,
FUNCT_ANNOT_EVIDENCE_TYPE,
FAE_ASSIGN_ACC,
FAE_ASSIGN_ACC_ASSIGN_METHOD,
GENE_INFO_DATE)
as
select
extractValue(value(tu) ,'/TU/FEAT_NAME'),
extractValue(value(gene_synonym) ,'/GENE_SYNONYM/text()'),
extractValue(value(gene_synonym) ,'/GENE_SYNONYM/@SYN_TYPE'),
extractValue(value(chromo_link) ,'/CHROMO_LINK/text()'),
extractValue(value(tu) ,'/TU/DATE'),
extractValue(value(tu) ,'/TU/COORDSET/END5'),
extractValue(value(tu) ,'/TU/COORDSET/END3'),
extractValue(value(tu) ,'/TU/TRANSCRIPT_SEQUENCE'),
extractValue(value(url) ,'/URL/text()'),
extractValue(value(url) ,'/URL/@URLNAME'),
extractValue(value(tu) ,'/TU/GENE_INFO/LOCUS'),
extractValue(value(alt_locus) ,'/ALT_LOCUS/text()'),
extractValue(value(tu) ,'/TU/GENE_INFO/PUB_LOCUS'),
extractValue(value(gene_name) ,'/GENE_NAME/text()'),
extractValue(value(gene_name) ,'/GENE_NAME/@IS_PRIMARY'),
extractValue(value(com_name) ,'/COM_NAME/text()'),
extractValue(value(com_name) ,'/COM_NAME/@CURATED'),
extractValue(value(com_name) ,'/COM_NAME/@IS_PRIMARY'),
extractValue(value(tu) ,'/TU/GENE_INFO/COMMENT'),
extractValue(value(tu) ,'/TU/GENE_INFO/PUB_COMMENT'),
extractValue(value(ec_num) ,'/EC_NUM/text()'),
extractValue(value(ec_num) ,'/EC_NUM/@IS_PRIMARY'),
extractValue(value(gene_sym) ,'/GENE_SYM/text()'),
extractValue(value(gene_sym) ,'/GENE_SYM/@IS_PRIMARY'),
extractValue(value(tu) ,'/TU/GENE_INFO/IS_PSEUDOGENE'),
extractValue(value(funct_annot_evidence),'/FUNCT_ANNOT_EVIDENCE/@TYPE'),
extractValue(value(assign_acc) ,'/ASSIGN_ACC/text()'),
extractValue(value(assign_acc) ,'/ASSIGN_ACC/@ASSIGN_METHOD'),
extractValue(value(tu) ,'/TU/GENE_INFO/DATE')
from TIGR t,
table(xmlsequence(extract(value(t) ,'/TIGR/PSEUDOCHROMOSOME'))) p,
table(xmlsequence(extract(value(p) ,'/PSEUDOCHROMOSOME/ASSEMBLY/GENE_LIST/PROTEIN_CODING/TU'))) tu,
table(xmlsequence(extract(value(tu) ,'/TU/GENE_SYNONYM'))) (+) gene_synonym,
table(xmlsequence(extract(value(tu) ,'/TU/CHROMO_LINK'))) (+) chromo_link,
table(xmlsequence(extract(value(tu) ,'/TU/URL'))) (+) url,
table(xmlsequence(extract(value(tu) ,'/TU/GENE_INFO/ALT_LOCUS'))) (+) alt_locus,
table(xmlsequence(extract(value(tu) ,'/TU/GENE_INFO/GENE_NAME'))) (+) gene_name,
table(xmlsequence(extract(value(tu) ,'/TU/GENE_INFO/COM_NAME'))) com_name,
table(xmlsequence(extract(value(tu) ,'/TU/GENE_INFO/EC_NUM'))) (+) ec_num,
table(xmlsequence(extract(value(tu) ,'/TU/GENE_INFO/GENE_SYM'))) (+) gene_sym,
table(xmlsequence(extract(value(tu) ,'/TU/GENE_INFO/FUNCT_ANNOT_EVIDENCE'))) (+) funct_annot_evidence,
table(xmlsequence(extract(value(funct_annot_evidence),'/FUNCT_ANNOT_EVIDENCE/ASSIGN_ACC'))) (+) assign_acc
I have a second question.
Usually I use WEBDAV or FTP to load the xml documents.
There are 5 documents for TIGR Arabidopsis. Now it works to load the documents into the xdb. I usually use WEBDAV. But when I load the first document I get an error. Nevertheless the document is shredded. Because the WEBDAV error message is not meaningful, I used PL/SQL.
I tried it like this
insert into TIGR values (xmltype(bfilename(USER,'/home/pdw_tigr_chromosome/data/CHR1.R5v01212004wos.xml'),nls_charset_id('AL32UTF8')))
( I deleted the expressions " xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="tigrxml.xsd" " in the document before).
But this didn't work.
So I tried
insert into TIGR values (xmltype(xdbURIType('/home/pdw_tigr_chromosome/data/CHR1.R5v01212004wos.xml').getClob(),'tigrxml.xsd',1,1))
and it worked. But it seemed to need more time than per WEBDAV or FTP ( but probably I err ). It took 1h 48m for a 74MB file.
When I load the documents with PL/SQL the document is not shredded. At least the document has its original size when i have a look at the repository per WEBDAV and not the usual 0 bytes. But the data is correctly stored in the xmltype table TIGR
Message was edited by:
Nick_MD -
Inserting MS WORD DOC into Oracle
HI,
Can someone help me in storing word document from local hard disk(windows C:\UploadFolder) into Oracle Table.
I'm trying the following code:
to create a directory----
create or replace directory MY_FILES as 'C:\Uploadfolder'
table----
Create table emp1(
id number(10),
name varchar2(30),
details BLOB)
code for inserting----
declare
f_lob bfile;
b_lob blob;
begin
insert into emp1(id,name,details)
values ( 170353, 'JOHN',empty_blob() )
return details into b_lob;
f_lob := bfilename( 'MY_FILES', 'details1.doc' );
dbms_lob.fileopen(f_lob, dbms_lob.file_readonly);
dbms_lob.loadfromfile
( b_lob, f_lob, dbms_lob.getlength(f_lob) );
dbms_lob.fileclose(f_lob);
commit;
end;
The error I'm getting is----------
declare
ERROR at line 1:
ORA-22288: file or LOB operation FILEOPEN failed
No such file or directory
ORA-06512: at "SYS.DBMS_LOB", line 504
ORA-06512: at line 10
Please help me!!!!
Thanks,
SanketWelcome to the forum!
create directory maps to a directory on the database server, not your local. You need to use a client application to upload documents to the database. -
Problems while uploading text documents into Unicode Database
I just upgraded our database from 9iR1 to 9iR2 (9.2.0.1.0). The server
character set is AL32UTF8. Now I'm facing a problem when
uploading text documents into the database via a web frontend.
I use the upload table defined for the PL/SQL Database Access Descriptor:
create table TB_UPLOAD (
NAME VARCHAR2(256) not null,
MIME_TYPE VARCHAR2(128),
DOC_SIZE NUMBER,
DAD_CHARSET VARCHAR2(128),
LAST_UPDATED DATE,
CONTENT_TYPE VARCHAR2(128),
BLOB_CONTENT BLOB);
After uploading a text document containing the two words "hallo welt",
the following statement returns not "hallo welt", but "68616C6C6F2077656C74":
declare
b_loc blob;
v_amount integer := 100;
v_buffer varchar2(100);
v_offset integer := 1;
begin
select blob_content into b_loc from tb_upload where name like 'mydoc.txt';
dbms_lob.read(b_loc, v_amount, v_offset, v_buffer);
htp.prn(v_buffer);
end;
What is this? I studied the documentation, but didn't found a solution.
When trying to use Oracle's built-in procedure wpg_docload.download_file,
the content is shown the way it should be. Unfortunately, I can't use
wpg_docload.download_file in order to copy the BLOB content to another table.
Any hints would be appreciated!
Thanks so much in advance!
Roman
E-Mail: [email protected]Hi Roman,
the upload uses a BLOB (Binary Lob). Your Document is
stored as is in the binary representation. If you
use dbms_lob.read on a blob and your buffer is a varchar2 the binary representation is not translated!!!
use a raw for the buffer and utl_raw.cast_to_varchar2
to do the conversion to varchar.
try this
Procedure SHOW_DOC(p_name doc_test.name%TYPE)
IS
v_len number;
v_mime_type tb_upload.mime_type%TYPE;
v_offset integer := 1;
v_Buf_size integer := 32767;
v_buf raw(32767);
v_blob blob;
v_Doc_name varchar2(1000);
BEGIN
v_doc_name := url_Decode(p_name);
select mime_type,doc_size,blob_content
into v_mime_Type,v_len,v_blob
from tb_upload
where name = v_doc_name;
OWA_UTIL.MIME_HEADER(v_Mime_Type);
begin
LOOP
DBMS_LOB.READ(v_blob,v_buf_size,v_offset,v_buf);
HTP.PRN(UTL_RAW.CAST_TO_VARCHAR2(v_buf));
v_offset := v_offset + v_buf_size;
END LOOP;
exception
when no_data_found then
null;
end;
END;
HTH
detlev -
Problems while uploading text documents into Database
I just upgraded our database from 9iR1 to 9iR2 (9.2.0.1.0). The server
character set is AL32UTF8. Now I'm facing a problem when
uploading text documents into the database via a web frontend.
I use the upload table defined for the PL/SQL Database Access Descriptor:
create table TB_UPLOAD (
NAME VARCHAR2(256) not null,
MIME_TYPE VARCHAR2(128),
DOC_SIZE NUMBER,
DAD_CHARSET VARCHAR2(128),
LAST_UPDATED DATE,
CONTENT_TYPE VARCHAR2(128),
BLOB_CONTENT BLOB);
After uploading a text document containing the two words "hallo welt",
the following statement returns not "hallo welt", but "68616C6C6F2077656C74":
declare
b_loc blob;
v_amount integer := 100;
v_buffer varchar2(100);
v_offset integer := 1;
begin
select blob_content into b_loc from tb_upload where name like 'mydoc.txt';
dbms_lob.read(b_loc, v_amount, v_offset, v_buffer);
htp.prn(v_buffer);
end;
What is this? I studied the documentation, but didn't found a solution.
When trying to use Oracle's built-in procedure wpg_docload.download_file,
the content is shown the way it should be. Unfortunately, I can't use
wpg_docload.download_file in order to copy the BLOB content to another table.
Any hints would be appreciated!
Thanks so much in advance!
Roman
E-Mail: [email protected]Hi Roman,
the upload uses a BLOB (Binary Lob). Your Document is
stored as is in the binary representation. If you
use dbms_lob.read on a blob and your buffer is a varchar2 the binary representation is not translated!!!
use a raw for the buffer and utl_raw.cast_to_varchar2
to do the conversion to varchar.
try this
Procedure SHOW_DOC(p_name doc_test.name%TYPE)
IS
v_len number;
v_mime_type tb_upload.mime_type%TYPE;
v_offset integer := 1;
v_Buf_size integer := 32767;
v_buf raw(32767);
v_blob blob;
v_Doc_name varchar2(1000);
BEGIN
v_doc_name := url_Decode(p_name);
select mime_type,doc_size,blob_content
into v_mime_Type,v_len,v_blob
from tb_upload
where name = v_doc_name;
OWA_UTIL.MIME_HEADER(v_Mime_Type);
begin
LOOP
DBMS_LOB.READ(v_blob,v_buf_size,v_offset,v_buf);
HTP.PRN(UTL_RAW.CAST_TO_VARCHAR2(v_buf));
v_offset := v_offset + v_buf_size;
END LOOP;
exception
when no_data_found then
null;
end;
END;
HTH
detlev -
How to insert document into xmltype column through an http post request with perl
Oracle 11.2.0.3
Windows server 2008r2
Apache tomcat 7.0
Oracle APEX 4.2.1
Oracle APEX Listener 2.0
I would like to insert a XML document into the database through an APEX restful web service. The POST into the web service in done with PERL. The following code will insert an empty record in a table with column of XMLType type.
Perl Code
use strict;
use warnings;
use LWP::UserAgent;
use HTTP:Headers;
my $headers = HTTP::Headers->new();
my $url = "http://host:port:apex/<application_workspace>/<restfull service module>/<uri template>/
my $sendthis = ('<?xml version="1.0" enconding="utf-8"?>
<students>
<row>
<name>Mark</name>
<age>30</age>
</row>
<./students>';)
$headers -> header('Content-Type' => 'text/xml; charset=utf-8');
my $request = HTTP:Request->new('POST', $url, $headers, $sendthis);
$request-> protocol('HTTP/1.1');
my $browser = LWP::UserAgent->new();
my $response = $browser->request($request);
my $gotthis= $response->content();
my $the_file_data = $response->content();
APEX restful service
Method: POST
Source type: PL/SQL
MIME Types allowed: blank
require secure access: none
source:
{declare
doc varchar2(32000);
begin
insert into table <column name>
values(doc);
commit;
end;
Table code
{ create table <tablename>
(column name XMLType>);
The above code will insert an empty column into the table.
Any ideas why?It's a really bad idea to assemble XML using strings and string concatenation in SQL or PL/SQL. First there is a 4K limit in SQL, and 32K limit in PL/SQL, which means you end up constructing the XML in chunks, adding uneccessary complications. 2nd you cannot confirm the XML is valid or well formed using external tools.
IMHO it makes much more sense to keep the XML content seperated from the SQL / PL/SQL code
When the XML can be stored a File System accessable from the database, The files can be loaded into the database using mechansims like BFILE.
In cases where the XML must be staged on a remote file system, the files can be loaded into the database using FTP or HTTP and in cases where this is not an option, SQLLDR.
-Mark
Maybe you are looking for
-
2 ipods on, so many files, now what?
I got both Ipods on the new computer, songs are back on the computer, but even after following the "Multiple Ipods on one computer" (method three) instructions, Itunes is putting things everywhere:( I made 2 different libraries. One had my songs, the
-
Intepolation calibration encoding message. hp photosmart printer
I am so confused and need help. Everytime I print on my vista laptop I get this message. I have tried and nothing I do works.
-
Keywords not appearing in Windows
A quick google search has revealed that this is a pretty common problem - Keywords created in Aperture don't show up in Windows programs. But the why of it is a little difficult to wrap my brain around. Here's the workflow: I'm scanning a bunch of im
-
ORA-28546: connection initialization failed, probable Net8 admin error
hello all! so i'm using Heterogeneous services to connect to an SQL server DB from a Oracle DB. When i try with both the SQL server and Oracle DB on the same PC, everything works fine but when i try to access the SQL Server DB from another PC across
-
Have a S3630f slimline with hard disk crash. Installed new Hard disk to replace segate 3500620xx disk and initiated recovery from CD. Vista 64 will not load after recovery operation from CD or hard disk. Vista 32 and 64 will not load from a window