BLOB in SQL statement

BLOB in SQL statement

Postby fraxzi » Thu Feb 25, 2010 1:15 am

Hello All,

Im Using Ads 8.1 How can I save BLOB (image) via SQL script/command?

I tried:

AdsPrepareSQL()

AdsSetBinary()

AdsExecuteSQL()

But "Error: Unresolved external.." on ADSSETBINARY()


Any help?


Regards,
FAP
Kind Regards,
Frances

Fivewin for xHarbour v18.07
xHarbour v1.2.3.x
BCC 7.3 + PellesC8 ( Resource Compiler only)
ADS 10.1 / MariaDB
Crystal Reports 8.5/9.23 DE
xMate v1.15
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines

Re: BLOB in SQL statement

Postby nageswaragunupudi » Thu Feb 25, 2010 10:26 am

This is not direct answer to your question.
But i we want to store images in ADT table, we can easily store then and retrieve them in IMAGE type column. We can store and retrieve image data just like a memo field.

Please see \fwh\samples\xbradt.prg. The images stored can be browsed inline and also printed by report method of xbrowse

Here is a screen shot from xbradt.prg:
Image

When it is so simple to handle images, why should be bothered to adopt more complex blob methods?
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10627
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: BLOB in SQL statement

Postby fraxzi » Fri Feb 26, 2010 12:40 am

Dear RAO,

My simple method is this function to put image (blob) into the table (ADT/FoxPro)...

Code: Select all  Expand view

lSaved := BLOB->( AdsFile2Blob(cImgFile, 'PICTURE', ADS_IMAGE) )  
 


works all the time.

But I have this SQL string/command which I need to include the blob fields to insert the image.

btw,
the connection is via internet.


I wish to discuss the subject further.

My best regards,
FAP
Kind Regards,
Frances

Fivewin for xHarbour v18.07
xHarbour v1.2.3.x
BCC 7.3 + PellesC8 ( Resource Compiler only)
ADS 10.1 / MariaDB
Crystal Reports 8.5/9.23 DE
xMate v1.15
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines

Re: BLOB in SQL statement

Postby nageswaragunupudi » Fri Feb 26, 2010 3:15 am

The simplest thing I do ( ADT, ADS_CDX and DBFCDX ) is this:

ALIAS->FIELDNAME := MemoRead( <imagefile> )
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10627
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: BLOB in SQL statement

Postby fraxzi » Fri Feb 26, 2010 3:49 am

Thanks RAO for the advise. :)


Regrads,
FAP
Kind Regards,
Frances

Fivewin for xHarbour v18.07
xHarbour v1.2.3.x
BCC 7.3 + PellesC8 ( Resource Compiler only)
ADS 10.1 / MariaDB
Crystal Reports 8.5/9.23 DE
xMate v1.15
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 90 guests