Bill, I tried a ddins with M$ SQL Server 2008 R2, and it works...
So our culprit really seems to be the MySQL ODBC driver!
I'll be using my workaround (build a comma-delimited file and LOAD FILE it into
MySQL) until they release the next version which presumably has the bug fixed,
or debug my way into the driver...
Thanks for your time!
/denis
p.s. here's the test....
load 'dd'
cocurrent'jdd'
]ch=: ddcon'dsn=SQLServerDenis'
61902512
load 'debug'
dbr 1
dbg 1
]lh=:'select hnd,id,lat,lon from stop';,.each 1 2;('un';'deux');1234
1235;2345 2345
┌───────────────────────────────┬─┬──────┬────┬────┐
│select hnd,id,lat,lon from stop│1│┌────┐│1234│2345│
│ │2││un ││1235│2345│
│ │ │├────┤│ │ │
│ │ ││deux││ │ │
│ │ │└────┘│ │ │
└───────────────────────────────┴─┴──────┴────┴────┘
dbss 'ddins *:*'
lh ddins ch
-. *./ 2=> #...@$&.>}.x NB. (in debug mode)
0
rc
0
z
┌─┬───────┬───────────────────────────────┬──┐
│0│1964288│select hnd,id,lat,lon from stop│31│
└─┴───────┴───────────────────────────────┴──┘
a
┌─┬───────┬─┬───────────────────────────┬───┬─┬──┬──┬─┬─┐
│0│1964288│1│hnd │128│3│4 │10│0│0│
├─┼───────┼─┼───────────────────────────┼───┼─┼──┼──┼─┼─┤
│0│1964288│2│id │128│2│12│20│0│1│
├─┼───────┼─┼───────────────────────────┼───┼─┼──┼──┼─┼─┤
│0│1964288│3│lat │128│3│4 │10│0│1│
├─┼───────┼─┼───────────────────────────┼───┼─┼──┼──┼─┼─┤
│0│1964288│4│lon │128│3│4 │10│0│1│
└─┴───────┴─┴───────────────────────────┴───┴─┴──┴──┴─┴─┘
ty
4 12 4 4
lns
10 20 10 10
nrows
2
z
┌─┬───────┬─┐
│0│1964288│4│ NB. after z=. sqlbulkoperations sh;SQL_ADD
└─┴───────┴─┘
0 NB. (end debug mode)
]data=: ddfch _1,~ 'select * from stop' ddsel ch
┌─┬────────────────────┬────┬────┬──┐
│1│��/�)� │1234│2345│__│
│2│�)� │1235│2345│__│
└─┴────────────────────┴────┴────┴──┘
$ each data
┌───┬────┬───┬───┬───┐
│2 1│2 20│2 1│2 1│2 1│
└───┴────┴───┴───┴───┘
3!:0 each data
┌─┬─┬─┬─┬─┐
│4│2│4│4│8│
└─┴─┴─┴─┴─┘
3 u: 1 pick data
168 153 47 5 240 41 156 32 32 32 32 32 32 32 32 32 32 32 32 32
240 41 156 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32
2 pick lh NB. (messy conversion!!!)
┌────┐
│un │
├────┤
│deux│
└────┘
=========================================================
> Date: Sat, 19 Jun 2010 08:52:26 +0800
> From: [email protected]
> To: [email protected]
> Subject: Re: [Jprogramming] bulk insert with ODBC (into MySQL db)
>
> Птн, 18 Июн 2010, Denis Samson писал(а):
> > 1- Can you give me a clue why SQLBulkOperations dies, and why without
> >
> > offering any extra info? (with getlasterror)
>
> if call to dll returned without system error, there will be no
> getlasterror. this is the normal behavior. One should use odbc trace
> to debug odbc applications.
>
> >
> >
> > 2- Is there any documentation that sez the insert statement you give to
> > ddins
> > should really be a select statement? or how the data should be
> > presented?
> >
>
> Sorry I forgot, it has been many years. As always google is your
> friend.
>
> > 3- In particulat, how do you handle varchars and chars? as an
> > n-by-maxLength
> > char array?
> > I notice that's what I get from a select of chars or varchars...
>
> As I replied in my first email, I am lazy. It could be doable but I
> don't need it, therefore I choose maxlength for varchar.
>
> >
> > 4- And, oh, BTW, ISI102 is undefined, should prolly be something like
> > 'ISI* wrong
> > number of parameters' (or arguments, or columns)
>
> not sure which ISI102 that you talk about, you might add smoutput to
> trace.
>
> I REALLY want you first test using ms-access or sqlsvr. If that fails,
> I'll take a look if there are bugs in ddins. I don't want to debug
> unixodbc or mysql odbc driver.
>
> --
> regards,
> ====================================================
> GPG key 1024D/4434BAB3 2008-08-24
> gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
_________________________________________________________________
Game on: Challenge friends to great games on Messenger
http://go.microsoft.com/?linkid=9734387
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm