Skip to Content
author's profile photo Former Member
Former Member

JDBC SENDER

Hi Experts,

We Have this scenario where we are using JDBC SENDER to connect to"SQL SERVER " .The problem is while asking QUERY SQL STATEMENT , its fetching data differently when i used with update QUERY.

_QUERY SQL STATEMENT :_

SELECT C.IDEMBARQUE AS IDEMBARQUE, 'C' AS TIPO_LINEA, C.EFECTIVO,C.TARJETA,C.CHEQUE,C.PAGARE,C.ALMACEN, null AS IDPAYMENT,null AS DCCUST,null AS DCSHIP,null AS DCWHS,null AS TOTAL_AMOUNT,null AS DCCARR,null AS DCSHPD,null AS RES_STATE, null AS RES_AMOUNT,null AS RES_COMMENTS,null AS RES_ALTERNCOM,null AS RES_CHECK,null AS RES_CHECK2,null AS RES_CHECK3,null AS RES_CHKNUM,null AS RES_CHKNUM2, null AS RES_CHKNUM3,null AS RES_IWILLPAY,null AS RES_IWILLPAY2,null AS RES_IWILLPAY3,null AS RES_IWPNUM,null AS RES_IWPNUM2,null AS RES_IWPNUM3,null AS RES_INGRESO, null AS DCORD,null AS RES_IWPDAT,null AS RES_IWPDAT2,null AS RES_IWPDAT3 FROM TMPDOCTOTAL AS C WHERE C.IDEMBARQUE IN (SELECT DISTINCT TOP 30 C1.IDEMBARQUE FROM TMPDOCTOTAL AS C1 INNER JOIN TMPDOCVIA AS L1 ON C1.IDEMBARQUE = L1.DCVIA WHERE C1.TRASPASADO is null) UNION SELECT L.DCVIA AS IDEMBARQUE, 'L' AS TIPO_LINEA, null AS EFECTIVO,null AS TARJETA,null AS CHEQUE,null AS PAGARE,null AS ALMACEN, L.IDPAYMENT,L.DCCUST,L.DCSHIP,L.DCWHS,L.TOTAL_AMOUNT,L.DCCARR,L.DCSHPD,L.RES_STATE, L.RES_AMOUNT,L.RES_COMMENTS,L.RES_ALTERNCOM,L.RES_CHECK,L.RES_CHECK2,L.RES_CHECK3,L.RES_CHKNUM,L.RES_CHKNUM2, L.RES_CHKNUM3,L.RES_IWILLPAY,L.RES_IWILLPAY2,L.RES_IWILLPAY3,L.RES_IWPNUM,L.RES_IWPNUM2,L.RES_IWPNUM3,L.RES_INGRESO, L.DCORD,L.RES_IWPDAT,L.RES_IWPDAT2,L.RES_IWPDAT3 FROM TMPDOCVIA AS L WHERE L.DCVIA IN (SELECT DISTINCT TOP 30 C1.IDEMBARQUE FROM TMPDOCTOTAL AS C1 INNER JOIN TMPDOCVIA AS L1 ON C1.IDEMBARQUE = L1.DCVIA WHERE C1.TRASPASADO is null) ORDER BY C.IDEMBARQUE,TIPO_LINEA.

UPDATE SQL STATEMENT :

UPDATE TMPDOCTOTAL SET TRASPASADO = CONVERT(varchar(8), getDate(), 112) FROM TMPDOCTOTAL WHERE TRASPASADO is null AND IDEMBARQUE IN (SELECT DISTINCT TOP 30 C.IDEMBARQUE FROM TMPDOCTOTAL AS C INNER JOIN TMPDOCVIA AS L ON C.IDEMBARQUE = L.DCVIA WHERE C.TRASPASADO is null)

Thanks In Advance.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Apr 14, 2011 at 10:46 AM

    did u tested ur select query in TOAD and checked the result....

    chirag

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.