SSIS EXPRESSION ISSUE

  • Hi ALL

    I want to insert a value in oracle table with ssis using ssis expression in execute swl task:

    "Insert into batch_job_log (end_tmstp) values"+(DT_STR,4,1252)DATEPART( "yyyy" , @[System::StartTime] ) +

    RIGHT("0" + (DT_STR,4,1252)DATEPART( "mm" , @[System::StartTime] ), 2) +

    RIGHT("0" + (DT_STR,4,1252)DATEPART( "dd" , @[System::StartTime] ), 2) +

    RIGHT("0" + (DT_STR,4,1252)DATEPART( "hh" , @[System::StartTime] ), 2) +

    RIGHT("0" + (DT_STR,4,1252)DATEPART( "mi" , @[System::StartTime] ), 2) +

    RIGHT("0" + (DT_STR,4,1252)DATEPART( "ss" , @[System::StartTime] ), 2)+""

    Somehow the expression is evaluated correctly as:

    Insert into batch_job_log (end_tmstp) values20120109101444

    but when i execute the packarge, i got the error as:

    [Execute SQL Task] Error: Executing the query "Insert into batch_job_log (end_tmstp) values201201..." failed with the following error: "ORA-00926: missing VALUES keyword". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.

    Any advise how to corrct it.

    Thanks

  • Hi

    This is in regard to my last post. I manages to write the expression but i got the new error now like:

    [Execute SQL Task] Error: Executing the query "Insert into batch_job_log (end_tmstp) values ('201..." failed with the following error: "Conversion failed when converting date and/or time from character string.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.

    My EXPRESSION IS:

    "Insert into batch_job_log (end_tmstp) values ('"+(DT_STR,4,1252)DATEPART( "yyyy" , @[System::StartTime] ) +

    RIGHT("0" + (DT_STR,4,1252)DATEPART( "mm" , @[System::StartTime] ), 2) +

    RIGHT("0" + (DT_STR,4,1252)DATEPART( "dd" , @[System::StartTime] ), 2) +

    RIGHT("0" + (DT_STR,4,1252)DATEPART( "hh" , @[System::StartTime] ), 2) +

    RIGHT("0" + (DT_STR,4,1252)DATEPART( "mi" , @[System::StartTime] ), 2) +

    RIGHT("0" + (DT_STR,4,1252)DATEPART( "ss" , @[System::StartTime] ), 2)+"')"

    and its is evaluating as:

    Insert into batch_job_log (end_tmstp) values ('20120109101444')

    I appreciate your suggestions.

    Thanks

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply