Bill,
      Oh, I get it... It does makes sense to use a select first in order to get 
the 
column defs, and then do the binds followed by the SQLBulkOperations that 
does the job (w/ SQL_ADD).

    And in fact it almost works, at least goes past the SQLExecDirect...  Then 
fails because for some reason getallcolinfo has returned WideVarChar (_9) as a 
type for my VarChar column (why I don't have a clue yet!). 

    If the select. accepts Wide VarChars as Varchars and fit 'em into (bname) as
a n-by-20 char matrix then it's OK with SQLBindCol. But SQLBulkOperations 
fails with no explanation (just a _1).

     So I make it simpler and insert only one integer column (the other is 
nullable)

   sel=:'select ROUTEDIR from CalgaryBus0.DIRECTION'
   ] lh=:sel;,.4 5 6
┌──────────────────────────────────────────┬─┐
│select ROUTEDIR from CalgaryBus0.DIRECTION│4│
│                                          │5│
│                                          │6│
└──────────────────────────────────────────┴─┘
    lh ddins ch 

Then it just dies at SQLBulkOperations again...

I'd have a couple of questions, I'd hugely appreciate if you could light my 
lantern...


1-  Can you give me a clue why  SQLBulkOperations dies, and why without 

     offering any extra info? (with getlasterror)


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?

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...

4-  And, oh, BTW, ISI102 is undefined, should prolly be something like 'ISI* 
wrong
     number of parameters' (or arguments, or columns)

thanks/ Denis

> Date: Sat, 19 Jun 2010 01:45:34 +0800
> From: [email protected]
> To: [email protected]
> Subject: Re: [Jprogramming] bulk insert with ODBC (into MySQL db)
> 
> sqlbulkoperations needs a cursor for working, however insert statement
> cannot open a cursor. Therefore the sql for ddins is
> 
> select foo,bar from foobar
> 
> please amend your query and test again.
> 
 For information about J forums see http://www.jsoftware.com/forums.htm
                                          
_________________________________________________________________
MSN Dating: Find someone special. Start now.
http://go.microsoft.com/?linkid=9734384
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to