Hi,
I've used the 'Load a FIle' in the Blob edit popup to update a BLOB content from a file.
It works fine. But I have around 1000 BLOB's tu update from file on my pc.
Does someone has or knows the CODE behind that TOAD 'Load a File' function. I want to do it in a PL/SQL script.
Thanks in advance,
Marc L
Hey Marc,
I turned on Toad's Spooling facility to see what happens when I load a BLOB into the data grid, and it gave me some clues. Here's what got spooled when attempting to load a jpg image into my table:
----------------------------------
-- Session: QUEST_DEV@ORA18CDEV
-- Timestamp: 09:02:44.617
Savepoint LOCK_
----------------------------------
-- Session: QUEST_DEV@ORA18CDEV
-- Timestamp: 09:02:44.617
SELECT "ID" AS "_1", "CONTENT_CLOB" AS "_2", "CONTENT_XML" AS "_3", "CONTENT_JSON" AS "_5" FROM "QUEST_DEV"."TESTLONGTYPES"
WHERE
"ROWID" = :"Old_ROWID"
FOR UPDATE NOWAIT;
:"Old_ROWID"(VARCHAR[18],IN)='AAASabAAMAAAyQ9AAA'
----------------------------------
-- Session: QUEST_DEV@ORA18CDEV
-- Timestamp: 09:02:54.898
update QUEST_DEV.TESTLONGTYPES
set CONTENT_RAW = <Toad actually inlined the binary of the image here>
where rowid = 'AAASabAAMAAAyQ9AAA';
-- Elapsed Time: 0.015 seconds
-- Rows updated: 1
The spooled SQL gave me hope that I can import a file via DML, and therefore, via PL/SQL.
Did a little more research and looks like this is indeed the case.
Here's a link that presents some options for you to consider. I'm sure there are other links that address this topic. Hope this helps.
Thanks for your help Gary.
I'll check out the link...
Regards,
The Automation Designer in Toad has an action called "Single Column Import" which you can use to import your 1000's of BLOBs into a table in the database.
It might be easier than trying to write some code yourself.
-John
Hi John,
Thanks for your feedback. I never used Automation Desgin to Import a column before. How would I set it up?
Open Automation Designer

Find "Single Column Import" in the palette on the right and double-click it to add it to the app in the center.
Double-click Single Column Import action that you just added to the center.
The wizard will guide you through the steps.
If you have a specific question about it, please let me know.
I don't see the palette... How do I display it?
In your Toad version, it's the tabs at the top. Click on the "Import/Export" tab. Your Toad version may not have Single Column Import though. It was added in Toad version 16.3. Judging from your screen shot, I think you have an older version. 