IBM Sterling Transformation Extender

Sterling Transformation Extender

Come for answers, stay for best practices. All we're missing is you.


#Sterling
#Supplychain
 View Only
  • 1.  Numeric Data in PUT function

    Posted 11/24/22 06:52 AM
    Hi,

    I am trying to insert data to a table with one column of Numeric data type.

    While i am passing that numeric input data in a PUT function with DB adapter then i am getting error

    "Argument #3 for function PUT is invalid." 

    If i am passing the data as Text then i am getting error while inserting data into DB.

    "Error Code: -2002 - Error Message: Insufficient data passed to output card"

    is there any way to send Numeric data in Text with DB adapter.

    Thanks
    Santanu

    ------------------------------
    Santanu Baral
    ------------------------------

    #IBMSterlingTransformationExtender
    #DataExchange


  • 2.  RE: Numeric Data in PUT function

    Posted 11/24/22 11:02 AM
    Have you tried this conversion function?
    TEXTTONUMBER

    https://www.ibm.com/docs/en/ste/10.1.2?topic=functions-texttonumber

    ------------------------------
    Rex Chan
    ------------------------------



  • 3.  RE: Numeric Data in PUT function

    Posted 11/25/22 07:10 AM
    Yes i have tried with TEXTTONUMBER and TONUMBER and getting "Argument #3 for function PUT is invalid." 

    ------------------------------
    Santanu Baral
    ------------------------------



  • 4.  RE: Numeric Data in PUT function

    Posted 11/25/22 09:36 PM
    Show us your PUT rule.

    ------------------------------
    Rex Chan
    ------------------------------



  • 5.  RE: Numeric Data in PUT function

    Posted 12/06/22 07:47 AM
    PUT ( "DB",
    "-MDQ name.mdq -DBNAME %db2_service% -TB <tablename> -T+",TEXTTONUMBER(In1)),
    FAIL ( "Failed to perform databse operation, Error Code: " + LASTERRORCODE() + " - Error Message: " + LASTERRORMSG() )
    )

    ------------------------------
    Santanu Baral
    ------------------------------



  • 6.  RE: Numeric Data in PUT function

    Posted 12/06/22 10:21 PM

    Try this.  If it doesn't work, there should be a database adapter trace with extension .dbl in the same folder as the map.

    = VALID(GET("DB",

          " -MDQ name.mdq -DBNAME %db2_service% -STMT  ' insert into tablename values (" +In1+") -T+"),

          FAIL("Failed to perform database operation, Error Code: "+LASTERRORCODE()+" – Error Message: "+LASTERRORMSG()))



    ------------------------------
    Rex Chan
    ------------------------------