Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
cfry813
Starting Member
2 Posts |
Posted - 2007-10-03 : 14:16:45
|
I have created a DDQ to take information from one table and depending on the operation value perform insert, update and delete. The insert and delete work fine but the update does not change my row. Here is the code, and I appreciate any help I can get on this frustrating problem...'**********************************************************************' Visual Basic Transformation Script'************************************************************************' Copy each source column to the destination columnFunction Main() Select Case UCase(Trim(DTSSource("IBMSNAP_OPERATION"))) Case "U" DTSDestination("LX_GTR_ID_CHG_SRC") = DTSSource("LX_GTR_ID_CHG_SRC") DTSDestination("LF_LST_USR_SD10") = DTSSource("LF_LST_USR_SD10") DTSDestination("LC_SEP_DTE_TRT_SRC") = DTSSource("LC_SEP_DTE_TRT_SRC") DTSDestination("LD_ENR_STA_EFF_CAM") = DTSSource("LD_ENR_STA_EFF_CAM") DTSDestination("LD_SCL_CER_STU_STA") = DTSSource("LD_SCL_CER_STU_STA") DTSDestination("IF_HSP") = DTSSource("IF_HSP") DTSDestination("LF_LST_DTS_SD10") = DTSSource("LF_LST_DTS_SD10") DTSDestination("LF_DOE_SCL_ENR_CUR") = DTSSource("LF_DOE_SCL_ENR_CUR") DTSDestination("LD_SCL_SPR") = DTSSource("LD_SCL_SPR") DTSDestination("LC_REA_SCL_SPR") = DTSSource("LC_REA_SCL_SPR") DTSDestination("LC_SCR_SCL_SPR") = DTSSource("LC_SCR_SCL_SPR") DTSDestination("LD_NTF_SCL_SPR") = DTSSource("LD_NTF_SCL_SPR") DTSDestination("LC_STA_STU10") = DTSSource("LC_STA_STU10") DTSDestination("LD_STA_STU10") = DTSSource("LD_STA_STU10") DTSDestination("LN_STU_SPR_SEQ") = DTSSource("LN_STU_SPR_SEQ") DTSDestination("LF_STU_SSN") = DTSSource("LF_STU_SSN") Main = DTSTransformstat_UpdateQuery Case "I" DTSDestination("LX_GTR_ID_CHG_SRC") = DTSSource("LX_GTR_ID_CHG_SRC") DTSDestination("LF_LST_USR_SD10") = DTSSource("LF_LST_USR_SD10") DTSDestination("LC_SEP_DTE_TRT_SRC") = DTSSource("LC_SEP_DTE_TRT_SRC") DTSDestination("LD_ENR_STA_EFF_CAM") = DTSSource("LD_ENR_STA_EFF_CAM") DTSDestination("LD_SCL_CER_STU_STA") = DTSSource("LD_SCL_CER_STU_STA") DTSDestination("IF_HSP") = DTSSource("IF_HSP") DTSDestination("LF_LST_DTS_SD10") = DTSSource("LF_LST_DTS_SD10") DTSDestination("LF_DOE_SCL_ENR_CUR") = DTSSource("LF_DOE_SCL_ENR_CUR") DTSDestination("LD_SCL_SPR") = DTSSource("LD_SCL_SPR") DTSDestination("LC_REA_SCL_SPR") = DTSSource("LC_REA_SCL_SPR") DTSDestination("LC_SCR_SCL_SPR") = DTSSource("LC_SCR_SCL_SPR") DTSDestination("LD_NTF_SCL_SPR") = DTSSource("LD_NTF_SCL_SPR") DTSDestination("LC_STA_STU10") = DTSSource("LC_STA_STU10") DTSDestination("LD_STA_STU10") = DTSSource("LD_STA_STU10") DTSDestination("LN_STU_SPR_SEQ") = DTSSource("LN_STU_SPR_SEQ") DTSDestination("LF_STU_SSN") = DTSSource("LF_STU_SSN") Main = DTSTransformstat_InsertQuery Case "D" DTSDestination("LX_GTR_ID_CHG_SRC") = DTSSource("LX_GTR_ID_CHG_SRC") DTSDestination("LF_LST_USR_SD10") = DTSSource("LF_LST_USR_SD10") DTSDestination("LC_SEP_DTE_TRT_SRC") = DTSSource("LC_SEP_DTE_TRT_SRC") DTSDestination("LD_ENR_STA_EFF_CAM") = DTSSource("LD_ENR_STA_EFF_CAM") DTSDestination("LD_SCL_CER_STU_STA") = DTSSource("LD_SCL_CER_STU_STA") DTSDestination("IF_HSP") = DTSSource("IF_HSP") DTSDestination("LF_LST_DTS_SD10") = DTSSource("LF_LST_DTS_SD10") DTSDestination("LF_DOE_SCL_ENR_CUR") = DTSSource("LF_DOE_SCL_ENR_CUR") DTSDestination("LD_SCL_SPR") = DTSSource("LD_SCL_SPR") DTSDestination("LC_REA_SCL_SPR") = DTSSource("LC_REA_SCL_SPR") DTSDestination("LC_SCR_SCL_SPR") = DTSSource("LC_SCR_SCL_SPR") DTSDestination("LD_NTF_SCL_SPR") = DTSSource("LD_NTF_SCL_SPR") DTSDestination("LC_STA_STU10") = DTSSource("LC_STA_STU10") DTSDestination("LD_STA_STU10") = DTSSource("LD_STA_STU10") DTSDestination("LN_STU_SPR_SEQ") = DTSSource("LN_STU_SPR_SEQ") DTSDestination("LF_STU_SSN") = DTSSource("LF_STU_SSN") Main = DTSTransformstat_DeleteQuery Case Else Main = DTSTransformstat_UserQuery End SelectEnd Function================================================Update Query================================================UPDATE SD10_STU_SPRSET LF_STU_SSN = ?, LN_STU_SPR_SEQ = ?, LD_STA_STU10 = ?, LC_STA_STU10 = ?, LD_NTF_SCL_SPR = ?, LC_SCR_SCL_SPR = ?, LC_REA_SCL_SPR = ?, LD_SCL_SPR = ?, LF_DOE_SCL_ENR_CUR = ?, LF_LST_DTS_SD10 = ?, IF_HSP = ?, LD_SCL_CER_STU_STA = ?, LD_ENR_STA_EFF_CAM = ?, LC_SEP_DTE_TRT_SRC = ?, LF_LST_USR_SD10 = ?, LX_GTR_ID_CHG_SRC = ?where ( lf_stu_ssn = ? and ln_stu_spr_seq = ?) |
|
|
|
|
|
|