java.sql.SQLException: General error

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ralamo

    #1

    java.sql.SQLException: General error

    INSERT INTO ECN_1 (Old_SbPartNo, Old_PartDesc, Old_ManPartNo,
    Old_Manuf, Old_Vendor, Old_RefDesi, Old_Qty,
    New_SbPartNo, New_PartDesc, New_ManPartNo,N ew_Manuf, New_Vendor,
    New_RefDesi, New_Qty)
    select SB0014.SbPartNo , SB0014.partDesc , SB0014.mANpARTn O,
    SB0014.manufact urer,
    SB0014.vendor, sb0014.refdesi, sb0014.qty,
    SB0014_2.SbPart No, SB0014_2.partDe sc, SB0014_2.mANpAR TnO,
    SB0014_2.manufa cturer, SB0014_2.vendor ,
    sb0014_2.refdes i, sb0014_2.qty
    from SB0014 LEFT OUTER JOIN SB0014_2
    on SB0014.SBPARTNO = SB0014_2.SBPART NO
    where sb0014_2.SbPart No is null
    or sb0014.partDesc <> sb0014_2.partde sc
    or sb0014.manpartn o <> sb0014_2.manpar tno
    or sb0014.manufact urer <> sb0014_2.manufa cturer
    or sb0014.vendor <> sb0014_2.vendor
    or sb0014.refdesi <> sb0014_2.refdes i
    or sb0014.qty <> sb0014_2.qty
    union all
    select null, null, null, null, null, null,null,
    sb0014_2.SbPart No, SB0014_2.partDe sc, SB0014_2.mANpAR TnO,
    SB0014_2.manufa cturer,
    SB0014_2.vendor , sb0014_2.refdes i, sb0014_2.qty
    from sb0014
    right outer join sb0014_2 on sb0014.SbPartNo = sb0014_2.SbPart No
    where sb0014.SbPartNo is null

    It don't thro' error if i don't include last seven lines of the query.
    If i include the part of query, it throws SQLException as below.

    java.sql.SQLExc eption: General error

    What's wrong in the above query? Pls help.

  • John Mishefske

    #2
    Re: java.sql.SQLExc eption: General error

    ralamo wrote:[color=blue]
    > INSERT INTO ECN_1 (Old_SbPartNo, Old_PartDesc, Old_ManPartNo,
    > Old_Manuf, Old_Vendor, Old_RefDesi, Old_Qty,
    > New_SbPartNo, New_PartDesc, New_ManPartNo,N ew_Manuf, New_Vendor,
    > New_RefDesi, New_Qty)
    > select SB0014.SbPartNo , SB0014.partDesc , SB0014.mANpARTn O,
    > SB0014.manufact urer,
    > SB0014.vendor, sb0014.refdesi, sb0014.qty,
    > SB0014_2.SbPart No, SB0014_2.partDe sc, SB0014_2.mANpAR TnO,
    > SB0014_2.manufa cturer, SB0014_2.vendor ,
    > sb0014_2.refdes i, sb0014_2.qty
    > from SB0014 LEFT OUTER JOIN SB0014_2
    > on SB0014.SBPARTNO = SB0014_2.SBPART NO
    > where sb0014_2.SbPart No is null
    > or sb0014.partDesc <> sb0014_2.partde sc
    > or sb0014.manpartn o <> sb0014_2.manpar tno
    > or sb0014.manufact urer <> sb0014_2.manufa cturer
    > or sb0014.vendor <> sb0014_2.vendor
    > or sb0014.refdesi <> sb0014_2.refdes i
    > or sb0014.qty <> sb0014_2.qty
    > union all
    > select null, null, null, null, null, null,null,
    > sb0014_2.SbPart No, SB0014_2.partDe sc, SB0014_2.mANpAR TnO,
    > SB0014_2.manufa cturer,
    > SB0014_2.vendor , sb0014_2.refdes i, sb0014_2.qty
    > from sb0014
    > right outer join sb0014_2 on sb0014.SbPartNo = sb0014_2.SbPart No
    > where sb0014.SbPartNo is null
    >
    > It don't thro' error if i don't include last seven lines of the query.
    > If i include the part of query, it throws SQLException as below.
    >
    > java.sql.SQLExc eption: General error
    >
    > What's wrong in the above query? Pls help.
    >[/color]
    There may be more than one error but the one that jumps out at me is
    that you have two distinct queries here - an INSERT into ECN_1 and a
    SELECT from the sb* tables.

    I assume you are using Jet and the JDBC-ODBC bridge (if not you are in
    the wrong newsgroup. Well, some folks would still say you are in the
    wrong newsgroup...)

    Sun always warns that the JDBC-ODBC code is not production quality which
    means its not fully debugged and has limited functionality. You can
    create simple reliable production apps with it but finding reliable info
    and support is difficult even with Google.

    --
    '---------------
    'John Mishefske
    '---------------

    Comment

    Working...