Sunteți pe pagina 1din 17

!----------------------------------------------------------------------! ! Report Name: CURRND.SQC -- Currency Rounding Common Module ! !----------------------------------------------------------------------! ! Confidentiality Information: ! ! ! !

This module is the confidential and proprietary information of ! ! PeopleSoft, Inc.; it is not to be copied, reproduced, or transmitted ! ! in any form, by any means, in whole or in part, nor is it to be used ! ! for any purpose other than that for which it is expressly provided ! ! without the written permission of PeopleSoft. ! ! ! ! Copyright (c) 1988-1998 PeopleSoft, Inc. All Rights Reserved ! !----------------------------------------------------------------------! !----------------------------------------------------------------------! ! Variable Definitions ! Descr: ! !----------------------------------------------------------------------! #define WhereClause 'V' #define ProcInstance 'P' #define TRUE 'Y' #define FALSE 'N' #define ACTIVE 'A' #define NULL '' !----------------------------------------------------------------------! ! Procedure: Init-Round-Fields ! ! Descr: This procedure is called directly from other SQRs. ! ! It initializes all areas where data will be passed from ! ! the calling SQR to the Round-Currency routine. ! !----------------------------------------------------------------------! begin-PROCEDURE Init-Round-Fields #debugh display 'Entering Init-Round-Fields' move ' ' to $cur_recname move ' ' to $cur_rqst_opt move ' ' to $cur_where_clause move '' to $cur_effdt let #cur_prcs_instance = 0 if $Currnd_Init_Done = '' ! First time init called create-array name=CurRndFlds Size=200 field=cur_fieldname:char let $Currnd_Init_Done = 'Y' else clear-array name=CurRndFlds end-if let #Cur_Rnd_Idx = 0 #debugh display 'Leaving Init-Round-Fields' end-procedure

!----------------------------------------------------------------------! ! Procedure: Round-Currency !

! Descr: !

This main loop is called from other SQRs and calls

! other procdueres in the SQC ! !----------------------------------------------------------------------! begin-PROCEDURE Round-Currency #debugh display 'V2 - Entering Round-Currency' #debugh display $cur_recname #debugh display $cur_rqst_opt #debugh display $cur_where_clause #debugh display $cur_effdt do Get-Multicurrency-Flag if &multicurrency = 'Y' do Validate-Input do Uppercase-Recname do Build-Where-Clause do Determine-Round-Type #debugx SHOW $AsOfToday ' ' $AsOfNow '*** Starting Loop-Thru-Subrecords' do Loop-Thru-Subrecords #debugx SHOW $AsOfToday ' ' $AsOfNow '*** Starting Loop-Thru-Fields' do Loop-Thru-Fields #debugx SHOW $AsOfToday ' ' $AsOfNow '*** Finishing Loop-Thur-Fields' end-if #debugh display 'Leaving Round-Currency' end-PROCEDURE !----------------------------------------------------------------------! ! Procedure: Get-Multicurrency-Flag ! ! Descr: Only proceed to round currency if the database ! ! MultiCurrency flag is set to 'Y' ! !----------------------------------------------------------------------! begin-procedure Get-Multicurrency-Flag #debugh display 'Entering Get-Multicurrency-Flag' begin-Select MULTICURRENCY from PSOPTIONS end-Select #debugh display 'Leaving Get-Multicurrency-Flag' end-procedure !----------------------------------------------------------------------! ! Procedure: Validate-Input ! ! Descr: This procedure validates that the calling SQR has passed ! ! valid values into the variables used by this SQC. ! !----------------------------------------------------------------------! begin-procedure Validate-Input #debugh display 'Entering Validate-Input' ! Option must be either P or V &multicurrency

! If option is P there must be value for Process Instance ! If option is V there must be value for Where clause evaluate $cur_rqst_opt when = {ProcInstance} if #cur_prcs_instance = 0 display 'You must pass a Process Instance in #cur_prcs_instance' stop end-if when = {WhereClause} if $cur_where_clause = {Null} display 'You must pass a where clause in $cur_where_clause' stop end-if break when-other display 'Currency Round Request Option must be P or V - Terminating' stop end-evaluate #debugh display ' finished evaluate'

! Recname must be valid record name let $recname_found = {False} Begin-Select RECNAME let $recname_found = {True} from PSRECDEFN where RECNAME = $cur_recname End-Select if $recname_found = {False} display 'Recname passed to rounding routine is not valid' NOLINE display $cur_recname stop end-if ! There must be an effective date if $cur_effdt = {False} display 'You must pass an effective date to the Rounding routine' stop end-if #debugh display 'Leaving Validate-Input' end-procedure !----------------------------------------------------------------------! ! Procedure: Uppercase-Recname ! ! Descr: Recname must be uppercase for dynamic SQL later ! !----------------------------------------------------------------------! begin-procedure Uppercase-Recname uppercase $cur_recname

#debugh display 'Leaving Uppercase-Recname' end-procedure !----------------------------------------------------------------------! ! Procedure: Build-Where-Clause ! ! Descr: This procedure builds a where clause based on user call ! !----------------------------------------------------------------------! begin-procedure Build-Where-Clause #debugh display 'Entering Build-Where-Clause' ! create where clause to be added into SQL as needed. ! if user specifies where clause in call leave as is. Otherwise ! build one using process instance. if $cur_rqst_opt = 'P' move #cur_prcs_instance to $cur_prcs_inst let $cur_where_clause = 'process_instance = ' $cur_prcs_inst end-if #debugh display 'Leaving Build-Where-Clause' end-procedure !----------------------------------------------------------------------! ! Procedure: Determine-Round-Type ! ! Descr: Based on the database figure out round algorithim to use ! !----------------------------------------------------------------------! begin-procedure Determine-Round-Type #debugh display 'Entering Determine-Round-Type' move ' ' to $round-type #ifdef SQLBase move 'Round-Type-1' to $round-type #end-if #ifdef DB2 move 'Round-Type-2' to $round-type #end-if #ifdef DB2UNIX move 'Round-Type-2' to $round-type #end-if #ifdef DB2400 move 'Round-Type-2' to $round-type #end-if #ifdef SYBASE move 'Round-Type-2' to $round-type #end-if #ifdef MICROSOFT

move 'Round-Type-3' to $round-type #end-if #ifdef ORACLE move 'Round-Type-3' to $round-type #end-if #ifdef INFORMIX move 'Round-Type-3' to $round-type #end-if if $round-type = ' ' display 'Database Currency Rounding Type not defined in Currency Rounding routi ne' stop end-if

#debugh display 'Leaving Determine-Round-Type' end-procedure !----------------------------------------------------------------------! ! Procedure: Loop-Thru-Fields ! ! Descr: This procedure starts the process of rounding each field ! ! specified in the user-passed array ! !----------------------------------------------------------------------! begin-procedure Loop-Thru-Fields #debugh display 'Entering Loop-Thru-Fields' !Loop through the array and process each field let #Cur_Rnd_Idx = 0 let $rec_found = {TRUE} while $rec_found = {TRUE} add 1 to #Cur_Rnd_Idx move {FALSE} to $defn_row_found get $cur_fieldname from CurRndFlds (#Cur_Rnd_Idx) cur_fieldname #debugh display '281 - ' NOLINE #debugh display $AsOfToday NOLINE #debugh display ' ' NOLINE #debugh display $AsOfNow NOLINE #debugh display ' record:' NOLINE #debugh display $cur_recname #debugh display 'field:' NOLINE #debugh display $cur_fieldname #debugh display ' Processing Field ' $cur_fieldname if $cur_fieldname = {NULL} !done with array let $rec_found = {FALSE} else do Get-Field-Defn-Info if $defn_row_found ={FALSE} #debugh display 'Field or RecField definition not found for'

#debugh

show 'Record (' $Cur_recname

') Field (' $Cur_fieldname ')'

end-if do Select-Currency-Info end-if end-while #debugh display 'Leaving Loop-Thru-Fields' end-procedure !----------------------------------------------------------------------! ! Procedure: Loop-Thru-Subrecords ! ! Descr: Get all the subrecords which are a part of the record ! ! which we are considering. ! !----------------------------------------------------------------------! begin-procedure Loop-Thru-Subrecords #debugh display 'Entering Loop-Thru-Subrecords' CREATE-ARRAY NAME=currRndRecs Size=200 FIELD=recname:char let #lastCleared = 0 let #lastRec = 1 !put the initial record in the record list #debugh display 'Value of Cur_recname : ' NOLINE #debugh display $cur_recname PUT $cur_recname INTO currRndRecs(#lastRec) recname !loop through the record list expanding it as we go until we run out WHILE #lastRec > #lastCleared !get the record name we are working with currently add 1 to #lastCleared #debugh display 'LastCleared num is : ' NOLINE #debugh display #lastCleared get $currEntryName from currRndRecs(#lastCleared) recname #debugh display 'A pertinent record : ' NOLINE #debugh display $currEntryName do Select-Subrec-Names !we've found every subrecord of our current entry, so we can say it's cleared end-WHILE #debugh display 'Leaving Loop-thru-subrecords' end-procedure !----------------------------------------------------------------------! ! Procedure: Select-Subrec-Names ! ! Descr: Puts into the array all subrecords defined for the !

! record name that we are processing. The record name that! ! we are processing is either the recname passed by the ! ! calling program or a subrecord of a recname (or a ! ! subrecord) passed by the calling program. ! !----------------------------------------------------------------------!

begin-procedure Select-Subrec-Names let $currEntryName = rtrim($currEntryName,' ') #debugh display 'Entering Select-Subrec-Names' begin-SELECT RECFIELD.FIELDNAME !for Every subrecord found in this record add it to the record list #debugh #debugh move &recfield.fieldname to $subrecord display 'Subrecord is : ' NOLINE display $subrecord add 1 to #lastRec put &recfield.fieldname into currRndRecs(#lastrec) recname

FROM PSRECFIELD RECFIELD WHERE RECFIELD.RECNAME = $currEntryName and RECFIELD.SUBRECORD = 'Y' end-SELECT #debugh display 'Leaving Select-Subrec-Names' end-procedure !----------------------------------------------------------------------! ! Procedure: Get-Field-Defn-Info ! ! Descr: Get field definition information for later processing ! !----------------------------------------------------------------------! begin-procedure Get-Field-Defn-Info #debugh display 'Entering Get-Field-Defn-Info' let #currentRecNum = 1 move ' ' to $curctlfieldname #debugh show 'lastrec = ' #lastrec #debugh show $curctlfieldname while (#currentRecNum <= #lastRec) and ($curctlfieldname = ' ') get $currentRecName from currRndRecs(#currentRecNum) recname #debugh show '412 - ' $AsOfToday ' ' $AsOfNow ' #currentRecNum = ' #cu rrentRecNum #debugh display '$currentRecName = 'NOLINE

#debugh display $currentRecName #debugh display '$cur_fieldname = 'NOLINE #debugh display $cur_fieldname do Select-Currencies add 1 to #currentRecNum end-while if $curctlfieldname = ' ' #debugh display 'Record.Field does not have a currency control field' #debugh show 'Record (' $Cur_recname ') Field (' $Cur_fieldname ')' stop end-if #debugh display 'Leaving Get-Field-Defn-Info' end-procedure !----------------------------------------------------------------------! ! Procedure: Select-Currencies ! ! Descr: Get field definition information for later processing ! !----------------------------------------------------------------------! begin-procedure Select-Currencies let $currentRecName = rtrim($currentRecName,' ') let $cur_fieldname = rtrim($cur_fieldname,' ') #debugh show '443 - ' $AsOfToday ' ' $AsOfNow 'Entering Select-Currencies' begin-SELECT DBFIELD.DECIMALPOS &decimalpos DBFIELD.LENGTH &length RECFIELD.CURCTLFIELDNAME &curctlfieldname move {TRUE} to $defn_row_found let #fld_decimal_pos = &decimalpos let #fld_length = &length #debugh show '455 - ' $AsOfToday ' ' $AsOfNow 'Field Decimal Positions : ' #debugh DISPLAY #fld_decimal_pos #debugh DISPLAY 'Field Length: ' NOLINE #debugh DISPLAY #fld_length let $curctlfieldname = &curctlfieldname UPPERCASE $curctlfieldname #debugh DISPLAY 'Currency Control Field: ' NOLINE #debugh DISPLAY $curctlfieldname from where DBFIELD.FIELDNAME = RECFIELD.FIELDNAME and RECFIELD.RECNAME = $currentRecName and DBFIELD.FIELDNAME = $cur_fieldname PSDBFIELD DBFIELD, PSRECFIELD RECFIELD

end-SELECT #debugh display 'Leaving Select-Currencies' end-procedure !----------------------------------------------------------------------! ! Procedure: Build-Update-Where-Clause ! ! Descr: This procedure builds a where clause used in ! ! update statements ! !----------------------------------------------------------------------! begin-procedure Build-Update-Where-Clause #debugh display 'Entering Build-Update-Where-Clause' move 'A' to $active let $cur_update_where_clause = $curctlfieldname ' in (Select currency_cd from PS_CURRENCY_CD_TBL curcd1 where curcd1.decimal_positions = ' $cur_dec curcd1.eff_status = ''' $active ''' and curcd1.effdt = ' ' (Select max(curcd2.effdt) from PS_CURRENCY_CD_TBL curcd2 where curcd1.currency_cd = curcd2.currency_cd and curcd2.effdt <= curcd1.effdt))'

' and

!now concatenate the value passed in by calling program let $cur_update_where_clause = $cur_update_where_clause ' and ' $cur_where_clause #debugh display 'Leaving Build-Update-Where-Clause' end-procedure !----------------------------------------------------------------------! ! Procedure: Select-Currency-Info ! ! Descr: This procedure selects information from the Currency Code! ! table. ! !----------------------------------------------------------------------! begin-procedure Select-Currency-Info #debugh display 'Entering Select-Currency-Info' #debugh display $cur_effdt let #cur_decimal_pos_prior = 99 let $col1 = 'A.' $curctlfieldname #debugh show '528 - ' $AsOfToday ' ' $AsOfNow 'Select currency control field i s: ' #debugh DISPLAY $col1 let $ps_cur_recname = 'PS_' $cur_recname #ifdef DB2ALL

CONCAT ' A, PS_CURRENCY_CD_TBL CURCD1' with $PS_CUR_RECNAME #endif #debugh DISPLAY 'Select currency recname is: ' NOLINE #debugh DISPLAY $ps_cur_recname begin-SELECT DISTINCT #IFNDEF DB2ALL [$col1] &col1=char #ENDIF CURCD1.CURRENCY_CD &currency_cd, CURCD1.DECIMAL_POSITIONS &decimal_positions let #cur_decimal_pos = &decimal_positions if #cur_decimal_pos <> #cur_decimal_pos_prior let #cur_decimal_pos_prior = #cur_decimal_pos move #cur_decimal_pos to $cur_dec !used for stringing into SQL do Build-Update-Where-Clause do Det-Round do Det-Factor evaluate $round-type when do when do when do = 'Round-Type-1' Round-Type-1 = 'Round-Type-2' Round-Type-2 = 'Round-Type-3' Round-Type-3

end-evaluate end-if FROM #ifdef DB2ALL [PS_INSTALLATION A,PS_CURRENCY_CD_TBL CURCD1:$PS_CUR_RECNAME] #else [PS_INSTALLATION A:$PS_CUR_RECNAME] A, PS_CURRENCY_CD_TBL CURCD1 #endif WHERE CURCD1.CURRENCY_CD = [$col1] and CURCD1.EFF_STATUS = 'A' and CURCD1.EFFDT = (SELECT MAX(CURCD2.EFFDT) from PS_CURRENCY_CD_TBL CURCD2 where CURCD1.CURRENCY_CD = CURCD2.CURRENCY_CD and CURCD2.EFFDT <= $cur_effdt) ORDER BY CURCD1.DECIMAL_POSITIONS end-SELECT #debugh display 'Leaving Select-Currency-Info'

end-procedure

!----------------------------------------------------------------------! ! Procedure: Round-Type-1 ! ! Descr: This procedure skips the SQL error that may be caused ! ! when no rows exist to update. ! !----------------------------------------------------------------------! begin-procedure Round-Type-1 #debugh display 'Entering Round-Type-1' !only round if decimal size of field is greater than or equal to currency !decimal precision if #fld_decimal_pos >= #cur_decimal_pos #DEBUGx SHOW $AsOfToday ' ' $AsOfNow '*** Round-Type-1 *** START UPDATE' let $SqlCmd = 'UPDATE PS_' $cur_recname ' SET ' $cur_fieldname ' = @round(' $cur_fieldname ',' $cur_dec ') WHERE ' $cur_update_where_clause '' UPPERCASE $SqlCmd #ifdef debug display $SqlCmd #endif #debugh show 'Round-Type-1: ' $SqlCmd begin-SQL on-error=Skip [$SQLCMD] end-SQL #DEBUGx SHOW $AsOfToday ' ' $AsOfNow '*** Round-Type-1 *** END UPDATE' end-if #debugh display 'Leaving Round-Type-1'

end-procedure !----------------------------------------------------------------------! ! Procedure: Round-Type-2 ! ! Descr: Second in a series of rounding algorithims. It rounds ! ! by truncation. !

!----------------------------------------------------------------------! begin-procedure Round-Type-2 #debugh display 'Entering Round-Type-2' !only round if decimal size of field is greater than currency !decimal precision if #fld_decimal_pos > #cur_decimal_pos #DEBUGx SHOW $AsOfToday ' ' $AsOfNow '*** Round-Type-2 *** START UPDATE' do Round-Type-2-Update-1 do Round-Type-2-Update-2 do Round-Type-2-Update-3 #DEBUGx SHOW $AsOfToday ' ' $AsOfNow '*** Round-Type-2 *** END UPDATE' end-if #debugh display 'Leaving Round-Type-2'

end-procedure !----------------------------------------------------------------------! ! Procedure: Round-Type-2-Update-Build ! ! Descr: This procedure creates a generic update statement ! !----------------------------------------------------------------------! begin-procedure Round-Type-2-Update-Build #debugh display 'Entering Round-Type-2-Update-Build' #debugh display 'Standard where clause: ' NOLINE #debugh display $cur_update_where_clause ! This ifdef should be removed for Rel 7. The code for DB2All should ! be used on all platforms. This ifdef was created to reduce ! regression testing on other platforms. - cjy 11/23/96. #ifdef DB2ALL let $alpha_factor = rtrim($alpha_factor,'0') #debugh display 'Trimmed alpha factor is: ' NOLINE #debugh display $alpha_factor let $SqlCmd = 'UPDATE PS_' $cur_recname ' SET ' $cur_fieldname ' = (' $cur_fieldname ' /' $alpha_factor ') ' $cur_sign $alpha_round_amt ' WHERE ' $cur_update_where_clause '' #ELSE let $SqlCmd = 'UPDATE PS_' $cur_recname

' SET ' $cur_fieldname /' $alpha_factor ') ' $cur_sign ' $cur_update_where_clause '' #ENDIF let $SqlCmd = rtrim($SqlCmd, ' ') '

' = (' $cur_fieldname ' $alpha_round_amt ' WHERE

' and '

$cur_fieldname

$cur_compare

'

UPPERCASE $SqlCmd ! ! ! #ifdef debug display $SqlCmd #endif

!begin-SQL on-error=Skip ! [$SQLCMD] !end-SQL #debugh display 'Leaving Round-Type-2-Update-Build' end-procedure !----------------------------------------------------------------------! ! Procedure: Round-Type-2-Update-1 ! ! Descr: This procedure creates and executes the first update ! ! statement. ! !----------------------------------------------------------------------! begin-procedure Round-Type-2-Update-1 #debugh display 'Entering Round-Type-2-Update-1' let $cur_sign = ' + ' let $cur_compare = ' > 0' do Round-Type-2-Update-Build UPPERCASE $SqlCmd #ifdef debug display $SqlCmd #endif #debugh show 'Round-Type-2-Update-1 SQL: ' $SqlCmd

begin-SQL on-error=Skip [$SqlCmd] end-SQL #debugh display 'Leaving Round-Type-2-Update-1' end-procedure !----------------------------------------------------------------------! ! Procedure: Round-Type-2-Update-2 !

! Descr: This procedure creates and executes an update ! ! statement. ! !----------------------------------------------------------------------! begin-procedure Round-Type-2-Update-2 #debugh display 'Entering Round-Type-2-Update-2' let $cur_sign = ' - ' let $cur_compare = ' < 0' do Round-Type-2-Update-Build #ifdef debug display $SqlCmd #endif #debugh show 'Round-Type-2-Update-2 SQL: ' $SqlCmd begin-SQL on-error=Skip [$SqlCmd] end-SQL #debugh display 'Leaving Round-Type-2-Update-2' end-procedure !----------------------------------------------------------------------! ! Procedure: Round-Type-2-Update-3 ! ! Descr: This procedure creates and executes an update ! ! statement. ! !----------------------------------------------------------------------! begin-procedure Round-Type-2-Update-3 #debugh display 'Entering Round-Type-2-Update-3' let $SqlCmd = 'UPDATE PS_' $cur_recname ' SET ' $cur_fieldname ' = (' *' $alpha_factor ')' ' WHERE ' $cur_update_where_clause '' UPPERCASE $SqlCmd #ifdef debug display $SqlCmd #endif #debugh show 'Round-Type-2-Update-3 SQL: ' $SqlCmd

$cur_fieldname

'

begin-SQL on-error=Skip [$SQLCMD] end-SQL #debugh display 'Leaving Round-Type-2-Update-3' end-procedure

!----------------------------------------------------------------------! ! Procedure: Round-Type-3 ! ! Descr: Third in a series of rounding algorithims. It is used ! ! for databases that round automatically. ! !----------------------------------------------------------------------! begin-procedure Round-Type-3 #debugh display 'Entering Round-Type-3' !only round if decimal size of field is greater than currency !decimal precision if #fld_decimal_pos > #cur_decimal_pos #DEBUGx SHOW $AsOfToday ' ' $AsOfNow '*** Round-Type-3 *** START UPDATE' do Round-Type-3-Update-1 do Round-Type-3-Update-2 #DEBUGx SHOW $AsOfToday ' ' $AsOfNow '*** Round-Type-3 *** END UPDATE' end-if #debugh display 'Leaving Round-Type-3'

end-procedure !----------------------------------------------------------------------! ! Procedure: Det-Round ! ! Descr: This procedure determines a round amount based on ! ! Database in use. ! !----------------------------------------------------------------------! begin-procedure Det-Round #debugh display 'Entering Det-Round' let #power = #fld_decimal_pos * -1 let #cur_round_amt = 0.5 * e10(#power) #debugh display 'Round is: ' NOLINE #debugh display #cur_round_amt let $alpha_round_amt = #cur_round_amt #debugh display 'Alpha Round is: ' NOLINE #debugh display $alpha_round_amt #debugh display 'Leaving Det-Round' end-procedure !----------------------------------------------------------------------! ! Procedure: Det-Factor ! ! Descr: This procedure determines a rounding factor to be used in! ! the updates !

!----------------------------------------------------------------------! begin-procedure Det-Factor #debugx show '895 - ' $AsOfToday ' ' $AsOfNow ' Entering Det-Factor' #debugh #debugh #debugh #debugh display display display display 'Field Decimal positions equal: ' NOLINE #fld_decimal_pos 'Currency Decimal positions equal: ' NOLINE #cur_decimal_pos

let #factor = e10(#fld_decimal_pos - #cur_decimal_pos) #debugh display 'Factor is: ' NOLINE #debugh display #factor let $alpha_factor = #factor #debugh display 'Alpha Factor is: ' NOLINE #debugh display $alpha_factor #debugh display 'Leaving Det-Factor' end-procedure !----------------------------------------------------------------------! ! Procedure: Round-Type-3-Update-1 ! ! Descr: This procedure creates and executes the first update ! ! statement. ! !----------------------------------------------------------------------! begin-procedure Round-Type-3-Update-1 #debugh display 'Entering Round-Type-3-Update-1' let $SqlCmd = 'UPDATE PS_' $cur_recname ' SET ' $cur_fieldname ' = (' $cur_fieldname $alpha_factor ') WHERE ' $cur_update_where_clause '' UPPERCASE $SqlCmd #ifdef debug display $SqlCmd #endif #debugh show 'Round-Type-3-Update-1: ' $SqlCmd '/'

begin-SQL on-error=Skip [$SQLCMD] end-SQL #debugh display 'Leaving Round-Type-3-Update-1' end-procedure

!----------------------------------------------------------------------! ! Procedure: Round-Type-3-Update-2 ! ! Descr: This procedure creates and executes the second update ! ! statement. ! !----------------------------------------------------------------------! begin-procedure Round-Type-3-Update-2 #debugh display 'Entering Round-Type-3-Update-2'

let $SqlCmd = 'UPDATE PS_' $cur_recname ' SET ' $cur_fieldname ' = (' * ' $alpha_factor ') WHERE ' $cur_update_where_clause '' UPPERCASE $SqlCmd #ifdef debug display $SqlCmd #endif #debugh show 'Round-Type-3-Update-2: ' $SqlCmd begin-SQL on-error=Skip [$SQLCMD] end-SQL #debugh display 'Leaving Round-Type-3-Update-2' end-procedure

$cur_fieldname

'

!----------------------------------------------------------------------! ! Procedure: Skip ! ! Descr: This procedure skips the SQL error that may be caused ! ! when no rows exist to update. ! !----------------------------------------------------------------------! begin-procedure Skip ! skip SQL update errors end-procedure !----------------------------------------------------------------------! ! Called SQC Procedures ! !----------------------------------------------------------------------!

S-ar putea să vă placă și