Convert from Binary

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Convert from Binary

Mike Williams-2
I have been in the middle of a conversion from a Mysql based solution to a
AS400/iSeries DB2 solution for our ERP solution.

I have been looking for a way to get a BLOB field from my iSeries, then
display it on the web. I was unable to even access the field for the past
couple of months, until this morning when I was able to return to the
project, and download the latest JDBC driver from IBM.

Now I can get to the field by using the following command:

select GDTXKY, cast(GDTXFT as binary(2000)) as BLDTA from PRODDTA.F00165

This returns the BLOB field (GDTXFT) as binary.

Basically the BLOB field is just RTF text, stored in a BLOB field.

Now I have to convert the returned binary field to text, then pull all the
RTF formatting out of it.

Any idea's?

Mike Williams



------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Convert from Binary

Mike Williams-2
Sorry for the confusion, the information is coming out in Hexadecimal.

------
Mike Williams

-----Original Message-----
From: [hidden email] [mailto:[hidden email]]
Sent: Friday, September 29, 2006 7:19 AM
To: [hidden email]
Subject: Convert from Binary
Importance: Low

I have been in the middle of a conversion from a Mysql based solution to a
AS400/iSeries DB2 solution for our ERP solution.

I have been looking for a way to get a BLOB field from my iSeries, then
display it on the web. I was unable to even access the field for the past
couple of months, until this morning when I was able to return to the
project, and download the latest JDBC driver from IBM.

Now I can get to the field by using the following command:

select GDTXKY, cast(GDTXFT as binary(2000)) as BLDTA from PRODDTA.F00165

This returns the BLOB field (GDTXFT) as binary.

Basically the BLOB field is just RTF text, stored in a BLOB field.

Now I have to convert the returned binary field to text, then pull all the
RTF formatting out of it.

Any idea's?

Mike Williams



------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage



------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: ****SPAM**** Re: Convert from Binary

Olivier Miossec
> Sorry for the confusion, the information is coming out in Hexadecimal.
>
> ------
> Mike Williams
>
> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]]
> Sent: Friday, September 29, 2006 7:19 AM
> To: [hidden email]
> Subject: Convert from Binary
> Importance: Low
>
> I have been in the middle of a conversion from a Mysql based solution
> to a AS400/iSeries DB2 solution for our ERP solution.
>
> I have been looking for a way to get a BLOB field from my iSeries, then
> display it on the web. I was unable to even access the field for the
> past couple of months, until this morning when I was able to return to
> the project, and download the latest JDBC driver from IBM.
>
> Now I can get to the field by using the following command:
>
> select GDTXKY, cast(GDTXFT as binary(2000)) as BLDTA from
> PRODDTA.F00165
>
> This returns the BLOB field (GDTXFT) as binary.
>
> Basically the BLOB field is just RTF text, stored in a BLOB field.
>
> Now I have to convert the returned binary field to text, then pull all
> the RTF formatting out of it.
>
> Any idea's?
>
> Mike Williams

you could try something like this.

var: 'hexDocument' = (field: 'BLDTA');
var: 'binDocument' = (Decode_Hex: $hexDocument);

(File_Serve: $binDocument, -File='file.rtf', -Type='application/rtf');


---
Olivier Miossec
AIM/ichat omiossec
--
http://www.lasso-developpeur.net
--
Need a Lasso consultant ?
(Lasso, Java, MySql, Sql Server Consultant ...)
http://www.lasso-developpeur.net/lasso-lab/
--




------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

[OT] Email flood attack

Jim Van Heule-2
Our email server received a pretty vicious flood attack last night  
and I've heard that others may have also been attacked. I was curious  
if anyone else had similar problems last night? Our attack started  
shortly after 12 midnight EST.

--
Jim Van Heule
Heunox Corporation
(616) 844-0066


------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: [OT] Email flood attack

Trevor Jacques
>Our email server received a pretty vicious flood attack last
>night... I was curious if anyone else had similar problems last
>night?

At 00:00:15:35 I received an attempt at a ping flood, but, at
http://www.spamcop.net/spamgraph.shtml?spamstats, all seems 'normal.'
Maybe your server had the bad luck to be one of the ones nuked last
night.

The chances are that my installation of IPNetSentry and ASSP 'nuked'
the spammer's access to my box before the full attempt could be
logged. If you run Mac, I strongly recommend IPNSX combined with
ASSP. Even if there is an attack, it is as though nothing happened.
For example, I've managed to get my firewall filter down to about 1
packet in about 1.25M packets make it to the last item on the filter,
and they are for truly random ports. For example, the last five
packets to make it that far were to these ports: 808, 13500, 1432,
20000, and 1979.

Of the ~7,500 SMTP attempts that make it past the firewall recently,
I've managed to get ASSP to pare those down to ~500 passed mail. In
the passed mail, I get MAYBE one spam in two to three weeks, and that
one is likely to look like real e-mail.

If you'd like copies of my settings for IPNSX and/or ASSP, just holler.  :-)

T.

------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Convert from Binary

Mike Williams-2
In reply to this post by Mike Williams-2


-----Original Message-----
From: [hidden email] [mailto:[hidden email]]
Sent: Friday, September 29, 2006 7:49 AM
To: [hidden email]
Subject: Re: ****SPAM**** Re: Convert from Binary
Importance: Low

> Sorry for the confusion, the information is coming out in Hexadecimal.
>
> ------
> Mike Williams
>
> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]]
> Sent: Friday, September 29, 2006 7:19 AM
> To: [hidden email]
> Subject: Convert from Binary
> Importance: Low
>
> I have been in the middle of a conversion from a Mysql based solution
> to a AS400/iSeries DB2 solution for our ERP solution.
>
> I have been looking for a way to get a BLOB field from my iSeries, then
> display it on the web. I was unable to even access the field for the
> past couple of months, until this morning when I was able to return to
> the project, and download the latest JDBC driver from IBM.
>
> Now I can get to the field by using the following command:
>
> select GDTXKY, cast(GDTXFT as binary(2000)) as BLDTA from
> PRODDTA.F00165
>
> This returns the BLOB field (GDTXFT) as binary.
>
> Basically the BLOB field is just RTF text, stored in a BLOB field.
>
> Now I have to convert the returned binary field to text, then pull all
> the RTF formatting out of it.
>
> Any idea's?
>
> Mike Williams

you could try something like this.

var: 'hexDocument' = (field: 'BLDTA');
var: 'binDocument' = (Decode_Hex: $hexDocument);

(File_Serve: $binDocument, -File='file.rtf', -Type='application/rtf');

---
Olivier Miossec
AIM/ichat omiossec
--
http://www.lasso-developpeur.net



Thanks Olivier, you have always been a good help.

It converted by I still have all the RTF markup in the returned document. I
really need to strip the RTF out so all I get it the text.



Mike Williams





--
Need a Lasso consultant ?
(Lasso, Java, MySql, Sql Server Consultant ...)
http://www.lasso-developpeur.net/lasso-lab/
--




------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage



------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: [OT] Email flood attack

Mike Ealy-2
In reply to this post by Trevor Jacques
>> Our email server received a pretty vicious flood attack last
>> night... I was curious if anyone else had similar problems last
>> night?
>
> At 00:00:15:35 I received an attempt at a ping flood, but, at
> http://www.spamcop.net/spamgraph.shtml?spamstats, all seems 'normal.'
> Maybe your server had the bad luck to be one of the ones nuked last
> night.
>
> The chances are that my installation of IPNetSentry and ASSP 'nuked'
> the spammer's access to my box before the full attempt could be
> logged. If you run Mac, I strongly recommend IPNSX combined with
> ASSP. Even if there is an attack, it is as though nothing happened.
> For example, I've managed to get my firewall filter down to about 1
> packet in about 1.25M packets make it to the last item on the filter,
> and they are for truly random ports. For example, the last five
> packets to make it that far were to these ports: 808, 13500, 1432,
> 20000, and 1979.
>
> Of the ~7,500 SMTP attempts that make it past the firewall recently,
> I've managed to get ASSP to pare those down to ~500 passed mail. In
> the passed mail, I get MAYBE one spam in two to three weeks, and that
> one is likely to look like real e-mail.
>
> If you'd like copies of my settings for IPNSX and/or ASSP, just holler.  :-)

I would appreciate a copy of your settings for IPNSX and ASSP.

Thanks,
Mike Ealy
H&H Publishing
Clearwater, FL


------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: [OT] Email flood attack

Marc Vos-3
In reply to this post by Jim Van Heule-2
Nothing happened at my server.

Regards,
-Marc Vos

* * * * * * * * * * * * * * * * * * * * * * * *
Goodyear Dunlop Tires Germany GmbH
Private:  http://marc.vos.net/
iChat/AIM : mhevos
* * * * * * * * * * * * * * * * * * * * * * * *


On 29-sep-2006, at 14:55, Jim Van Heule wrote:

> Our email server received a pretty vicious flood attack last night  
> and I've heard that others may have also been attacked. I was  
> curious if anyone else had similar problems last night? Our attack  
> started shortly after 12 midnight EST.
>
> --
> Jim Van Heule
> Heunox Corporation
> (616) 844-0066
>
>
> ------------------------------
> Lasso Support: http://support.omnipilot.com/
> Search the list archives: http://www.listsearch.com/lassotalk.lasso
> Manage your list subscription: http://www.listsearch.com/ 
> lassotalk.lasso?manage


------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: [OT] Email flood attack

Jim Van Heule-2
Thanks all.

--
Jim Van Heule
Heunox Corporation
(616) 844-0066


On Sep 29, 2006, at 3:01 PM, Marc Vos wrote:

> Nothing happened at my server.
>
> Regards,
> -Marc Vos
>
> * * * * * * * * * * * * * * * * * * * * * * * *
> Goodyear Dunlop Tires Germany GmbH
> Private:  http://marc.vos.net/
> iChat/AIM : mhevos
> * * * * * * * * * * * * * * * * * * * * * * * *
>
>
> On 29-sep-2006, at 14:55, Jim Van Heule wrote:
>
>> Our email server received a pretty vicious flood attack last night  
>> and I've heard that others may have also been attacked. I was  
>> curious if anyone else had similar problems last night? Our attack  
>> started shortly after 12 midnight EST.
>>
>> --
>> Jim Van Heule
>> Heunox Corporation
>> (616) 844-0066
>>
>>
>> ------------------------------
>> Lasso Support: http://support.omnipilot.com/
>> Search the list archives: http://www.listsearch.com/lassotalk.lasso
>> Manage your list subscription: http://www.listsearch.com/ 
>> lassotalk.lasso?manage
>
>
> ------------------------------
> Lasso Support: http://support.omnipilot.com/
> Search the list archives: http://www.listsearch.com/lassotalk.lasso
> Manage your list subscription: http://www.listsearch.com/ 
> lassotalk.lasso?manage


------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

[OT] Storage Methods

Rick Draper
Hi All,

We are embarking on a project which includes storage of thousands of
documents of varying sizes and formats (.PDF, .DOC, .DXF, .XLS, .PPT,
etc). This will hopefully be a load balanced solution, eventually
operating across several servers with a MySQL cluster.

My question is whether storing documents in a blob field is viable, and
just how the size of the document will translate to size of the
database??  Are there any issues about which I should be concerned? Is
there a best method as far as performance is concerned?

If it is viable to store the documents in the database, what would be
the best approach to code for storing and reconstituting?


Thanks and very best regards,
 
Rick

------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: [OT] Storage Methods

Greg Willits-2
On Sep 29, 2006, at 7:03 PM, Rick Draper wrote:

> We are embarking on a project which includes storage of thousands of
> documents of varying sizes and formats (.PDF, .DOC, .DXF, .XLS, .PPT,
> etc). This will hopefully be a load balanced solution, eventually
> operating across several servers with a MySQL cluster.
>
> My question is whether storing documents in a blob field is viable,  
> and
> just how the size of the document will translate to size of the
> database??  Are there any issues about which I should be concerned? Is
> there a best method as far as performance is concerned?
>
> If it is viable to store the documents in the database, what would be
> the best approach to code for storing and reconstituting?

I came across a lot of posts about this (storing in db vs file  
system) relative to images. Lots of people arguing the merits of both  
methods. One good point that came out (which I think Olivier was the  
one to point out to me), is to separate the document from its meta  
data into two tables. This way all the indexing, searching, and  
results display type stuff comes from a table that has only small  
text fields, and the actual document is retrieved using a simple JOIN  
to a separate table. You don't want searches/indexes being performed  
on a table that includes those huge BLOBs. (You do want to index your  
key field though).

As for size, MBs are MBs, so yeah, the db will get quite large, but  
not really any larger than the file system as there's not really a  
lot of overhead involved.

As for db vs file system -- I honestly think it is a coin toss. It  
really depends on your preference for implementation of backup /  
replication, and other production related issues like that. Bottom  
line is that you're acessing the disk drive to serve them. Oh yeah,  
either way you go, be sure to put the files on a separate hard drive  
from the rest of the application if possible. (That's one reason I  
liked using the file system over the db is that I could spread them  
out over multiple drives easier for better concurrency).

If you search about images in db or file system, you're sure to find  
the debate threads.

-- gw
-----------------------------------------------------------------------
www.araelium.com/aredit/ae_and_lasso :: A new, Lasso-friendly, OS X
specific project manager and code editing developmennt application.
www.pageblocks.org :: A comprehensive application framework for Lasso.
-----------------------------------------------------------------------



------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage