May 29, 2014 at 4:53 pm
I having been using passthru queries with no issues. I am having with a passthru query. The string I am trying to pass is 3,064 in length. It is an insert that has about 150 fields. Is there a maximum length that a string odbc will take?
INSERT INTO Tab06 ( GroupID, AssignedAuditors, MoveToWS, Cltstyle, ItmDesc, PdQty, PdItmNetCst, Diff, Comments, InvNbr, InvDt, PoNbr, PoDt, RcvDt, Dateused, DateUsedDt, DlNbr, DlType, D_IND, TimesTurn, Pot
, PrevDed, Due, UnincludedPotential, OutBal, Include, IncludeAsSample, VndNbrAlt, DlVndNbrAlt, Vndname, CONSUMER_UNIT, Nsl_Code, DlAlwTyp, ListPrice, DlItmOIAlw, DlItmOIPct, DlItmNetCst, DlItmBBkAlw, NetNetCost, CreditAmt, CreditInvNbr
, RetroInvnbr, Source, PRO_ID, PPO_ID, DlOrdBegDtLP, DlOrdEndDtLP, DlOrdBegDtOI, DlOrdEndDtOI, DlOrdBegDtRE, DlOrdEndDtRE, PricingPointLP, PricingPointOI, PricingPointRE, WarehouseBuyinStart, WarehouseBuyinEnd, InvQty, RcvQty, InvItmNetCst, RcvItmNetCst, D_DAYS
, D_DAYSIND, Complex, MATCHLINK, STRNBR, TRADER_UNIT, RCVNBR, RCVLINENBR, INVLINENBR, EDI_IND, INVITMDISC, INVTOTDISC, INVVATTOT, INVCOMMENT, PRICEDTYPE, RCVREASON, RCVEXTCOST, RCVVATTOT, VND_STYLE, INVCSPCK, INVSZ
, RCVITMDISC, RCVTOTDISC, LOCTYPE, FORCE_IND, GRCVNBR, BUYER, DEBITNBR, DEBITDT, DEBITCOMMENT, DEBITLINENBR, DEBITVNDRCOST, DEBITCLIENTCOST, DEBITVNDRQTY, DEBITCLIENTQYT, DEBITEXTAMT, DEBITVATTOT, DEBITTYPE, DEBITREASON, DEBITPOSTDT, DebitReversal
, DBCRREVERSAL, BatchYear, BatchPeriod, WeekNbr, DebitNbr_Combined, DBGROUPNOTE_NO, DebitNotInAP, RollupNbr, FactBalancingDetailKey, AuditStatusCode, PreviousAuditStatusCode, IS_Complex, LastAuditor, LastAuditorDate, LastManager, LastManagerDate, LastUpdatedBy, LastUpdatedDate, CreatedDate, Tab05ID
, CutOffComments, PricingComments, Tab02ID, Tab03ID )
SELECT '110300013', 'abenit01', MoveToWS, Cltstyle, ItmDesc, PdQty, PdItmNetCst, Diff, Comments, InvNbr, InvDt, PoNbr, PoDt, RcvDt, Dateused, DateUsedDt, DlNbr, DlType, D_IND, TimesTurn, Pot
, PrevDed, Due, UnincludedPotential, OutBal, Include, IncludeAsSample, VndNbrAlt, DlVndNbrAlt, Vndname, CONSUMER_UNIT, Nsl_Code, DlAlwTyp, ListPrice, DlItmOIAlw, DlItmOIPct, DlItmNetCst, DlItmBBkAlw, NetNetCost, CreditAmt, CreditInvNbr
, RetroInvnbr, Source, PRO_ID, PPO_ID, DlOrdBegDtLP, DlOrdEndDtLP, DlOrdBegDtOI, DlOrdEndDtOI, DlOrdBegDtRE, DlOrdEndDtRE, PricingPointLP, PricingPointOI, PricingPointRE, WarehouseBuyinStart, WarehouseBuyinEnd, InvQty, RcvQty, InvItmNetCst, RcvItmNetCst, D_DAYS
, D_DAYSIND, Complex, MATCHLINK, STRNBR, TRADER_UNIT, RCVNBR, RCVLINENBR, INVLINENBR, EDI_IND, INVITMDISC, INVTOTDISC, INVVATTOT, INVCOMMENT, PRICEDTYPE, RCVREASON, RCVEXTCOST, RCVVATTOT, VND_STYLE, INVCSPCK, INVSZ
, RCVITMDISC, RCVTOTDISC, LOCTYPE, FORCE_IND, GRCVNBR, BUYER, DEBITNBR, DEBITDT, DEBITCOMMENT, DEBITLINENBR, DEBITVNDRCOST, DEBITCLIENTCOST, DEBITVNDRQTY, DEBITCLIENTQYT, DEBITEXTAMT, DEBITVATTOT, DEBITTYPE, DEBITREASON, DEBITPOSTDT, DebitReversal
, DBCRREVERSAL, BatchYear, BatchPeriod, WeekNbr, DebitNbr_Combined, DBGROUPNOTE_NO, DebitNotInAP, RollupNbr, FactBalancingDetailKey, AuditStatusCode, PreviousAuditStatusCode, IS_Complex, LastAuditor, LastAuditorDate, LastManager, LastManagerDate, LastUpdatedBy, LastUpdatedDate, CreatedDate, Tab05ID
, CutOffComments, PricingComments, Tab02ID, Tab03ID FROM SubQryTab05forAppend
May 30, 2014 at 12:23 am
As far as I know, the limit is 64K characters. If it's not enough, you'll need to call a stored procedure with a pass-through query, which should be shorter.
May 30, 2014 at 7:10 am
What is "SubQryTab05forAppend" is that an Access query or SQL view? If it is an Access query, the pass-thru cannot see it.
Can you run just the SELECT portion of the query, does it return records as expected?
May 30, 2014 at 7:40 am
It is a SQL View. I found out what my issue was. It was an ID field that was not set as autoincrement. The table would not accept that ID field to be empty. I made it autoincrement and it solved the issue. The length was not the problem. But for future reference, does anyone know what the max length for a string passed to a passthrough query would be?
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply