Skip to Content
author's profile photo
Former Member

JDBC adapter

Iam working on proxy to jdbc scenario where i have a condition like if field(xxx) is blank,have to send one space else need to send field value.

In this case when conditions is false able to send field value......but when condition fails ...message gettting failed at jdbc adapter level.

I changed the condition to two spaces when condition fails....in this case iam able to successfully processing the message to the jdbc adapter.

Can anyone hepl me why this happing in PI?

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

5 Answers

  • author's profile photo
    Former Member
    Posted on May 05, 2011 at 12:18 PM

    Hi,

    Can you try out populating "" instead of " " ..and check if it works?

    Check out the solution given in the below thread..Similar issue

    Issue with Blank value in mapping ( IDoc to jdbc )

    Regards,

    Manjusha

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on May 05, 2011 at 12:32 PM

    I hope you are using the below logic:

    Source_Field ->
                --> equalS --> Not --> IfWithElse (Source_Field --> Then; Constant (Give one space)) --> Target_Field
    Constant (blank) ->

    This should create one space in the target field

    but when condition fails ...message gettting failed at jdbc adapter level
    in this case iam able to successfully processing the message to the jdbc adapter.

    I am confused what you want to say....do you say that the Database is reporting an error with one space and giving success for two spaces?

    If yes then this is something which the DB admins has to look into....if it is about mapping then the above logic will work.

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on May 05, 2011 at 01:03 PM

    Hai!

    If your field value is not a mandatory field ,then use mapWithDefault function available in the NODE FUNCTION.

    The function of this Node Function is it will retur when the field contain a value otherwiae it will return blank value.

    Try this i think this will help u.

    regard's

    Preethi.

    Add comment
    10|10000 characters needed characters exceeded

  • Posted on May 05, 2011 at 01:06 PM

    refer - Interpretation of Empty String Values in http://help.sap.com/saphelp_nw04/helpdata/EN/64/ce4e886334ec4ea7c2712e11cc567c/frameset.htm

    do the required settings so that your adapter doesnt fail the message

    Add comment
    10|10000 characters needed characters exceeded

  • Posted on May 05, 2011 at 01:32 PM

    Yes, What Shabarish says is correct. I agree.

    You need to decide how to handle the empty value in that column of table either as Null or empty string. In your case, I would recommend to set Interpretation of Empty String values as Empty string not as NULL in the jdbc reciever comm channel. If you set value for that field NULL and pass empty string then jdbc adapter does not insert the value for that column. If that field is mandatory for the table then you cannot insert or update the statement. That's what happening now.

    Add comment
    10|10000 characters needed characters exceeded