Il mercoledì 15 luglio 2009 18:09:51 richard terry ha scritto:
> > By the time I was reading the PosgreSQL  documentation. There it explains
> > a totally different way of handling blobs.
> >
> > They use the internal function pg_lo_import to import into the DB a large
> > object.
> > This returns a pointer OID that is actually written into the db table.
> >
> > I am going to experiments both ways...I will let you know how it goes.
>
> Please do.

Hi Richard...

I made it ! ...it took me few hours but finally I could modify the example to 
work well also with PosgreSQL !

It is left just the 'Delete' function which, not only has to delete the data's 
from the table but also the images from their repository.

I will polish a little bit and then put all on my site for general 
downloading...

Just for your curiosity....only one SQL instruction is used for storing the 
image and the thumb one:

  ResultPictures = databaseConnection.Exec("INSERT INTO pictures (description, 
image, thumb) VALUES ('" & Descr &
                   "', lo_import('" & ImagePath & "'), lo_import('" & tempFile 
& "')  )")

where image and thumb are of type 'oid'

...and for retrieving one per image

 ResultOID = ModuleDatabase.databaseConnection.Exec("SELECT lo_export(" &
                                       Str(oid_im) & ",'" & tempFile & "') ;")

Best regards

Pino

-- 
Key ID: 0xF6768208 
Key fingerprint = B16D 0A7C 5B29 A334 CE6A  71F6 EAF8 3D88 F676 8208
Key server: hkp://wwwkeys.eu.pgp.net

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to