Usage of Blob type.
Does anyone can help me with usage of Blob type? I'm working with C# with Oracle.DataAccess.Lite.dll, and I need to save an image to the database.
Thanks.
Here is a sample from metalink
LiteCommand cmd = new LiteCommand(con);
FileStream file;
byte[] buffer = new byte[256];
long lngOffset = 0;
int chunk;
con.Open();
Debug.Print("Connection Open");
LiteLob imgBlob = new LiteLob(con);
file = new FileStream("c:\\BlobTest\\Sample.jpg", FileMode.Open);
Debug.Print("jpg File Opened");
do {
chunk = file.Read(buffer, 0, 256);
imgBlob.SetBytes(lngOffset, buffer, 0, chunk);
lngOffset += chunk;
} while (chunk != 0);
cmd.CommandText = "INSERT INTO TEST_IMAGE VALUES('Sample.jpg', ?)";
cmd.Parameters.Add(new LiteParameter("image", imgBlob));
cmd.ExecuteNonQuery();
cmd.Parameters.Clear();
con.Commit();
file.Close();
Debug.Print("jpg File Closed");
MessageBox.Show("Blob Successfully Inserted", "Done");
catch (Exception ex) {
Debug.Print(ex.Message);
} finally {
if (con.Connection.State == ConnectionState.Open) {
con.Close();
Debug.Print("Connection Closed");
}
Similar Messages
-
Can i see the column DATA(BLOB type) in PM_OBJECTS of DCM schema
we installed DCM managed clustering .it is Database repository type.
i am trying to see the column DATA(BLOB type) in PM_OBJECTS of DCM schema .
I wrote a program in java to read blob data type and write it into a temporary file.
when i open temporary files all the data in junk format.
can i see the real data of thatcolumn.Is it possible?
first of all for what purpose DCM shema will be used?Hi,
There is no option to show the comments on the diagram.
We plan to add such feature in the next version.
Ivan -
Error while migrating BLOB type data
Hi ,
I am migrating the data from oracle to oracle and both soruce and target tables have BLOB type field.
I am getting error when I am executing the interface with these blob fields. But My interface is successfull if I am not maaping this blob files.
Below is the error message.
ODI-1217: Session BLOB (162501) fails with return code 942.
ODI-1226: Step BLOB fails after 1 attempt(s).
ODI-1240: Flow BLOB fails while performing a Loading operation. This flow loads target table IMAGES.
ODI-1228: Task SrcSet0 (Loading) fails on the target ORACLE connection YAGLD.
Caused By: java.sql.BatchUpdateException: ORA-00942: table or view does not exist
Thanks,
Patel.Duplicate of
Error while migrating BLOB type data -
Download link to file saved in BLOB type in database
Hi all,
I have made a page where i am letting users upload a file in any format, and i'm saving it to database in BLOB datatype field of a table.
The filetype is also saved in a different column of the table.
Now I want to retrieve the contents back in that particular format by converting the data in BLOB type to filetype.
And a link should be provided to download the file.
A little help can be taken from this link which uses EJB session to do the same thing.
[http://jdev1013.blogspot.com.au/2009/08/file-upload-and-download-in-toplink-adf.html]
I want to do the same in ADF 11g JDeveloper using Oracle XE database connection.
Below is the code i used to upload file data - now i want to download file data -
public String uploadFile() {
String amDef = "cabinet.model.AppModule";
String config = "AppModuleLocal";
ApplicationModule am = Configuration.createRootApplicationModule(amDef, config);
ViewObject vo1 = am.findViewObject("XfileView1");
Row row = vo1.createRow();
if (uploadedFile.getFilename() != null){
byte[] array=new byte[(int)uploadedFile.getLength()];
row.setAttribute("FileName", uploadedFile.getFilename());
row.setAttribute("FileContent",createBlobDomain(uploadedFile));
row.setAttribute("FileType", uploadedFile.getContentType());
row.setAttribute("FileSize", uploadedFile.getLength());
vo1.insertRow(row);
am.getTransaction().commit();
DCBindingContainer bindings =
(DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
DCIteratorBinding dcItteratorBindings =
bindings.findIteratorBinding("XfileView1Iterator");
dcItteratorBindings.refresh(1);
Configuration.releaseRootApplicationModule(am, true);
return "added";
private BlobDomain createBlobDomain(UploadedFile file)
// init the internal variables
InputStream in = null;
BlobDomain blobDomain = null;
OutputStream out = null;
try
// Get the input stream representing the data from the client
in = file.getInputStream();
// create the BlobDomain datatype to store the data in the db
blobDomain = new BlobDomain();
// get the outputStream for hte BlobDomain
out = blobDomain.getBinaryOutputStream();
IOUtils.copy(in, out);
catch (IOException e)
e.printStackTrace();
catch (SQLException e)
e.fillInStackTrace();
// return the filled BlobDomain
return blobDomain;
Thanks
Cheena MalhotraCheck my 3 part blog about this. This should cover your needs. http://wp.me/pcBZk-aU
Timo -
How to show BLOB type Column ? In XE
How to show BLOB type Column as image in APEX report area? (In XE)
I did it with the following procedure
create or replace PROCEDURE MY_IMAGE_DISPLAY (p_image_id IN NUMBER)
AS
l_mime VARCHAR2 (255);
l_length NUMBER;
l_file_name VARCHAR2 (2000);
lob_loc BLOB;
BEGIN
SELECT 'JPEG', MLOGO, 'IMAGE', DBMS_LOB.getlength (MLOGO)
INTO l_mime, lob_loc, l_file_name, l_length
FROM CARS_TABLE
WHERE M_ID = p_image_id;
OWA_UTIL.mime_header (NVL (l_mime, 'application/octet'), FALSE);
HTP.p ('Content-length: ' || l_length);
OWA_UTIL.http_header_close;
WPG_DOCLOAD.download_file (lob_loc);
END my_image_display;
GRANT EXECUTE ON my_image_display TO PUBLIC;
and executed the following command
CREATE PUBLIC SYNONYM my_image_display FOR shema_name.my_image_display;
but under XE , I can not see synonym? why?sakrami,
Your question really belongs in the XE forum:
Oracle Database Express Edition (XE)
I think this posting addresses your question:
Re: Handling of pictures changed? Item values not properly updated in Beta
Joel -
Refcursor returning image (BLOB type) from database
Hi,
Process : Invoke activity takes ID as input parameter and passes it to partner link (db adapter) which executes stored proc returning a ref cursor. SQL statement in stored proc - ref cursor has a column with BLOB type.
Problem : Unable to return an image (defiined as BLOB type in database) through refcursor in BPEL.
Error : Unable to convert XSD element Column whose JDBC type is BLOB to a corresponding XML document element.
ORABPEL-11087
XSD :
<complexType name="RowSet">
<sequence>
<element name="Row" minOccurs="0" maxOccurs="unbounded" nillable="true">
<complexType>
<sequence>
<element name="Column" maxOccurs="unbounded" nillable="true">
<complexType>
<simpleContent>
<extension base="string">
<attribute name="name" type="string" use="required"/>
<attribute name="sqltype" type="string" use="required"/>
</extension>
</simpleContent>
</complexType>
</element>
</sequence>
</complexType>
</element>
</sequence>
</complexType>
Need Solution : To get an image (of BLOB type) into BPEL using ref cursor.
Please let me know if you need any more information to get it working.
Thanks and Regards,
RakeshHi Rakesh,
There are some notes you might want to refer :
Note.423909.1 'java.lang.NumberFormatException' Signaled When Using Oracle LOB Family Column Types In ODI Datastores And Integration Interfaces:
Note.423982.1 An "ORA-17410 No More Data to Read From Socket" Error Has Been Signaled From An ODI (Sunopsis) Integration Interface:
Note.423768.1 Using Oracle Large Object (LOB) Datatype Columns In ODI Integration Interfaces:
Note.744101.1 ORA-22835 Message Signaled When Using The OdiSqlUnload Tool In ODI:
Note.424658.1 "ORA-00942" Message With Oracle Large Object (LOB) Datatype Fields In ODI Integration Interfaces:
Note.423992.1 Using Oracle LONG Datatype Columns In ODI(Sunopsis):
Note.424107.1 ODI Integration Interfaces And The Use Of Oracle Spatial Datatypes In Source And Target Datastores:
Hope this helps!
Cheers
Anirudh Pucha -
Checking whether data exists in a BLOB type database column in Forms 6i
I am developing an application regarding inventory of a plant's spare parts. I am storing photo (.bmp) of spares in the database in a column of BLOB type. Once user punches spare's code, form displays spares data on screen using EXECUTE_QUERY. At this stage I want to check whether picture (.bmp) data was found in BLOB type database column or not. I want to take action accordingly. How to check this. If it would be a numeric column, I would have checked NULL but NULL does not work with BLOB type coloumns.
Pl. help.
Thanks in anticipation.Did you look in the database documentation? The DBMS_LOB package has the method you need: getlength().
This was more of a database question than a Forms question, so you'd probably have more luck with these types of questions on one of the other forums, like the database or SQL forums.
Regards,
Robin Zimmermann
Forms Product Management -
How to transfer BLOB type of data from SQL Server to Oracle
Hi,
Actually, I create a table with BLOB type data in SQL server. In fact, there is not exact BLOB type in SQL server, it will be separated to image and ntext types. But there is exact BLOB type in Oracle.
I don't know how to transfer this "BLOB" type into Oracle with DTS or any other methods.
Many Thanks for your any suggestions,
CathyJAVA_GREEN wrote:
No i haven't mixed up.But the file from where i have to retrieve the data is in csv format.Even though i created another csv driver.and tried but i cud not find a solution to load/transfer a set of records from one file(in Excel/csv format) to another file(in mdb format).plz help me.Is there any other methods for this data transfer.A csv file is NOT an excel file.
The fact that Excel can import a csv file doesn't make it an excel file.
If you have a csv file then you must use a csv driver or just use other code (not jdbc) to access it. There is, normally, a ODBC (nothing to do with java) text driver that can do that. -
Blob type parameter in procedure for display issue. Oracle portal bug?
Hi Guy,
I am not sure this is a bug or not for oracle portal.
I have a table that have a column type as blob.
by oracle portal10g, this column should be display as Item Type Upload (Binary) at Item Level Options.
We can create a form to display this file and modify it.
However, It can not to use a procedure with a blob column to create the same form as above. we can not find Item Type as Upload (Binary) in form. if we choose text area.
We will get a error "ORA-01403: no data found (WWV-11230)"
We find this issue during convert clob column to blob type in procedure for a form using.
This is a simple procedure.
See below source codes:
Thanks for any help.
create or replace Procedure test_file
( p_DOCUMENT_ID IN OUT file.DOCUMENT_ID%type,
p_USER_ID out file.USER_ID%type,
p_DOCUMENT_NAME out file.DOCUMENT_NAME%type,
p_DOCUMENT out blob,
p_CREATED_BY out file.CREATED_BY%type,
p_CREATED_TIMESTAMP out file.CREATED_TIMESTAM%type,
p_UPDATED_BY out file.UPDATED_BY%type,
p_UPDATED_TIMESTAMP out file.UPDATED_TIMESTAMP%type,
p_DOCUMENT_DESC out file.DOCUMENT_DESC%type) as
L_DOCUMENT BLOB;
begin
begin
SELECT USER_ID , DOCUMENT_NAME,DOCUMENT, DOCUMENT_MIME, CREATED_BY, CREATED_TIMESTAMP,
UPDATED_BY , UPDATED_TIMESTAMP, DOCUMENT_DESC
INTO p_USER_ID , p_DOCUMENT_NAME,L_DOCUMENT, p_DOCUMENT_MIME, p_CREATED_BY, p_CREATED_TIMESTAMP,
p_UPDATED_BY , p_UPDATED_TIMESTAMP, p_DOCUMENT_DESC
FROM file
WHERE DOCUMENT_ID = p_DOCUMENT_ID;
exception
when NO_DATA_FOUND then
null;
end;
p_DOCUMENT :=L_DOCUMENT;
exception
when others then
null;
end;Hi,
I have created a vo with transient attributes and attached the vo to the am.
But when I am trying to insert the row from my collection, it is giving me '
oracle.jbo.NoDefException: JBO-25058: Definition of resField of type Attribute not found in ResVO
But I have the transient attribute resField in my ResVO and I attached the same to AM also
I am trying to get the VO in my controller like the below:
OAViewObject resvo = (OAViewObject) am.findViewObject("ResVO");
if(vo==null)
resvo = am.createViewObject("ResVO","xxcust.oracle.apps.xxcust.server.ResVO");
if(vo!= null)
resvo.executeQuery();
//Creating and inserting values into the vo
Row row = resvo.createRow();
resvo.insertRow(row);
row.setAttribute("resField", "AB");
row.setAttribute("Value", "CD");
row.setAttribute("Desc", "Test");
When I am running my page, I am getting the
oracle.jbo.NoDefException: JBO-25058: Definition of resField of type Attribute not found in ResVO
I checked the spelling and the attribute name is correct.
Is it the problem with VO having all the transient attributes or am I missing something?
I appreciate your help... -
Blob Type, is necessary any code to exhibit it ?
I did :
Create a table with only one row(one of the columns is a blob type)
drag the table onto a datatable, deploy and run, then i got:
Exception Details: javax.faces.FacesException
org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544329. invalid BLOB ID
Possible Source of Error:
Class Name: com.sun.jsfcl.data.RowSetDataModel
File Name: null
Method Name: create
Line Number: -1
Is necessary any additional code to exhibit a blob type ???
My blob only contains text.
I did the same with a datatable with only char type and it works fine.
Any help will be welcome.
Marlos RodriguesHave a look at this posting
http://swforum.sun.com/jive/thread.jspa?forumID=123&threadID=47550
- Winston -
"Create Application from Database" and BLOB type
Hi all,
I see many threads about BLOB type but my question is related to the Flex Builder built-in feature "Create Application from Database".
Is there a way or a sw version to automatically use MySQL BLOB types when creating a PHP/database application?
Thank you!Hi Dave,
Would you please file a bug with all the necessary details
regarding this issue? The bug base is found at:
http://bugs.adobe.com/jira.
We’ll look into this. Thank you for letting us know!
Lacra -
Image file stored in a blob type ingest to endeca 3.1 via integrator
Hello All
is it possible to ingest Image file stored in a blob type ingest to endeca 3.1 via integrator?
i tried to load an image using type: byte but getting the following error massage:
Unsupported type "byte" in field "PERSONIMAGE"
i know that in demo's there are images as avatars and other images.
any idea how to approach?
thanks
YuvalHi,
We finnally succeeded. Dsegard gave us the right solution. <div>It was the setup of the display that was on error. We use VNC as the display. Now the display is set correctly and the reports shows up fine.
By seting REPORTS_DEFAULT_DISPLAY=NO, It did work for both the server and the local host.
Thank you dsregard.</div> -
Usage of Transaction types in other than asset accounting
Hi,
can someone tell me the usage of transaction types in FI other than Asset accounting.
Thanx,
SowmyaHi,
Transaction types are used in several components in SAP, e.g. in CS
http://help.sap.com/erp2005_ehp_04/helpdata/EN/d7/07542843b911d189ee0000e81ddfac/frameset.htm
Since, it's a more 'what is it?' question, you can esaily find the answer by searching 'Transaction type' on hep.sap.com.
Regards,
Eli -
Hi!
I´m working on form that will works lika a image database.
In my table I store the imagens in a blob type column.
In my form, I use a Image Field to display the imagem from database.
It works.
Now I want to generate a md5 hash for the image file, so I createa function that receive a blob variable
and calculates the md5 hash.
That works too.
The problem is that I want to get the hash at runtime, right after the file is chosen.
So I did this:
wfilename := WEBUTIL_FILE.FILE_OPEN_DIALOG (wdirname, NULL, file_types_variable);
wmd5 := my_functions_package.md5(my_file => :data_block.image_field);
When I try to compile, I get the error: Bad bind variable 'data_block.image_field'
I guess the forms doesn´t see the image_field as a blob even if it is.
Some one know how can I work arround this? To get the image_field as blob (It already is at database).
Forms [32 Bit] Version 9.0.4.0.19 (Production)
Oracle Database 10g Release 10.2.0.3.0 - 64bit Production
Thanks.hi
try something like this.
declare
f varchar2(100);
begin
f := webutil_file.file_open_dialog();
if f is not null then
:block.item := f;
end if;
end;or try the following code.
declare
l_file_name varchar2(383);
begin
l_file_name := webutil_file.file_open_dialog( );
if
l_file_name is not null
then
if
:block.rowid is not null
then
create_record;
end if;
client_image.read_image_file ( l_file_name, substr ( l_file_name, instr ( l_file_name , -1 ) ), 'block.item' );
end if;
end;sarah
Edited by: QGIRCO on Jan 20, 2010 8:51 AM -
Usage of Activity types under Cost Centre.
Hi
I would like to know the usage of activity types under cost centre.
How to do direct and indirect activity type allocation. Please explain indetail from scratch to finish with necessary t.codes at the earliest.
Appreciate your cooperation at the earliest.
regards.Hi,
as far as usage of activity types under cost center is concerned it is addressed by ist reply to your query by another SAP Guru.
with respect to Direct activity allocation,
When we know the source cost center and target cost center then we allocate the activities from source cost center to Target cost center (T.Code KB21N)
The cost is picked from the planned price given at KP26.
Withe respect to Indirect activity allocation:
We do not know the Traget Cost center in this case.
First we need to enter the activity consumption in the sender cost center (source cost center).
Then we need to allocate then indirectly to the target cost centers on some allocation basis using distribution cycles
I am sure this will clear your query.
Please assign points suitably
Best Regards
surya
Maybe you are looking for
-
Why am I being charged to text another iPhone user from my iPhone
I have a pre-paid AT&T phone and am charged per text. Normally it uses iMessage when I text other iPhone users and I am not charged. When my friend that also has some kind of pre-paid, non-standard plan (not AT&T, t-molbie, or verizon) texts me on
-
I have bought a new ipod touch and when i went to sync my music library on to it only a few songs went over, the ones that didnt had a ! next to them. I had no problem when using my last ipod touch but i was using a pc at the time not a mac though.
-
Not able to see the Adapters@Integration Directory!!
Hi, I have created Data types,Messages Types, Message Interface in Integration Repository. I have created a scenario in Directory and assigned Business systems too(I'm doing file to file scenario) and while trying to create Communication channels i'm
-
I lst my ipod id it possible to find it by serial key
i lost my ipod a while back and ive been looking for it its in the house for sure. and the battery is probably dead is there a way to track it with the serial key. i did not get to set up find my iphone with it.
-
HP webOS unable to sign in.
I purchased my HP Tablet yesterday from best buy. Got home, plugged it up to its charger, and began to set it up. I have yet to be able to make it past the HP webOS Account sign in. I keep recieving a "unable to sign you in. Pleas try again in a f