How to load externl files (PDF) into BLOB column. Please help.
Hi All,
I've currently been working on loading many external binary files (PDF) into BLOB column. After some digging, I learn that the SQL*LOADER can be used to load data from external files into table. I also got help from another forummate mentioning to use PL/SQL procedure to do so. Since I have not done anything like this before. So, my question is what is the simple approach needed to upload PDF files into a table(there is only one table containing BLOB column in my database). In addition, the LOBs can not be query-able, I wanted to list the contents of the LOBs column to make sure that I did successfully upload data into the database. How can I do that?. I do need your help. Please direct me step by step how to do so. Your help is greatly appreciated.
Regards,
Trang
Hi,
If the following link helps to you then great.
http://www.exefind.com/oralobeditor-P25468.html
Regards,
Sailaja
Similar Messages
-
Unable to update software or upload pics from SD card-how do I remove files from startup disk? Please help!
Hello Smile_333
The article below will assist with finding things and help increase the hard drive space for your computer. The best way is to have an external hard drive to copy things to if you do not want to delete and loose things.
OS X Mountain Lion: Increase disk space
http://support.apple.com/kb/PH10677
Thanks for using Apple Support Communities.
Regards,
-Norm G. -
How to upload a file to a BLOB column in the DB using PL/SQL???
Hi
I am trying to upload a file to a BLOB column in my database. I wana do this using some pl/sql procedure.I don't wana use webutil. is it possible??? and if so can anybody help me with this???
Regards
ShirazHello,
This is a stored procedure sample that show how insert into CLOB, BLOB and BFILE columns
CREATE OR REPLACE PROCEDURE Insert_document
PC$Type IN DOCUMENT.TYP%TYPE
,PC$Nom IN DOCUMENT.NOM_DOC%TYPE
,PC$Texte IN VARCHAR2
,PC$Image IN VARCHAR2
,PC$Fichier IN VARCHAR2
) IS
L$Blob BLOB;
L$Clob CLOB;
L$Bfile BFILE;
LN$Len NUMBER := dbms_lob.lobmaxsize;
LN$Num NUMBER ;
LN$src_off PLS_INTEGER := 1 ;
LN$dst_off PLS_INTEGER := 1 ;
LN$Langctx NUMBER := dbms_lob.default_lang_ctx ;
LN$Warn NUMBER;
BEGIN
-- Création of new raw --
If PC$Fichier is not null Then
L$Bfile := BFILENAME( 'FICHIERS_IN', PC$Fichier );
End if ;
-- Creation of temporary objetcs --
dbms_lob.createtemporary( L$Clob, TRUE ) ;
dbms_lob.createtemporary( L$Blob, TRUE ) ;
-- Loading text in CLOB column --
If PC$Texte is not null Then
L$Bfile := BFILENAME( 'FICHIERS_IN', PC$Texte );
dbms_lob.fileopen(L$Bfile, dbms_lob.file_readonly);
If dbms_lob.fileexists( L$Bfile ) = 1 Then
dbms_output.put_line(PC$Texte || ' open' ) ;
dbms_lob.loadclobfromfile(
L$Clob, -- Destination CLOB
L$Bfile, -- Source file pointer
LN$Len, -- # bytes to read
LN$src_off, -- Source start position
LN$dst_off, -- Target start position
dbms_lob.default_csid, -- CSID
LN$Langctx, -- Language Context
LN$Warn); -- Warning message
dbms_lob.fileclose(L$Bfile);
Else
raise_application_error( -20100, 'Erreur ouverture ' || PC$Texte ) ;
End if ;
End if ;
-- Loading image in BLOB column --
If PC$Image is not null Then
L$Bfile := BFILENAME( 'FICHIERS_IN', PC$Image );
dbms_lob.fileopen(L$Bfile, dbms_lob.file_readonly);
dbms_lob.loadblobfromfile(
L$Blob, -- BLOB de destination
L$Bfile, -- Pointeur de fichier en entrée
LN$Len, -- Nombre d'octets à lire
LN$src_off, -- Position source de départ
LN$dst_off); -- Position destination de départ
dbms_lob.fileclose(L$Bfile);
End if ;
-- Save --
Insert into DOCUMENT (ID, NOM_DOC, TYP, UTILISE, LOB_TEXTE, LOB_DATA, LOB_FICHIER)
Values( SEQ_DOCUMENT.NEXTVAL, PC$Nom, PC$Type, NULL, L$Clob, L$Blob, L$Bfile ) ;
-- Free the temporary objects --
dbms_lob.freetemporary( L$Clob ) ;
dbms_lob.freetemporary( L$Blob ) ;
END;
/The table structure for this sample is the following:
CREATE TABLE DOCUMENT (
ID NUMBER (5) PRIMARY KEY,
TYP VARCHAR2 (20),
UTILISE VARCHAR2 (30),
LOB_TEXTE CLOB,
LOB_DATA BLOB,
LOB_FICHIER BFILE,
NOM_DOC VARCHAR2 (100))
/Francois -
How to open a file form a blob column?
I'm storing some files in oracle 9.2 in a blob column, although i can't open them using php 4, I'm using this script :
<?php
$SQL="SELECT ID_ARCHIVO,CONTENT";
$SQL=$SQL." FROM ARCHIVOS_PRUEBAS ";
$SQL=$SQL." WHERE ID_ARCHIVO =".$v_ID_ARCHIVO ;
$c=OCILogon("$v_USER" , "$v_PASS" ,"$v_CONEXION" );
$s = OCIParse($c,$SQL );
if (!OCIExecute($s)) { print "execution failed"; exit(); }
OCIFetchInto($s,&$arr,OCI_RETURN_LOBS);
echo $arr["CONTENT"]->load();
?>
it shows this error
Fatal error: Call to a member function on a non-object in ov_archivo_detail_test.php on [echo $arr["CONTENT"]->load(); ].
I know the data is stored correctly since i used toad to save and open the blob file and it was ok, but i still can't find a right way to show the file from the web.
Message was edited by:
user560595Hi,
<br>
<br>
Did you already try take a look on
Oracle+PHP Cookbook: Working with LOBs in Oracle and PHP ?
<br>
<br>
Cheers -
How to display binary file saved in BLOB column in Discoverer PLUS /VIEWER
HI, Friends,
I tried to display the binary file saved in the database in BLOB column with the *.doc or *.xls fomats, but it seemed not work at all. I can display them in discoverer DESKTOP, but not the web version PLUS or VIEWER. MY Discoverer PLUS/VIEWER version is 9.0.4.45.02 and the database is 9.2.0.4. Are there any special setting/configuration in somewhere (Discoverer administration/Applicaiton server/PLUS/VIEWER?)
Any help /information will be greatly appreciated.
Thanks a lot.Hi,
Sorry but this feature is not available in the web version of 9.0.4.45. You will have to write your own mod_plsql function to download the file.
Rod West -
How to load few objects in one sence ?Please help.
Is there any one know how to load few object into one sence ?
I have some code , It can load one object one the sence .Please any one know how to change it . Thanks so much .
-------------------------- model loading --------------
private void loadModel(String fn)
/* Load the model from fn into the scene graph using a NCSA
Portfolio loader. Rotate and scale it to make it easier to see.
Store the loaded model's scene in the global loadedScene,
and its branch group in loadedBG.
FileWriter ofw = null;
System.out.println( "Loading: " + fn );
try {
ModelLoader loader = new ModelLoader(); // the NCSA portfolio loader
// System.out.println("Loader flags: " + loader.getFlags());
loadedScene = loader.load(fn); // the loaded scene
// Rotate and scale the model
if(loadedScene != null ) {
loadedBG = loadedScene.getSceneGroup(); // the model's BG
Transform3D t3d = new Transform3D();
t3d.rotX( -Math.PI/2.0 ); // models are often on their face; fix that
Vector3d scaleVec = calcScaleFactor(loadedBG, fn); // scale the model
t3d.setScale( scaleVec );
TransformGroup tg = new TransformGroup(t3d);
tg.addChild(loadedBG);
sceneBG.addChild(tg); // add (tg->loadedBG) to scene
else
System.out.println("Load error with: " + fn);
catch( IOException ioe )
{ System.err.println("Could not find object file: " + fn); }
} // end of loadModel()
private Vector3d calcScaleFactor(BranchGroup loadedBG, String fn)
// Scale the model based on its original bounding box size
BoundingBox boundbox = new BoundingBox( loadedBG.getBounds() );
// System.out.println(boundbox);
// obtain the upper and lower coordinates of the box
Point3d lower = new Point3d();
boundbox.getLower( lower );
Point3d upper = new Point3d();
boundbox.getUpper( upper );
// store the largest X, Y, or Z dimension and calculate a scale factor
double max = 0.0;
if( (upper.x - lower.x ) > max )
max = (upper.x - lower.x );
if( (upper.y - lower.y ) > max )
max = (upper.y - lower.y );
if( (upper.z - lower.z ) > max )
max = (upper.z - lower.z );
double scaleFactor = 10.0/max; // 10 is half the width of the floor
System.out.println("max dimension: " + df.format(max) +
"; scaleFactor: " + df.format(scaleFactor) );
// limit the scaling so that a big model isn't scaled too much
if( scaleFactor < 0.0005 )
scaleFactor = 0.0005;
return new Vector3d(scaleFactor, scaleFactor, scaleFactor);
} // end of calcScaleFactor()i mean , how to load few objects in one scene. not sence ..sorry .
if u knwo how to load few objects in . please please give me some help .......Thanks so much -
How to port a ABAP report into ITS? Please help!
Hi Experts,
I have a ABAP report that contains a selection screen with 3 select-option elements and a search button. On pressing search button an ALV grid opens with data from a SAP table based on selection screen criteria.
I want to web enable it so that it can be accessed from Enterprise Portal. i will be using IAC iview in Portal.
Now the IAC iview needs my ABAP report to be ported to ITS?
1.How to port it to ITS? What are the steps?
2.In order to port in to ITS do I need to change my ABAP code?
3.Are there any known limitations of porting ABAP reports in ITS? For example Performance, ALV not supported, Table control not supported etc.
4. Does it handle dynamic programming?
5. Are there any documentation for porting report to ITS?
6. How much time effort it will be for porting ABAP reportys to ITS?
To add some more points. SAP transaction iview is not allowed in my organization. Webdynpro/BSP is also not supported. Thats why I am using IAC iview which needs ITS.
Please help
Thanks
Gopal
Message was edited by: gopalkrishna baligahi,
step1.create a transaction for ABAPreport in SE93.
step2.Go to transaction SICF and create a service in the following path sap/bc/gui/sap/its.
Check the following Url to create a service.
/people/durairaj.athavanraja/blog/2005/08/21/running-your-first-its-webgui-application-in-sap-netweaver-04-abap-edition--nsp
step3. create a system object setting the following property categories.
1.Connector
2.Usermanagement
3.ITS
4.WAS
In the usermanagement do the user mapping.
step4. While creating an IAC iview, in the third step for the <b>Internet Application Component (IAC)</b> property give the service name you have created in SICF.
you need not change the abap code. The only limitation while porting abap report in ITS is you cannot view the icons in the tool bar, instead you view the buttons.
ALV is supported. Functionality wise nothing will change except the appearance mainly with the icons.
Regards,
Gopi -
Error when splitting a Table into two columns - Please help!
Hi!
I have created a table in which I have created a header which has been split into 3 parts conisting of 2 columns. These all work fine. However, when I try to split the row below the header row into 2 columns, it does so but, in a way, connects the line inbetween the two columns with the line inbetween the two columns above and will not allow me to move it left or right by manually changing specs or dragging the line. Please help! (I'm using CS5 by the way!) Thank you!I suggest you begin with a pre-built CSS Layout. DW has several to help jump start your projects. Go to File > New Blank Page > HTML. Select a layout from the 3rd panel and hit CREATE. See screenshot.
Save this layout as test.html and begin building your prototype page saving and validating code often during your work sessions.
Code Validation Tools
CSS - http://jigsaw.w3.org/css-validator/
HTML - http://validator.w3.org/
Good luck with your project!
Nancy O. -
How to load falt file masterdata into BCS?
Hi,
I have requirment that i need to load 80 company codes from flat file into BCS masterdata companycode.
I knew how to do it in BW.But i don't know what are all the steps need to taken care while flat file load into BCS.I am new to BCS.
Please some one advise me on thisHi Prasad,
Master data and hierarchy upload, as an example:
How To Upload Hierarchy and Master Data of FS Items in SAP SEM-BCS Starting With 4.0 by Using Flexible Upload Method. -
Loading font file in JWS. Urgent: please help!
Hi everybody,
I have my own font file which I use in the GUI. First I create the font:
myFont = Font.createFont(Font.TRUETYPE_FONT, new FileInputStream("myfont.ttf"));
and then I use it specifying the size:
textbox.setFont(myFont.deriveFont(18f));
This works when I run it from command line, but the above line gives me a nullPointerException from java web start.
I tried to use ClassLoader just like i do it to load images:
ClassLoader cl = this.getClass().getClassLoader();
and do cl.getResource("myfont.ttf").
But the problem is getResource() returns URL, but FileInputStream does not allow it in the constructor.
So I tried:
cl.getResource("myfont.ttf").getPath() and feed that into constructor of FileInputStream but still no luck.
Does anyone have an idea abt what I should do?
Thanks so much,
yulduztry using:
ClassLoader cl = this.getClass().getClassLoader();
myFont = Font.createFont(Font.TRUETYPE_FONT, cl.getResourceAsStream("myFont.ttf:); -
The message 'The application "Preview" can't be opened. -1712' appears on the screen every time I try to open a document (PDF, JPEG & others). Anyone has an answer? Thanks.
Thanks Meg,
I had tried that, but tried it again. No luck...this is so frustrating! Can anyone help? I tried calling Tech Support but I am one month over the "Phone Support" warranty even though I pay monthly for a continued warranty. GRRRR Any ideas?? Thanks!
Kimmons09 -
Load flat file data into ODS in BI
Dear Gurus,
How to load flat file data into ODS?. Please share the article if you have.
advance wishes
Thanks
VenkadeshPlease search the forums before posting :
https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/60debae1-84dd-2b10-e7bf-bdedf1eabdf9
http://wiki.sdn.sap.com/wiki/display/BI/Beginner+Section -
How do i convert a pdf into a word file, i have tried doing save as?
how do i convert a pdf into a word file, i have tried doing save as?
Hi Jack,
What version of Acrobat are you using?
You might need to go to File> Save As Other> Microsoft Word or choose 'Adobe PDF printer' from the File menu.
Is save as option not functioning correctly? Do you get any specific error?
Please let me know.
Regards,
Anubha -
How do i convert a pdf into an xls or csv file
how do i convert a pdf into an xls or csv file ? thnx
HI newapiary
You can either use Adobe Acrobat or Adobe ExportPDF Online Service.
Please Refer : https://www.acrobat.com/exportpdf/en_GB/convert-pdf-to-word.html -
How to store pdf into blob, index it and search it?
I am trying to store pdf into a column, index the column and search it.
I store pdf file into blob column with either the following code or with an interface in apex
declare
Dest_loc BLOB;
Src_loc BFILE := BFILENAME('DIR_TESTCASE', 'intermedia.pdf');
BEGIN
INSERT INTO pdffiles(id, description)
VALUES(1, 'InterMedia Concepts')
RETURN text INTO Dest_loc;
DBMS_LOB.FILEOPEN(Src_loc, DBMS_LOB.LOB_READONLY);
DBMS_LOB.LOADFROMFILE(Dest_loc, Src_loc, dbms_lob.getlength(Src_loc));
DBMS_LOB.FILECLOSE(Src_loc);
COMMIT;
END;
then i need to create an index
begin
ctx_ddl.create_preference('pdf
lexer', 'BASICLEXER');
ctx_ddl.set_attribute('pdf_lexer', 'printjoins', '_-');
end;
create index PDFFILES_TEXT on PDFFILES(TEXT) indextype is ctxsys.context
parameters ('lexer pdf_lexer');
sqlplus says index created but windows gives an error and closes ctxhx.exe
and of cource when I tried to make a search like
select id, description
from pdffiles
where contains(text,'Oracle') > 0;
it doesn't return any results.
My database is 10g XE, I also tried it on Oracle 10.2.0.3 EEIt is possible to store pdf and doc files in a blob column, create a text index, and search them, and display them. However, you cannot expect to just select doc and pdf data directly from a blob column and expect to be able to read it, due to all of the special formatting characters. You need to use ctx_doc.snippet or ctx_doc.markup or some such thing to format it and make it readable. Please see the demonstration below. You can search the online documentation for complete syntax, additional information, and examples.
SCOTT@orcl_11g> CREATE TABLE my_files
2 (id NUMBER,
3 doc BLOB)
4 /
Table created.
SCOTT@orcl_11g> CREATE OR REPLACE DIRECTORY DIR_TESTCASE AS 'c:\oracle11g'
2 /
Directory created.
SCOTT@orcl_11g> declare
2 Dest_loc BLOB;
3 Src_loc BFILE;
4 BEGIN
5 INSERT INTO my_files (id, doc) VALUES (1, EMPTY_BLOB())
6 RETURNING doc INTO Dest_loc;
7 Src_loc := BFILENAME ('DIR_TESTCASE', 'banana.pdf');
8 DBMS_LOB.FILEOPEN (Src_loc, DBMS_LOB.LOB_READONLY);
9 DBMS_LOB.LOADFROMFILE (Dest_loc, Src_loc, dbms_lob.getlength (Src_loc));
10 DBMS_LOB.FILECLOSE (Src_loc);
11 INSERT INTO my_files (id, doc) VALUES (2, EMPTY_BLOB())
12 RETURNING doc INTO Dest_loc;
13 Src_loc := BFILENAME ('DIR_TESTCASE', 'test1.doc');
14 DBMS_LOB.FILEOPEN (Src_loc, DBMS_LOB.LOB_READONLY);
15 DBMS_LOB.LOADFROMFILE (Dest_loc, Src_loc, dbms_lob.getlength (Src_loc));
16 DBMS_LOB.FILECLOSE (Src_loc);
17 END;
18 /
PL/SQL procedure successfully completed.
SCOTT@orcl_11g> INSERT INTO my_files (id, doc)
2 VALUES (3, UTL_RAW.CAST_TO_RAW ('blob data for id 3'))
3 /
1 row created.
SCOTT@orcl_11g> COMMIT
2 /
Commit complete.
SCOTT@orcl_11g> SELECT id, DBMS_LOB.GETLENGTH (doc) FROM my_files
2 /
ID DBMS_LOB.GETLENGTH(DOC)
1 222824
2 19968
3 18
SCOTT@orcl_11g> CREATE INDEX my_files_idx ON my_files(doc)
2 INDEXTYPE IS CTXSYS.CONTEXT
3 /
Index created.
SCOTT@orcl_11g> SELECT COUNT (*) FROM dr$my_files_idx$i
2 /
COUNT(*)
308
SCOTT@orcl_11g> COLUMN first_45 FORMAT A45
SCOTT@orcl_11g> SELECT id,
2 UTL_RAW.CAST_TO_VARCHAR2 (DBMS_LOB.SUBSTR (doc, 18, 1)) AS first_45
3 FROM my_files
4 /
ID FIRST_45
1 %PDF-1.5
%âãÏÓ
1
2 ÐÏࡱá
3 blob data for id 3
SCOTT@orcl_11g> EXEC CTX_DOC.SET_KEY_TYPE ('ROWID')
PL/SQL procedure successfully completed.
SCOTT@orcl_11g> COLUMN keywords_in_context FORMAT A45 WORD_WRAPPED
SCOTT@orcl_11g> SELECT id,
2 CTX_DOC.SNIPPET
3 ('MY_FILES_IDX',
4 ROWID,
5 'contents OR (fruit of the month) OR data',
6 '<<',
7 '>>')
8 AS keywords_in_context
9 FROM my_files
10 WHERE CONTAINS (doc, 'contents OR (fruit of the month) OR data') > 0
11 /
ID KEYWORDS_IN_CONTEXT
1 <<Fruit of the Month>>
Banana
Bananas are the most popular
2 This is the original <<contents>> of
test1.doc.
3 blob <<data>> for id 3
SCOTT@orcl_11g>
Maybe you are looking for
-
While upgrading my iPhone 3GS to iOS 4.2 something went wrong and came up with the message "The iPhone could not be restored. An unknown error occurred [1015]." Now it will not start at all. It just stays on screen with USB and the iTune picture. Wh
-
How large should I make the partition for Windows XP?
I am mainly using it for light gaming, the partition means how much of the hard drive is used for windows and windows-based programs/games it can use, right? What does Windows alone need, and what would you suggest? I have about 100GB total disk spac
-
Which tables created by RCU are used for OBPM 11g and SOA suite?
-
HT1454 Does tv out work with safari browser?
If I connect the iPad via composite av cable will I be able to display the screen of my iPad, as in a "tv out" function, when I am in the safari browser window?
-
Am I doing this correct..
Hi all, I have been experimenting with O/C my system and never got anywhere with it. This is what I have done: Mem to 166 / 133 Men Volts to 2.7 Mem timings to 2-3-2-6-1T HTT to 4x Htt to 230+/- / 250+/- CPU Volt to 1.4, 1.425, 1.45 + 3.3% / +5% fa