# Update BLOB from a file

**URL:** <https://forums.toadworld.com/t/update-blob-from-a-file/60067>\
**Category:** Toad for Oracle & DevOps Toolkit\
**Created:** [October 11, 2024, 2:54pm UTC](https://forums.toadworld.com/t/update-blob-from-a-file/60067 "2024-10-11T14:54:13Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![lafontaine.m1](https://avatars.discourse-cdn.com/v4/letter/l/977dab/32.png) [@lafontaine.m1](https://forums.toadworld.com/u/lafontaine.m1)\
**Post date:** [October 11, 2024, 2:54pm UTC](https://forums.toadworld.com/t/update-blob-from-a-file/60067/1 "2024-10-11T14:54:13Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Gary.Jerep](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/gary.jerep/32/205_2.png) [@Gary.Jerep](https://forums.toadworld.com/u/Gary.Jerep)\
**Post date:** [October 11, 2024, 4:20pm UTC](https://forums.toadworld.com/t/update-blob-from-a-file/60067/2 "2024-10-11T16:20:02Z")

</div>

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:

```auto
----------------------------------
-- 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.

> **[Import BLOB](https://oracle-base.com/articles/8i/import-blob)**
>
> A simple method for importing the contents of a file into a BLOB datatype.

---

<div class="post-metadata">

**Author:** ![lafontaine.m1](https://avatars.discourse-cdn.com/v4/letter/l/977dab/32.png) [@lafontaine.m1](https://forums.toadworld.com/u/lafontaine.m1)\
**Post date:** [October 11, 2024, 5:22pm UTC](https://forums.toadworld.com/t/update-blob-from-a-file/60067/3 "2024-10-11T17:22:37Z")

</div>

Thanks for your help Gary.

I'll check out the link...

Regards,

---

<div class="post-metadata">

**Author:** ![JohnDorlon](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/johndorlon/32/9997_2.png) [@JohnDorlon](https://forums.toadworld.com/u/JohnDorlon)\
**Post date:** [October 11, 2024, 9:00pm UTC](https://forums.toadworld.com/t/update-blob-from-a-file/60067/4 "2024-10-11T21:00:15Z")

</div>

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.

 ![image](https://global.discourse-cdn.com/quest/original/3X/b/d/bdab0a43f2575e0f6c699c6a24c92937ca880dbd.png)

-John

---

<div class="post-metadata">

**Author:** ![lafontaine.m1](https://avatars.discourse-cdn.com/v4/letter/l/977dab/32.png) [@lafontaine.m1](https://forums.toadworld.com/u/lafontaine.m1)\
**Post date:** [October 15, 2024, 12:20pm UTC](https://forums.toadworld.com/t/update-blob-from-a-file/60067/5 "2024-10-15T12:20:52Z")

</div>

Hi John,

Thanks for your feedback. I never used Automation Desgin to Import a column before. How would I set it up?

---

<div class="post-metadata">

**Author:** ![JohnDorlon](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/johndorlon/32/9997_2.png) [@JohnDorlon](https://forums.toadworld.com/u/JohnDorlon)\
**Post date:** [October 15, 2024, 3:14pm UTC](https://forums.toadworld.com/t/update-blob-from-a-file/60067/6 "2024-10-15T15:14:51Z")

</div>

Open Automation Designer

![image](https://global.discourse-cdn.com/quest/original/3X/7/0/700b6920fbfd8c41fa3340cb42d5dca3ce39a49b.png)

Find "Single Column Import" in the palette on the right and double-click it to add it to the app in the center.

 ![image](https://global.discourse-cdn.com/quest/original/3X/2/c/2c64250f5db6d4937870fd04eda0a56268ae6c8a.png)

Double-click Single Column Import action that you just added to the center.

 ![image](https://global.discourse-cdn.com/quest/original/3X/8/7/8758a0e53396f7ad7672d92f4e3a9e2652da67a1.png)

The wizard will guide you through the steps.

If you have a specific question about it, please let me know.

---

<div class="post-metadata">

**Author:** ![lafontaine.m1](https://avatars.discourse-cdn.com/v4/letter/l/977dab/32.png) [@lafontaine.m1](https://forums.toadworld.com/u/lafontaine.m1)\
**Post date:** [October 15, 2024, 3:31pm UTC](https://forums.toadworld.com/t/update-blob-from-a-file/60067/7 "2024-10-15T15:31:10Z")

</div>

I don't see the palette... How do I display it?

 ![](https://global.discourse-cdn.com/quest/original/3X/c/f/cf8543854a1858d156be43c2dec892e4c3ae210d.png)

---

<div class="post-metadata">

**Author:** ![JohnDorlon](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/johndorlon/32/9997_2.png) [@JohnDorlon](https://forums.toadworld.com/u/JohnDorlon)\
**Post date:** [October 15, 2024, 3:53pm UTC](https://forums.toadworld.com/t/update-blob-from-a-file/60067/8 "2024-10-15T15:53:22Z")

</div>

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. ☹
