On Fri, Feb 23, 2001 at 04:28:40AM -0800, akif noor wrote:
> 
> i have created a table having blob object but now i am
>  not able to insert a picture into the table. Can you
> send me sql command to insert picture into the table i
> need syntax. i tried through DB2IMAGE but failed to
> insert.
>  
> if there is any other method of putting image in the
> table, kindly send me the same 
> Akif noor

Programmer's Guide::Large Objects::Built in registered functions

                                                                                       
                    Built in registered functions                                      
                                                                        There are two 
built-in registered functions, lo_import and lo_export which       are convenient for 
use in SQL queries. Here is an example of their use                                    
                                                      CREATE TABLE image (             
                                                    name            text,              
                                              raster          oid                      
                                    );                                                 
                                                                                       
                        INSERT INTO image (name, raster)                               
                      VALUES ('bea!
utiful image', lo_import('/etc/motd'));                                                
                                                           SELECT 
lo_export(image.raster, '/tmp/motd') from image                               WHERE 
name = 'beautiful image';                                             

-- 
Eric G. Miller <[EMAIL PROTECTED]>

Reply via email to