Click here to Skip to main content
15,867,989 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

I'm really green. I want to extract images (JPGs) from Oracle PDB. Table Looks something like this:

select * from BOB.USER_ID t

    LINK_ID     ID_SCAN
1  340101001    <BLOB>...
2  340101002    <BLOB>...
3  340101003    <BLOB>...
4  340101004    <BLOB>...
5  ...


If possible, I want to extract them, with LINK_ID names (340101001.jpg).

I can extract them one-by-one, but there are ~5000 images... I would love to do it with some command or something...

Thank you and sorry for inconvenience.

What I have tried:

I've looked for solution, but things that I could understand a little, they didn't work.
Posted
Updated 12-Sep-19 1:39am
v3

The easiest way to do what you want is going to be to write a programming script to do this, and utilize that line of SQL to get the data you want.
The basic structure of the program is going to be something like this- you will just need to choose the language and place the language appropriate commands in
Define connection to database (conn)
Define database command (cmd) "SELECT LINK_ID, ID_SCAN FROM BOB.USER_ID"
Set (cmd) to use (conn)
Open (conn)
	Execute (cmd) to read the record-set (rs)
		Begin For-Next loop to go through rows of (rs)
			Declare a string variable (LinkID) and define from (rs)["LINK_ID"]
			Declare a byte array variable (IdScan) and define from (rs)["ID_SCAN"]

			Create a new file
				define file name based on (LinkID)
				define file content from (IdScan)
			Save the file to your file system
		Next Record
	Close (rs)
Close (conn)
Cleanup
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900