Serializing to a SQL string

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Serializing to a SQL string

Daniel Rozzeta
Hi all,
I need to serialize some objects to a SQL string column.
As I understand it, the STBOutFiler would legally include in its
output a 0 asCharacter (or null-character) which will cause trouble.
Which do you think will be the simpler solution?  Does anyone have an
UUE encoder-decoder?

Thanks


Reply | Threaded
Open this post in threaded view
|

Re: Serializing to a SQL string

Bill Schwab-2
Daniel,

> I need to serialize some objects to a SQL string column.
> As I understand it, the STBOutFiler would legally include in its
> output a 0 asCharacter (or null-character) which will cause trouble.
> Which do you think will be the simpler solution?  Does anyone have an
> UUE encoder-decoder?

Which DBMS?  What about memo aka "BLOB" fields?  I just did something very
similar with MySQL; all it takes some escape sequences to make the SQL
legal.

Have a good one,

Bill

--
Wilhelm K. Schwab, Ph.D.
[hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: Serializing to a SQL string

Chris Uppal-3
In reply to this post by Daniel Rozzeta
Daniel Rozzeta wrote:

>  Does anyone have an UUE encoder-decoder?

There's a Base64 implementation (similar concept to UUE but cleaner and
probably more widely used on the Net these days) by Steve Wart,
http://www.serf.org/steve/Dolphin/.  I think it's also available on Steve
Waring's www.dolphinharbor.org but I don't know if Steve Waring has enhanced it
at all.

    -- chris


Reply | Threaded
Open this post in threaded view
|

Re: Serializing to a SQL string

Don Rylander-3
In reply to this post by Daniel Rozzeta
Daniel
"Daniel Rozzeta" <[hidden email]> wrote in message
news:[hidden email]...
> Hi all,
> I need to serialize some objects to a SQL string column.
> As I understand it, the STBOutFiler would legally include in its
> output a 0 asCharacter (or null-character) which will cause trouble.
> Which do you think will be the simpler solution?  Does anyone have an
> UUE encoder-decoder?
Depending on how big the objects are, you could use something like
ByteArray>>printHexOn: and ByteArray(class)>>fromHexString:.  It doubles the
size of your objects, but in a lot of cases that doesn't really matter.

Don

>
> Thanks


Reply | Threaded
Open this post in threaded view
|

Re: Serializing to a SQL string

Don Rylander-3
Oops.  I bet ByteArray>>printHexString is more direct than #printHexOn: for
what you want.

Don


Reply | Threaded
Open this post in threaded view
|

Re: Serializing to a SQL string

Daniel Rozzeta
In reply to this post by Bill Schwab-2
"Bill Schwab" <[hidden email]> wrote in message news:<b8ttsl$da6fn$[hidden email]>...

> Daniel,
>
> > I need to serialize some objects to a SQL string column.
> > As I understand it, the STBOutFiler would legally include in its
> > output a 0 asCharacter (or null-character) which will cause trouble.
> > Which do you think will be the simpler solution?  Does anyone have an
> > UUE encoder-decoder?
>
> Which DBMS?  What about memo aka "BLOB" fields?  I just did something very
> similar with MySQL; all it takes some escape sequences to make the SQL
> legal.

I don't own the database model, thus can't change the string column for a BLOB one.

Thanks anyway,
Dan


Reply | Threaded
Open this post in threaded view
|

Re: Serializing to a SQL string

Daniel Rozzeta
In reply to this post by Chris Uppal-3
"Chris Uppal" <[hidden email]> wrote in message news:<3eb282f5$0$45178$[hidden email]>...
> Daniel Rozzeta wrote:
>
> >  Does anyone have an UUE encoder-decoder?
>
> There's a Base64 implementation (similar concept to UUE but cleaner and
> probably more widely used on the Net these days) by Steve Wart,
> http://www.serf.org/steve/Dolphin/.

I found it here, thanks


> I think it's also available on Steve
> Waring's www.dolphinharbor.org but I don't know if Steve Waring has
> enhanced it at all.

I couldn't find any reference on this site.

I will try Base64, thank you very much

Dan


Reply | Threaded
Open this post in threaded view
|

Re: Serializing to a SQL string

Steve Alan Waring
Hi Dan and Chris,

>> I think it's also available on Steve
>> Waring's www.dolphinharbor.org but I don't know if Steve Waring has
>> enhanced it at all.

No, I use Steve Wart's original package.

> I couldn't find any reference on this site.

It is referenced here:

   http://www.dolphinharbor.org/dh/projects/spray/thanks.html

Steve
--
Steve Waring
Email: [hidden email]
Journal: http://www.stevewaring.net/blog/home/index.html