database/database connector

164 views
Skip to first unread message

Jim Qiu

unread,
Jul 20, 2010, 4:54:23 AM7/20/10
to Bots Open Source EDI Translator
Hi all,

 Is there a standard demo for saving data into database ?

In my seceniro i think i just need to parse my edi file and save them into database in the mapping code with
some sql, so "database connector" should not be my choice, right ?


Best regards,

Jim

henk-jan ebbers

unread,
Jul 20, 2010, 8:01:43 AM7/20/10
to bots...@googlegroups.com
hi Jim,

there is a plugin/demo for this.

works like this:
but the database connection is not made straight from the mapping script.

bots uses an intermediate json file, which is used in the database
connector (which is a channel).

I am not sure if I did the right thing here.
maybe it would be much easier to use a dtabase connector straight for
the mapping script.
let me know if you have ideas about this.

kind regards,
henk-jan

Jim Qiu

unread,
Jul 20, 2010, 9:14:46 AM7/20/10
to bots...@googlegroups.com
Hi henk-jan,

 Do you mean this plugin: demo_databasecommunication_2_0 ?

 yes, I find the json database conector within that demo,  but it seems over-complex for my requirement.

 I think some direct SQL statement within the mapping script should fix my requirement , but since i did not finding  a demo in such way, so i send the mail for others' opinion before I dive into.

I will try my idea tomorrow.

regards,

Jim

2010/7/20 henk-jan ebbers <hjeb...@gmail.com>

henk-jan ebbers

unread,
Jul 20, 2010, 9:25:38 AM7/20/10
to bots...@googlegroups.com
yes, that is the one.

yes, I agree it is too complex.

when I designed this I made some mistakes:
- tried to keep the 'flow' in bots the same (inchannel, mapping,
outchannel). it is moch more intuitive to do this straight from the
mapping script.
- using SQLalchemy. SQLalchemy has a very steep learning curve, in fact
in most cases plain SQL is much easier.

I know Dileep fetches data from a database from within a mapping script

kind regards
henk-jan

Jim Qiu wrote:
> Hi henk-jan,
>
> Do you mean this plugin: demo_databasecommunication_2_0 ?
>
> yes, I find the json database conector within that demo, but it
> seems over-complex for my requirement.
>
> I think some direct SQL statement within the mapping script should
> fix my requirement , but since i did not finding a demo in such way,
> so i send the mail for others' opinion before I dive into.
>
> I will try my idea tomorrow.
>
> regards,
>
> Jim
>

> 2010/7/20 henk-jan ebbers <hjeb...@gmail.com <mailto:hjeb...@gmail.com>>

Sriram

unread,
May 20, 2012, 2:06:15 AM5/20/12
to bots...@googlegroups.com
I need to parse the output of the edi file and save it to database tables. I'm assuming the db channel is meant for this. Where can I find a demo plugin /documents for this scenario? 

-Sriram 

henk-jan ebbers

unread,
May 20, 2012, 8:11:10 AM5/20/12
to bots...@googlegroups.com
there is no plugijn for this right now.
though is is not very hard.
I can assist you if you make a decent plugin for this.

kind regards,
henk-jan

bemeall

unread,
Jul 30, 2012, 9:55:50 AM7/30/12
to bots...@googlegroups.com
Just stumbled uppon Bots. I'm also looking for a solution to parse EDI and put it in a (mysql) database.
Found out that it can do that, but can't find the Database connector plugin anymore. Is it still there, or not anymore?

This page http://code.google.com/p/bots/wiki/ChannelsDatabase says the way of communicating to databases in channels is different now, but can't find out what's this new way. Is there a (basic) example on how to use a database connection in channels so I could try to script my own if there's no plugin available already?

henk-jan ebbers

unread,
Jul 30, 2012, 10:21:35 AM7/30/12
to bots...@googlegroups.com
hi bemeall

(In Dutch: hé, nederlander in de groep!)

the way edi is almost always done is to use an intermediate file:
- for inbound edi: bots translates the edi file the intermediate format (your import format)
- for outbound edi: your application exports the intermediate format, bots translates this to the wished edi format.

there are very good reason to set up edi that way.
one of the reasons is that different edi partners do use different standards (dialects of the standards, different interpretations, different countries, different sectors, edi standards are not that
good).
try to use one import/export format; the differences between partners are handled by the edi software.
another reason to set edi up like this is that it is better to do the import/export is the tools you are familiar with, and not to use a new tool.

I strongly recommend t use an intermediate file format (can be csv, fixed records, xm etc)

I do use the database connector, but I use use it in very specific cases.

kind regards,
henk-jan

henk-jan ebbers

unread,
Jul 30, 2012, 1:51:02 PM7/30/12
to bots...@googlegroups.com
I uploaded the plugin demo_databasecommunication_20120730.zip to the bots sourceforge site (http://bots.sourceforge.net).
The plugin gives a simple demonstration of how to read and write data with a database.
Database is a sqlite database and is provided in the plugin.

hope this helps,

henk-jan



On 07/30/2012 03:55 PM, bemeall wrote:

bemeall

unread,
Jul 31, 2012, 4:03:13 AM7/31/12
to bots...@googlegroups.com
@henk-jan

Dutchie indeed ;-)

Thanks for your explanation and the plugin.
I'm going to check it out.

Roy

henk-jan ebbers

unread,
Jul 31, 2012, 6:32:48 AM7/31/12
to bots...@googlegroups.com
Hi Roy,

I also updated the wiki page about this, see http://code.google.com/p/bots/wiki/ChannelsDatabase

kind regards,
henk-jan

On 07/31/2012 10:03 AM, bemeall wrote:
> @henk-jan
>
> Dutchie indeed ;-)
>
> Thanks for your explanation and the plugin.
> I'm going to check it out.
>
> Roy
>
> On Monday, July 30, 2012 7:51:02 PM UTC+2, eppye wrote:
>
> I uploaded the plugin demo_databasecommunication_20120730.zip to the bots sourceforge site (http://bots.sourceforge.net).
> The plugin gives a simple demonstration of how to read and write data with a database.
> Database is a sqlite database and is provided in the plugin.
>
> hope this helps,
>
> henk-jan
>
>
>
> On 07/30/2012 03:55 PM, bemeall wrote:
> > Just stumbled uppon Bots. I'm also looking for a solution to parse EDI and put it in a (mysql) database.
> > Found out that it can do that, but can't find the Database connector plugin anymore. Is it still there, or not anymore?
> >
> > This page http://code.google.com/p/bots/wiki/ChannelsDatabase <http://code.google.com/p/bots/wiki/ChannelsDatabase> says the way of communicating to databases in channels is different now, but
Reply all
Reply to author
Forward
0 new messages