PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 05/15/2020 3:09 PM by  Joan Herzfeldt
Lawson Query doesn't like a space.
 4 Replies
Sort:
You are not authorized to post a reply.
Author Messages
Joan Herzfeldt
Private
Private
Veteran Member
(183 points)
Veteran Member
Posts:71


Send Message:

--
05/14/2020 2:13 PM

    I have a very simple Lawson Query to look up a code I'm providing and see if it exists on the PA16 for specific user.  I send the company, employee, and code and it mostly works fine.  Unless there is a space in the code (ie: A SECADM).  The lawson query wants to send the look up request as "A+SECADM" instead of the space.  I've validated the node works without a space. I've validated that the record I'm using DOES have the A SECADM code.  I've tried using %20 and the node comes up with %2520.  Suggestions?

    I can change this to a SQL node and it works, but it's such a simple lookup a Lawson Query Node should work.

    Joan

    Ragu Raghavan
    Private
    Veteran Member
    (1086 points)
    Veteran Member
    Posts:378


    Send Message:

    --
    05/14/2020 2:45 PM
    I tried it on my system, it seems to work. Here is the DME call and extract from the log. You did not say if you were specifying the TYPE (CP for PA16) and the EMP_APP (0 for employee) fields. Maybe that was missing.

    PROD=TEST&FILE=EMPCODES&INDEX=EPCSET1&KEY=100=CP=0=1023=A SECADM&FIELD=DATE-ACQUIRED&OUT=CSV&DELIM=

    Activity started: LwsnQuery8630 (Run Id: 1)
    S3 Query LwsnQuery8630: Executing S3 query: PROD=TEST&FILE=EMPCODES&INDEX=EPCSET1&KEY=100=CP=0=1023=A%20SECADM&FIELD=DATE-ACQUIRED&OUT=CSV&DELIM=, host:

    LwsnQuery8630_errorCode = 0
    LwsnQuery8630_informationCode = 0
    LwsnQuery8630_returnMessage = Query completed.
    LwsnQuery8630_outputData =
    LwsnQuery8630_currentPage = 1
    LwsnQuery8630_complete = true
    LwsnQuery8630_recordCount = 1
    LwsnQuery8630_hasNext = false
    Activity completed: LwsnQuery8630
    LwsnQuery8630_RECORD_COUNT = 1
    S3 Query LwsnQuery8630: Executing loop 1 of 1
    Joan Herzfeldt
    Private
    Private
    Veteran Member
    (183 points)
    Veteran Member
    Posts:71


    Send Message:

    --
    05/14/2020 2:59 PM

    Hi Ragu - Yes I'm using the index.  Your's works because you are hard coding A SECADM, but I need to send a variable. I've used variables in Lawson queries before and don't remember having this issue.  My code looks like:

    PROD=TEST&FILE=EMPCODES&INDEX=EPCSET1&KEY==CP=0==&FIELD=CODE;PA-ASSET-NBR;SEQ-NBR;DATE-RETURNED;DATE-ACQUIRED;RENEW-DATE&SELECT=DATE-RETURNED%3C%3D01/01/1800&OUT=CSV&DELIM=|

    When the code runs it looks like this:

    PROD=TEST&FILE=EMPCODES&INDEX=EPCSET1&KEY=1=CP=0=1000892=A+SECADM&FIELD=CODE;PA-ASSET-NBR;SEQ-NBR;DATE-RETURNED;DATE-ACQUIRED;RENEW-DATE&SELECT=DATE-RETURNED%3C%3D01/01/1800&OUT=CSV&DELIM=|, host: 

    I cant seem to remove the + and I don't know why it's being added when it should be a space.

    Ragu Raghavan
    Private
    Private
    Veteran Member
    (1086 points)
    Veteran Member
    Posts:378


    Send Message:

    --
    05/14/2020 3:13 PM
    Joan, I set the two variables vEmployee and vCode in the START node and tried this:

    PROD=TEST&FILE=EMPCODES&INDEX=EPCSET1&KEY=100=CP=0==&FIELD=DATE-ACQUIRED&OUT=CSV&DELIM=

    Continues to work correctly

    S3 Query LwsnQuery9130: Executing S3 query: PROD=TEST&FILE=EMPCODES&INDEX=EPCSET1&KEY=100=CP=0=1023=A%20SECADM&FIELD=DATE-ACQUIRED&OUT=CSV&DELIM=,

    Maybe you should look at where the value of A SECADM is coming from. Possibly it contains special characters that is being treated as + by the DME routine?
    Joan Herzfeldt
    Private
    Private
    Veteran Member
    (183 points)
    Veteran Member
    Posts:71


    Send Message:

    --
    05/15/2020 3:09 PM

    I fixed it!  guess how.  I recreated the Lawson Query Node and it worked.  I tried everything to get the stupid space to not turn into +.  I wish I remembered sooner that when something weird / illogical is happening, just start from scratch, create new and try it again!  No idea why it does stupid stuff but once in a while it does.  Thanks for your help, knowing that it worked for you started me in the right direction.

    You are not authorized to post a reply.