Benoît Minisini a écrit :
>> Benoît Minisini a écrit :
>>>> Hi,
>>>>
>>>> How can I escape a picture in order to insert it into a BYTEA
>>>> postgresql data field?
>>> Normally, if the postgresql field datatype is BYTEA, the gb.db component
>>> will see it as a blob.
>>>
>>> Let's suppose the field name is "Picture". You will do:
>>>
>>> MyResult!Picture = File.Load("/path/to/picture/file")
>>>
>>> Is it what you need?
>> NO, I need the opposite:
>> sqlQry = "SELECT MyTable_ins(MyPicture);
>>
>> where MyTable_ins(TEXT) is a stored PLPGSQL procedure that do
>> an indirect insert into myschema.mytable
>>
> 
> OK. So MyPicture must be a string including quoted binary data?
> 
> Alas there is no public access to the internal driver function that quotes 
> binary data for a blob. Do you want me to add it in Gambas 3? Something like 
> DB.QuoteBlob()?

As far as driver's orders aren't usable*, YES (and in 2 also)

* Can't use a schema (as of Charlie)
* Obliged to directly use the table
-- 
Life is like a bowl of soup with hairs floating on it.  You have to
eat it nevertheless.
                -- Flaubert

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to