Question How To Put Image In A Database? What Data Type It Is?

RealHeavyDude

Well-Known Member
BLOBs have been introduced with OE10. If you are on a realase post OE10.0A you can store them as BLOBs. Have a look at the copy-lob statement.

Code:
COPY-LOB
[ FROM ] { [ OBJECT ] source-lob | FILE source-filename }
[ STARTING AT n ] [ FOR length ]
TO { [ OBJECT ] target-lob [OVERLAY AT n [TRIM ] ] |
FILE target-filename [ APPEND ] }
[ NO-CONVERT | CONVERT convert-phrase ]
[ NO-ERROR ].

There is one thing regarding the physical storage you need to be aware: It is strongly recommended to put those LOBs into their own designated storage area. The record in the table will only hold the pointer to the LOB - the LOB itself is stored separately. Not putting the LOBs into their own designated storage area is a recipe for disaster.

Heavy Regards, RealHeavyDude.
 

Cringer

ProgressTalk.com Moderator
Staff member
Just posting to +100 RHD's post about having them in a different storage area. We have ours in a storage area with data. As they're not reported in DBANALYS etc it's very hard indeed to see how much space they're taking up, making monitoring DB growth particularly tricky. They're also taking up way more space than they should be due to a very bad RPB setting.
We face a lengthy D&L process to get it all sorted.
 

RealHeavyDude

Well-Known Member
Whether one should store images in a database or whether they better should reside somewhere else is subject to debate. As always - it depends. There are compelling reasons not store BLOBS in the databse and there are compelling reasons to do so.

One issue I inherited is a tiny applicatin that was enhanced with the feature to "upload" documents - mostly MS office - to workflow steps. It was only meant to allow the users to securely store very important documents that need to be retained for legal reasons. Nevertheless, since the feature is there, now they upload anything. Now we have one database with a size of roughly 1 TB almost only containing BLOBs. IMHO, a Progress database is not a document management system. Needless to say that manage this database is a PITA. Full Stop.

But, as the documents are stored in a database, they are protected by database access control and covered by the disaster recovery strategy for the database - you wouldn't believe how happy risk management is ...

There is always good reason to avoid something in one scenario and to go for it in another one.

Heavy Regards, RealHeavyDude.
 
Top