[Gambas-user] Blob management
David Villalobos Cambronero
david_villalobos_c at ...43...
Fri Jun 26 17:38:00 CEST 2009
Hi, first of all thanks to Benoit, Ron and Wener for help me.
Just to be clear if someone reads this in the future, these statementst are correct:
DIM hResultado AS Result
IF NOT Exist("/tmp/mas") THEN MKDIR "/tmp/mas"
hResultado = $hConn.Exec("SELECT * FROM `Imagenes`")
File.Save("/tmp/mas/1.jpg", hResultado["Imagen"].Data)
The problem is that gambas espect a longblob and my field is mediumblob, if I change the datatype to longblob the statements above work fine.
So, I think this was the problem, BUT, the problem is that the pictures I want to storage are not that big, so I will waste some space, Bonoit, can you (actualy you) change this interpretation of the Gambas database component? to use more optimal datatypes? Maybe for Gambas3?
Regards
--
David
----- Original Message ----
From: Benoît Minisini <gambas at ...1...>
To: mailing list for gambas users <gambas-user at lists.sourceforge.net>
Sent: Friday, June 26, 2009 9:15:43 AM
Subject: Re: [Gambas-user] Blob management
> I do this:
>
> DIM hResultado AS Result
> DIM sImagen AS String
>
> IF NOT Exist("/tmp/mas") THEN MKDIR "/tmp/mas"
> hResultado = $hConn.Exec("SELECT * FROM `Imagenes`")
> sImagen = hResultado["Imagen"].Data <----------------------- Fails here
> "Not an object"
Well, that means that hResultado["Imagen"] returns NULL.
Are you sure that your field is interpreted as a "Blob" by Gambas? I remind
you that MySQL has no blob field type, only string field types.
So Gambas has to make a choice, and only string field types whose maximum
length is greater then 2^24 is a blob.
--
Benoît
------------------------------------------------------------------------------
_______________________________________________
Gambas-user mailing list
Gambas-user at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user
More information about the User
mailing list