PL/SQL update blob column - oracle

I have a table in Oracle with a blob field and want to UPDATE image in it using some query. I know it can be done by uploading image using interface, but is there some way to update the image using query?
Table1
Id;Image;FileName;FilePath
The image is stored in the Image column.

Use DBMS_LOB package, especially its LOADFROMFILE procedure.
See http://psoug.org/reference/dbms_lob.html, search for "Blob Load Demo".

Related

Insert image into postgres database using queries

I am wondering how to insert an image into a postgres database in column of type bytea, do I have to insert from the path of the PGDATA?
Thanks
One way of doing this is creating a column with bytea datatype and run this query:
insert into table(bytea column) values( bytea('C:\image.jpg'));
This will convert store "C:\image.jpg" into the binary representation, and later image can be retrieved from the folder.
Another efficient way of doing this is to convert the image to base64 string and store that in the database.

Dataset to sqlite data transfer

While development I was in need to create sqlite data base using dataset.
First create empty database file in sqlite. Then using dataset create table and dump data.
Is it possible using some dataset method?
I have done one thing
I have used one query
select * from sqlite_master where type='table'
That will give me schema of sqllite file from where I want to copy data.
On other end I will execute query return by above query.
That will help to create table dynamically.
On by one I used dataadapter to fill data and assigned dataset datatable data and used
Dataadapter. Update method.

How to create table dynamically based on the uploaded csv file column header using oracle apex

Based in the csv file column header it should create table dynamically and also insert records of that csv file into the newly create table.
Ex:
1) If i upload a file TEST.csv with 3 columns, it should create a table dynamically with three
2) Again if i upload a new file called TEST2.csv with 5 columns, it should create a table dynamically with five columns.
Every time it should create a table based on the uploaded csv file header..
how to achieve this in oracle APEX..
Thanks in Advance..
Without creating new tables you can treat the CSVs as tables using a TABLE function you can SELECT from. If you download the packages from the Alexandria Project you will find a function that will do just that inside CSV_UTIL_PKG (clob_to_csv is this function but you will find other goodies in here).
You would just upload the CSV and store in a CLOB column and then you can build reports on it using the CSV_UTIL_PKG code.
If you must create a new table for the upload you could still use this parser. Upload the file and then select just the first row (e.g. SELECT * FROM csv_util_pkg.clob_to_csv(your_clob) WHERE ROWNUM = 1). You could insert this row into an Apex Collection using APEX_COLLECTION.CREATE_COLLECTION_FROM_QUERY to make it easy to then iterate over each column.
You would need to determine the datatype for each column but could just use VARCHAR2 for everything.
But if you are just using generic columns you could just as easily just store one addition column as a name of this collection of records and store all of the uploads in the same table. Just build another table to store the column names.
Simply store this file as BLOB if structure is "dynamic".
You can use XML data type for this use case too but it won't be very different from BLOB column.
There is a SecureFile feature since 11g, It is a new BLOB implementation, it performs better than regular BLOB and it is good for unstructured or semi structured data.

How can one convert an image file stored as a clob into a blob and insert it into a different table?

Using Oracle
How can one convert an image file stored as a clob into a blob and insert it into a different table?
I already have code pulling a blob image out and displaying it on my website but I cannot figure out how to get the clob and convert to blob so I can put it in the new scheme and table I need too.
Oracle provides a build in package called DBMS_LOB that handles most LOB operations, one of the methods in this package is DBMS_LOB.CONVERTTOBLOB
http://docs.oracle.com/cd/B19306_01/appdev.102/b14258/d_lob.htm#i1020355
Please mind that sometimes you'll need to specify the CHARSET.
you can look at the example here:
http://arjudba.blogspot.com/2008/04/convert-clob-to-blob.html
If this wasn't helpful you can always use UTL_RAW

What is needed to insert an image into oracle 10g?

We are planning to develop a simple image viewer using oracle and VB.How do we insert an image into an oracle database table?What is required to insert an image into the oracle table?Please provide the query and explanation.
Oracle Intermedia is Oracle's own solution to storing images in
the database.
See http://www.oracle.com/technetwork/testcontent/intermedia-rel-quickstart-083139.html
and http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14302/ch_intr.htm
You can also store images in
the database independent of Oracle Intermedia
using the BLOB column type, if you prefer to avoid Oracle database extensions.

Resources