Hey all,

Running into a problem with a net.data SQL insert statement.

one of the fields I'm inserting has a hash sign (#) in the data
string, and it's messing with the variables after it in the statement.

here is my insert statement, the data and the resulting resolved SQL statement:

%function(dtw_sql) insertItemTo() {

INSERT
 INTO WWIRT
      (TLOC, FLOC,
       ITEM, ACCT, QTY, UOM, PRICE, EXTPRC,
       DESC, NCUOM,
       FPERIOD, FYEAR,
       TAPPR, FAPPR, TCOMMENT, FCOMMENT)
VALUES ($(store), $(pstore),
       $(titem), 0, $(tqty), '$(pinvum)', $(pinvprc), $(pextprice),
       '@DTW_rQHTMLENCODE(@DTW_rADDQUOTE(pdesc))', ' ',
       $(pper), $(pyear),
       ' ', 'Yes', ' ', '@DTW_rADDQUOTE(comment)')

        %message {100 : " " : continue %}
%}

the data in pdesc = 'DRESSING-COLESLAW-12-3#P'
pper = 2006
pyear = 10.

the insert works otherwise, but bombs on this particular description
because of the # - see the resolved sql statement below (via SHOWSQL).

INSERT INTO WWIRT (TLOC, FLOC, ITEM, ACCT, QTY, UOM, PRICE, EXTPRC,
DESC,
NCUOM,
FPERIOD, FYEAR,
TAPPR, FAPPR, TCOMMENT, FCOMMENT)
VALUES (164, 3, 193577, 0, .16, 'BG', 1.473, .23,
'DRESSING-COLESLAW-12-3',
' '
, , ,
' ', 'Yes', ' ', '')

notice how the description is being truncated at the #, and it's
dropping $pper and $pyear - these numeric fields are causing the error
- Token , was not valid.  (comma with no data).

$(comment) is also being dropped from the insert statement too.

I've tried wrapping the description in @DTW_rURLESCSEQ,
@DTW_rQHTMLENCODE and @DTW_rHTMLENCODE, and several combinations of
them to get it to work, but nothing seems to work

Thanks in advance,

Rick

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.