HDR*PowerBuilder0600U7RAPIDS functions libraryFRE*NOD* , Ct ENT*06002JAf_get_odbc_connection.funENT*0600bz-b?_f_get_odbc_connection.srfENT*0600Vj{-b?0f_get_measurement_for_unit.srfENT*0600w JAf_get_sequence.funENT*0600YJAf_get_measurement_for_unit.funENT*0600r{-b?=f_get_sequence.srfENT*0600<T{-b?:f_dw_get_objects_attrib.srfENT*0600JAf_get_sql.funENT*0600 JAf_dw_get_objects_attrib.funENT*0600{-b?#f_get_sql.srfENT*0600(`|-b?6f_dw_get_attributes.srfENT*0600JAf_get_string.funENT*0600JAf_dw_get_attributes.funENT*0600{-b?f_get_string.srfENT*0600|-b?Tf_delete_leg_ent.srfENT*0600JAf_get_token.funENT*0600uJAf_delete_leg_ent.funENT*0600|-b?f_get_token.srfENT*0600 }-b?Tf_delete_geo_loc.srfENT*0600 JAf_get_toolbar_profile.funENT*0600*JAf_delete_geo_loc.funENT*0600%|-b?Lf_get_toolbar_profile.srfENT*0600x kl@f_del_streams.srfENT*0600.JAf_get_unit_sql.funENT*0600@d JAf_del_streams.funENT*0600}-b?6f_get_unit_sql.srfENT*0600L}-b?*f_del_split_factor.srfENT*0600DPJAf_global_replace.funENT*0600VJAf_del_split_factor.funENT*0600}-b?@f_global_replace.srfENT*0600 kl@%f_del_speciation_profile.srfENT*0600ZJAf_highlight_button.funENT*0600lJAf_del_speciation_profile.funENT*0600~-b?Lf_highlight_button.srfENT*0600 j@f_del_sources.srfENT*0600pJAf_highlight_row.funENT*0600 JAf_del_sources.funENT*0600~-b?af_highlight_row.srfENT*0600x-b?*"f_del_scc_ams_speciation_code.srfENT*0600JAf_increment_array.funENT*0600JA"f_del_scc_ams_speciation_code.funENT*0600-b?f_increment_array.srfENT*0600|kl@f_del_ref_code.srfENT*0600 JAf_listobjects.funENT*0600H JAf_del_ref_code.funENT*0600-b?>f_listobjects.srfENT*0600h%-b?f_del_ref_activities.srfENT*0600 JAf_look_up.funENT*0600 JAf_del_ref_activities.funENT*0600-b?%f_look_up.srfENT*0600P -b?3f_del_recs.srfENT*0600QJAf_menu_behave.funENT*0600vJAf_del_recs.funENT*0600l0-b?*f_menu_behave.srfENT*0600.i kl@f_del_processes.srfENT*0600JAf_menu_off.funENT*0600KAf_del_processes.funENT*0600 -b?@f_menu_off.srfENT*0600--b?j$f_del_process_specific_schedule.srfENT*0600^KAf_menu_on.funENT*0600t -b?If_menu_on.srfENT*0600 KAf_oracle_connection.funENT*06002-b?1f_oracle_connection.srfENT*0600KAf_msgstring.funENT*0600"h-b?f_msgstring.srfENT*0600 KAf_getridfromid.funENT*06006@-b?f_getridfromid.srfNOD*4 8B ENT*0600 -b? f_del_material.srfENT*0600 KAf_del_material.funENT*0600B-b?$f_del_location_coordinates.srfENT*0600KAf_del_location_coordinates.funENT*0600 #kl@*%f_del_location_coordinate_groups.srfENT*0600S KA%f_del_location_coordinate_groups.funENT*0600-b?l%f_del_legal_entity_relations_rec.srfENT*0600L KA%f_del_legal_entity_relations_rec.funENT*0600-b?N!f_del_legal_entity_relations.srfENT*0600KA!f_del_legal_entity_relations.funENT*0600i-b?f_del_legal_entity.srfENT*0600| KAf_del_legal_entity.funENT*0600r< kl@Nf_del_legal_entities.srfENT*0600f KAf_del_legal_entities.funENT*0600\8(kl@%f_del_leg_ent_rel.srfENT*0600Pf KAf_del_leg_ent_rel.funENT*0600FB-b?7f_del_group_member.srfENT*0600: KAf_del_group_member.funENT*06000k-b?$f_del_geo_locs.srfENT*0600$ KAf_del_geo_locs.funENT*0600-b?f_del_form.srfENT*0600; KAf_del_form.funENT*0600W -b?"f_del_emission_factor.srfENT*0600 KAf_del_emission_factor.funENT*0600 kl@ f_del_doc_lookup.srfENT*0600 KAf_del_doc_lookup.funENT*0600 jl@f_del_doc.srfENT*0600 KAf_del_doc.funENT*0600 .kl@f_del_devices.srfENT*06008KAf_del_devices.funENT*06003kl@f_del_contacts.srfENT*0600 KAf_del_contacts.funENT*0600f-b?f_del_contact_reasons.srfENT*0600KAf_del_contact_reasons.funENT*0600zfl@f_del_connections.srfENT*0600pKAf_del_connections.funENT*0600f8kl@f_del_cal_protocol.srfENT*0600Z KAf_del_cal_protocol.funENT*0600P=>kl@f_del_app.srfENT*0600D KAf_del_app.funENT*0600:Bkl@f_del_activities.srfENT*0600.\ KAf_del_activities.funENT*0600"' -b?*f_dddw_search.srfENT*0600SKAf_dddw_search.funENT*0600  -b?5f_db_error.srfENT*0600y KAf_db_error.funENT*0600M-b?If_date_range.srfENT*0600KAf_date_range.funENT*0600S-b?5f_create_view.srfENT*0600KAf_create_view.funENT*0600q-b?[f_copy_record.srfENT*0600KAf_copy_record.funENT*0600K-b?Yf_compare_date_time.srfENT*0600KAf_compare_date_time.funENT*0600z-b?8f_check_matrl_group.srfENT*0600KAf_check_matrl_group.funENT*0600-b?+f_check_dup_act.srfENT*0600 KAf_check_dup_act.funENT*0600|-b?f_check_dates_nt.srfENT*0600 KAf_check_dates_nt.funENT*0600z~-b?f_check_dates.srfENT*0600p KAf_check_dates.funENT*0600j-b?<f_boolean_to_string.srfENT*0600dKAf_boolean_to_string.funENT*0600X -b?4f_block_text.srfENT*0600N~KAf_block_text.funNOD*(% A8ENT*0600D(LAf_paste_record.funENT*0600$-b?bf_paste_record.srfENT*0600H*-LAf_print_master_dw.funENT*0600\/-b?6f_print_master_dw.srfENT*0600T-LAf_printdw.funENT*0600.-b?)f_printdw.srfENT*0600h:LAf_put_scroll_bars.funENT*0600S-b?8f_put_scroll_bars.srfENT*0600vLAf_qc_act_data_1.funENT*0600-b?>f_qc_act_data_1.srfENT*0600!LAf_qc_act_data_2.funENT*0600V'-b?}f_qc_act_data_2.srfENT*0600LAf_qc_act_data_3.funENT*0600{-b?Xf_qc_act_data_3.srfENT*0600WLAf_retrieve_codes.funENT*0600a-b?mf_retrieve_codes.srfENT*0600 LAf_retrieve_connections.funENT*0600E-b?tf_retrieve_connections.srfENT*0600LAf_retrieve_county_city.funENT*0600-b?Ff_retrieve_county_city.srfENT*0600LAf_retrieve_date.funENT*0600-b?Xf_retrieve_date.srfENT*0600LAf_retrieve_group_types.funENT*0600-b?-f_retrieve_group_types.srfENT*0600LAf_retrieve_locations.funENT*0600-b?Gf_retrieve_locations.srfENT*06007 LAf_retrieve_metric_codes.funENT*0600$-b?=f_retrieve_metric_codes.srfENT*0600P LAf_retrieve_unit_codes.funENT*06008-b?#f_retrieve_unit_codes.srfENT*0600LAf_sas_config.funENT*0600\-b?3f_sas_config.srfENT*0600 LAf_save_toolbar_profile.funENT*0600-b?=f_save_toolbar_profile.srfENT*0600FLAf_security_grant.funENT*0600-b?5f_security_grant.srfENT*0600NLAf_security_revoke.funENT*06004-b?8f_security_revoke.srfENT*06003LAf_set_value_amt.funENT*0600#-b?Af_set_value_amt.srfENT*0600 LAf_shift_highlight.funENT*0600P-b?-f_shift_highlight.srfENT*06004 LAf_validate_act.funENT*0600 -b?0f_validate_act.srfENT*06008l LAf_validate_code.funENT*0600! -b?;f_validate_code.srfENT*0600JLAf_validate_dev_pro.funENT*0600 -b?9f_validate_dev_pro.srfENT*0600NLAf_validate_geo_loc.funENT*0600 -b?;f_validate_geo_loc.srfENT*0600`LAf_validate_legal_relation.funENT*0600 -b?-f_validate_legal_relation.srfENT*0600BLAf_validate_location.funENT*0600d-b?_f_validate_location.srfENT*0600FMAf_validate_pro_schedule.funENT*0600v -b?1f_validate_pro_schedule.srfENT*0600 MAf_validate_src.funENT*0600t .-b?.f_validate_src.srfENT*0600X MAf_window_close.funENT*0600 -b?[f_window_close.srfENT*0600>TMAf_window_count.funENT*0600-b?qf_window_count.srfENT*0600pMAf_write_line.funENT*0600 -b?,f_write_line.srfENT*0600NMAgf_build_fatal_message.funNOD*Y 8ENT*0600 -b?5gf_build_fatal_message.srfENT*0600*pMAgf_db_message.funENT*0600 -b?6gf_db_message.srfNOD*f hENT*0600J-b?,f_act_dddw_retrieve.srfENT*0600@KAf_act_dddw_retrieve.funENT*0600"KAf_arraystring.funENT*0600-b?f_arraystring.srfENT*0600&ELAf_arraysearch.funENT*0600-b?f_arraysearch.srfENT*0600:LA!f_array_breakarrayintoblocks.funENT*0600> eq@!f_array_breakarrayintoblocks.srfDAT*B_@])b?KA_@_@d_@q,`@`@6j@j@qDk@k@aPl@l@adm@m@ap@@@@A@@A@@A^@^@qryjtn@n@ap@p@alor f_act_dddw_retrievefunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindowwindowf_retrieve_codes2 < dw_objwin_objlDAT*8evelcode_valuef_act_dddw_retrieveP   QCdatawindow.Cwindow.SS x function_objectf_act_dddw_retrievestructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindowwindow on@ectxtuctu,ip@env6ai@edesDai@sagePwc@lisdtr@ewitpiDAT*F_@])b?LA_@_@T_@!'`@`@A1j@j@A?k@k@AKl@l@_m@m@ak@@{@@A@@A@@^@^@ayjin@n@+`@F@F@@ f_paste_recordfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindows_rec_holderpointerf_listobjects2 + DAT*R pdw_objpstr_recordf_paste_record=   BCdatawindow.RCs_rec_holder. x function_objectf_paste_recordstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindows_rec_holderpointer, on@ecteaayin'tr@rem1nt@iron?il@cripKes@dat_ld@tviekvi@emcDAT*R_@])b?LA_@_@d_@*`@`@4j@j@aBk@k@aNl@l@bm@m@qn@@Q~@@@@A@@A^@^@qryjtn@n@a@@a@@q+o f_print_master_dwfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindowfontfamilyfontpitchf_listobjects2 T DAT*LFunction to retrieve all dddw in activity dwglobal type f_act_dddw_retrieve from function_object end type forward prototypes global subroutine f_act_dddw_retrieve (datawindow dw_obj, window win_obj, string level, string code_value) end prototypes global subroutine f_act_dddw_retrieve (datawindow dw_obj, window win_obj, string level, string code_value);string ls_col_name ls_col_name = dw_obj.GetColumnName() choose case ls_col_name case "code", "material_code", "value_unit_code", & DAT* "primary_material_code", "weekly_schedule_code", & "daily_schedule_code", "data_code" f_retrieve_codes(win_obj.Title, dw_obj, ls_col_name, "code") // case "metric_code" // f_retrieve_metric_codes(win_obj, dw_obj, level, code_value) case "method_type", "value_type", "mode_type", "reference_type" f_retrieve_codes(win_obj.Title, dw_obj, ls_col_name, "type") end choose end subroutine DAT*P_@])b?KA _@_@d_@a%`@`@/j@j@A=k@k@aIl@l@]m@m@i@@y@@a@@a@@A^@^@qryjt f_block_textfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobject2  origwidthf_block_text$  SSI x DAT*6 function_objectf_block_textstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobject on@ecttoing%ma@cipi/nm@mail=pt@mailIta@owch]ew@treico@tionyob@ @ h@@ @ ~8DAT*T dwprintjobstartpospagesizeleftmargincur_rowpage_numf_print_master_dwq   &19ICdatawindow.IIIIIRI x function_objectf_print_master_dwstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindowfontfamilyfontpitch,@*@DAT*V_@^)b?LA_@_@T_@!"`@`@A,j@j@A:k@k@AFl@l@Zm@m@af@@v@@A@@A@@^@^@n n@n@@@@@@ f_printdwfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindowfontfamilyfontpitchf_listobjects2 D dwDAT*Zprintjobstartpospagesizeleftmarginpage_numf_printdwd   &1ICdatawindow.IIIIRI x function_objectf_printdwstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindowfontfamilyfontpitch, on@ectstwst"il@pien,en@ilfi:io@ilmeFDAT*ZReturns a string formatted into the specified width.global type f_block_text from function_object end type forward prototypes global function string f_block_text (string orig, int width) end prototypes global function string f_block_text (string orig, int width);//////////////////////////////////////////////////////////////////////// // // Function : F_Block_Text // // Purpose : Receives a string and the width of the block for the string // to formatted into. ReturnDAT*\s the string formatted in the // specified width. Uses carriage control/line feed (~r~n) // as the line separator. // // Date : September 9, 1992 // // Arguments : string orig - original string to be formatted // integer width - width of the format block // // Returns : string result - the reformatted string // // Log : // // DATE WHO WHAT // ------ ----- ---------------------DAT*^---------------- // ////////////////////////////////////////////////////////////////////////// string ls_crlf = "~r~n" string ls_token, ls_result, ls_curr_chr integer li_curr_pos, li_ascii_val, li_posi ls_result = "" do while len ( orig ) > 0 li_curr_pos = width + 1 // start at the right border and work back ls_curr_chr = mid ( orig, li_curr_pos, 1 ) // looking for a white space character li_ascii_val = asc(ls_curr_chr) DAT*` // (ASCII value 32) do while ( asc ( ls_curr_chr ) > 32 ) and ( li_curr_pos >= 1 ) li_curr_pos = li_curr_pos - 1 ls_curr_chr = mid ( orig, li_curr_pos, 1 ) li_ascii_val = asc ( ls_curr_chr ) loop if li_curr_pos <= 1 then li_curr_pos = len ( orig ) // no white space found ? ls_token = left ( orig, li_curr_pos - 1 ) // break at the white space char li_posi = pos ( ls_token, ls_crlf ) // check for a ls_crlf in the new DAT*bline if li_posi > 0 then // if ls_crlf found then break the string at the ls_crlf ls_token = left ( orig, li_posi - 1 ) // and put the right side back in the orig = mid ( orig, li_posi + 2 ) // original string else orig = mid ( orig, li_curr_pos + 1 ) end if if len ( ls_result ) > 0 then ls_result = ls_result + ls_crlf + ls_token // add in the new separator else ls_result = ls_token enDAT*8d if loop return ls_result end function DAT*f_@\)b?KA _@_@t_@a,`@`@a6j@j@aDk@k@aPl@l@adm@m@qp@@a@@A@@A@@^@^@aor f_boolean_to_stringfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobject2 " bparmf_boolean_to_string SB x DAT*4function_objectf_boolean_to_stringstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobject@j@,k@@J6@m@D@@P@@d@^@ap @n@@ @ @+e @@ 2DAT*t_@^)b?LA_@_@T_@!*`@`@A4j@j@ABk@k@ANl@l@bm@m@an@@~@@A@@A@@^@^@R p@p@ f_put_scroll_barsfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectwindow2 " win_objf_put_scroll_bars  QCwindow.DAT*lReturns a string value based on the specified boolean value.global type f_boolean_to_string from function_object end type forward prototypes global function string f_boolean_to_string (boolean bparm) end prototypes global function string f_boolean_to_string (boolean bparm);/////////////////////////////////////////////////////////////////////// // // Function: F_Boolean_To_String // // Purpose: Returns the passed boolean value as a string // // Date: September 7, 1992 DAT*n// // Scope: Public // // Arguments: boolean bparm - the boolean value to be converted // // Returns: String "True" for a true boolean value or // "False" for a false boolean value // // Log : // // DATE WHO WHAT // -------- ----- ------------------------------------------- // Powersoft Company initial version //////////////////////////////////////////////////////////////////////// if bparm then return "True"DAT*1 else return "False" end if end function DAT*r_@\)b?KA_@_@_@&`@`@0j@j@>k@k@Jl@l@^m@m@j@@z@@@@@@^@^@aor n@n@ f_check_datesfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindowf_check_dates_nt2 S fcurdwcur_rowfirst_datesecond_datefirDAT*2st_textsecond_textf_check_datesc  ".9BCdatawindow.LSSSS x function_objectf_check_datesstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindow@j@&k@@M0@m@a>A@@J@@^@^@AjDAT*\ x function_objectf_put_scroll_barsstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectwindow@!Aj@*k@@F4@m@aB@@N@@b@^@n @n@~@@ @ h@@ @ @ DAT*x_@^)b?LA_@_@_@(`@`@2j@j@@k@k@Ll@l@`m@m@l@@|@@@@A@@A^@^@qryjtq@q@ain elor+o@x f_qc_act_data_1function_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactionsqlcaselect format_type , lookup_name , material_flag , meas_cDAT*^ode , value_length_amt , value_type_flag from rap_metrics where code =' ' HLALLAf_db_error,select code from rap_units where meas_code =' ' ,/E=codecursor$ LAhLALAf_qc_act_data_3f_DAT*|Function to validate datesglobal type f_check_dates from function_object end type forward prototypes global function boolean f_check_dates (datawindow fcurdw, long cur_row, string first_date, string second_date, string first_text, string second_text) end prototypes global function boolean f_check_dates (datawindow fcurdw, long cur_row, string first_date, string second_date, string first_text, string second_text);// f_check_dates // parameters // 1 - datawindowname (datawindow) // DAT*~2 - name of first date field (string) // 3 - name of second date field (string) // displays message // returns boolean true or false, true = dates are correct sequence // datetime bdate datetime edate string date1_type string date2_type //long crow ////////////////////////////////////////////////////////////////////////////////////// //added this fix, since the Oracle "date" data type is represented //as "datetime" in pb datawindows MDY 10/98 date1_type = fcurdw.describe(firstDAT*_date + ".ColType") date2_type = fcurdw.describe(first_date + ".ColType") if upper(date1_type) = "DATE" and upper(date2_type) = "DATE" then return f_check_dates_nt(fcurdw,cur_row,first_date,second_date,first_text,second_text) end if ////////////////////////////////////////////////////////////////////////////////////// //crow = fcurdw.getrow() bdate = fcurdw.getitemdatetime(cur_row, first_date) edate = fcurdw.getitemdatetime(cur_row, second_date) if isnull(bdate) and not isnull(edate)DAT* then messagebox("Error", first_text + " must exist if " + Second_text + " exists", exclamation!) fcurdw.ScrollToRow(cur_row) return false end if if not (isnull(bdate) or isnull(edate)) then if edate < bdate then messagebox("Error", first_text + " must be before " + Second_text, exclamation!) fcurdw.ScrollToRow(cur_row) return false end if end if return true end function DAT*_@\)b?KA_@_@_@)`@`@3j@j@Ak@k@Ml@l@qam@m@am@@A}@@@@A@@^@^@A0 n@n@ f_check_dates_ntfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindowf_check_dates2 V fcurdwcur_rowfirst_datesecond_datefirDAT*0st_textsecond_textf_check_dates_ntc  ".9BCdatawindow.LSSSS x function_objectf_check_dates_ntstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindow on@ectp_stru)re@ent3t@fileAn@messMnd@ildaem@evieDAT*_@^)b?LA_@_@T_@!(`@`@A2j@j@A@k@k@ALl@l@`m@m@al@@|@@A@@A@@A^@^@qryjts@s@ain eq@q@q(+ o.@P f_qc_act_data_2function_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdynamicstagingareasqlsa,metricmapcursorDAT*`LAtransactionsqlcaf_db_errorLAt LAselect rap_units_a.conversion_factor_amt , rap_units_b.conversion_factor_amt from rap_units rap_units_a , rap_units rap_units_b , rap_metrics where ( rap_units_a.code =' ' ) and ( rap_metrics.meas_code =rap_units_a.meas_code ) and ( rap_metrics.meas_code =rap_units_b.meas_code ) and ( rap_metrics.code =' DAT*_@^)b?LA_@_@t_@(`@`@2j@j@@k@k@Ll@l@`m@m@l@@|@@@@@@Q^@^@_ajtq@q@ s@s@ach  f_qc_act_data_3function_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactionsqlca,select valid_value_name from rap_metDAT*Function to validate datesglobal type f_check_dates_nt from function_object end type forward prototypes global function boolean f_check_dates_nt (datawindow fcurdw, long cur_row, string first_date, string second_date, string first_text, string second_text) end prototypes global function boolean f_check_dates_nt (datawindow fcurdw, long cur_row, string first_date, string second_date, string first_text, string second_text);// f_check_dates // parameters // 1 - datawindowname (datawindoDAT*w) // 2 - name of first date field (string) // 3 - name of second date field (string) // displays message // returns boolean true or false, true = dates are correct sequence // date bdate date edate string date1_type string date2_type //long crow ////////////////////////////////////////////////////////////////////////////////////// //added this fix, since the Oracle "date" data type is represented //as "datetime" in pb datawindows MDY 10/98 date1_type = fcurdw.describe(firsDAT*t_date + ".ColType") date2_type = fcurdw.describe(first_date + ".ColType") if upper(date1_type) = "DATETIME" and upper(date2_type) = "DATETIME" then return f_check_dates(fcurdw,cur_row,first_date,second_date,first_text,second_text) end if ////////////////////////////////////////////////////////////////////////////////////// //crow = fcurdw.getrow() bdate = fcurdw.getitemdate(cur_row, first_date) edate = fcurdw.getitemdate(cur_row, second_date) if isnull(bdate) and not isnull(edate) tDAT*hen messagebox("Error", first_text + " must exist if " + Second_text + " exists", exclamation!) fcurdw.ScrollToRow(cur_row) return false end if if not (isnull(bdate) or isnull(edate)) then if edate < bdate then messagebox("Error", first_text + " must be before " + Second_text, exclamation!) fcurdw.ScrollToRow(cur_row) return false end if end if return true end function DAT*_@\)b?KA_@_@d_@(`@`@q2j@j@@k@k@Ll@l@`m@m@l@@|@@@@A@@^@^@anejin@n@atrt f_check_dup_actfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindowf_get_activity_rid2 0 pdw_objpl_ridps_levelf_check_dup_aDAT*&ct<  BCdatawindow.LS x function_objectf_check_dup_actstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindow@aqj@(k@@P2@m@!@@@L@@`@^@qljt@F@|q@@ @o n@DAT*fric_lookups where metric_code =' ' CFvaluecursor( $LAn_lLAf_db_error8LAdynamicstagingareasqlsao,codecursor LALALA   DAT*_@_)b?LA_@_@_@)`@`@3j@j@Ak@k@Ml@l@am@m@m@@}@@@@@@^@^@ n@n@q@q@ f_retrieve_codesfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindowtransactionsqlca2 ? win_titledw_objfld_nameDAT*hdw_fld_namef_retrieve_codesI  "QSCdatawindow.SS x function_objectf_retrieve_codesstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindowtransaction@j@)k@@L3@m@A@@M@@a@^@mjt@q@DAT*_@_)b?LA_@_@_@/`@`@9j@j@Gk@k@Sl@l@gm@m@s@@@@@@@@^@^@aP; n@n@q@q@O p f_retrieve_connectionsfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindowctransactionsqlca,select from_device_rid , capture_efficiencDAT*Function to check duplicate activity recordglobal type f_check_dup_act from function_object end type forward prototypes global function boolean f_check_dup_act (datawindow pdw_obj, long pl_rid, string ps_level) end prototypes global function boolean f_check_dup_act (datawindow pdw_obj, long pl_rid, string ps_level);datetime ldt_start, ldt_end string ls_metric, ls_value_type, ls_material, ls_data, ls_ref long ll_cur_row, ll_rid, ll_act_rid ll_cur_row = pdw_obj.GetRow() ldt_start = DAT*pdw_obj.GetItemDateTime(ll_cur_row, 'start_date_time') ldt_end = pdw_obj.GetItemDateTime(ll_cur_row, 'end_date_time') ls_metric = pdw_obj.GetItemString(ll_cur_row, 'metric_code') ls_value_type = pdw_obj.GetItemString(ll_cur_row, 'value_type') ls_material = pdw_obj.GetItemString(ll_cur_row, 'material_code') ls_data = pdw_obj.GetItemString(ll_cur_row, 'data_code') ls_ref = pdw_obj.GetItemString(ll_cur_row, 'reference_code') ll_rid = f_get_activity_rid(pl_rid, ps_level, ldt_start, ldt_end, &DAT* ls_metric, ls_value_type, ls_material, ls_data, ls_ref) ll_act_rid = pdw_obj.GetItemNumber(ll_cur_row, 'rid') if ll_rid > 0 and (IsNull(ll_act_rid) or ll_rid <> ll_act_rid) then MessageBox('Activity', 'Start Date Time, End Date Time, Metric Code, ' + & 'Value Type, Material Code, Data Code, and Reference Code ' + & 'must be unique in table rap_activities') return FALSE elseif ll_rid < 0 then return FALSE end if return TRUE end function DAT*_@\)b?KA_@_@t_@a,`@`@q6j@j@!Dk@k@!Pl@l@!dm@m@!p@@@@@@@@A^@^@qryjtF@F@aq@q@alo r+o f_check_matrl_groupfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectpointertransactionsqlcaSelect count ( child_ref_rid ) from rap_group_members wheDAT*$re parent_ref_rid =0 LMKA\$KAf_db_error$ \ ` 2 , pl_material_ridf_check_matrl_group IL x function_objectf_check_matrl_groupstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectpDAT*jy_perc , name from rap_connections where to_device_rid =0 bcfromconnectcursorXPTLALALA,select to_device_rid , capture_efficiency_perc , name from rap_connections where from_device_rid =0 bc$toconnectcursor8.LADAT*_@_)b?LA_@_@_@/`@`@9j@j@Gk@k@Sl@l@gm@m@s@@@@@@A@@^@^@ n@n@q@q@ f_retrieve_county_cityfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindowtransactionsqlca2 E win_titledw_objflDAT*ld_namedw_fld_namef_retrieve_county_cityI  "QSCdatawindow.SS x function_objectf_retrieve_county_citystructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindowtransaction@j@/k@@S9@m@G@@S@@g@^@aDAT*Function to check if the material has any group members.global type f_check_matrl_group from function_object end type forward prototypes global function integer f_check_matrl_group (long pl_material_rid) end prototypes global function integer f_check_matrl_group (long pl_material_rid);// check to see whether the material selected has a group member. // // Argument(s): val long pl_material_rid rid of the geographic // location selected DAT*// // Return: 0 Yes! it has a group member // 1 No! it does not have a group member // -1 database error SetPointer( Hourglass!) // Declare local variable(s) int li_group_count // check to see if the material has a group member Select count(child_ref_rid) into :li_group_count from rap_group_members where parent_ref_rid = :pl_material_rid using sqlca ; if f_db_error(SQLCA, "Fail on counting group member records on " + & "rap_group_DAT*members table. Contact your technical support.") = 1 then return -1 end if // one or more group member(s) if li_group_count > 0 then MessageBox("Material", "Can not delete the current " + & "record until related records are first deleted.~n" + & "No changes made to database.") // at least one child, can't delete it return (0) else return (1) end if end function DAT*_@\)b?KA_@_@_@,`@`@6j@j@Dk@k@Pl@l@dm@m@p@@@@a@@a@@^@^@aijiq@q@ f_compare_date_timefunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactiongs_database2 1 p_transpdt_datetimef_compare_date_timDAT*"e0  SCtransaction.W x function_objectf_compare_date_timestructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransaction@Qaj@,k@@J6@m@!D@@P@@d@^@p @n@`@@ @i n@onDAT*_@_)b?LA_@_@_@(`@`@2j@j@@k@k@Ll@l@`m@m@l@@|@@@@A@@A^@^@qryjtq@q@aine f_retrieve_datefunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactiongs_database2 3 p_transps_datetime_columnf_retrieve_dateDAT*n0  SCtransaction.S x function_objectf_retrieve_datestructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransaction@j@(k@@S2@m@@@@L@@`@^@l @n@|q@@ ,@i n@on DAT*returns a string used to compare a date time column with the value of a date time literalglobal type f_compare_date_time from function_object end type forward prototypes global function string f_compare_date_time (transaction p_trans, datetime pdt_datetime) end prototypes global function string f_compare_date_time (transaction p_trans, datetime pdt_datetime);// This function returns a string that is used in a SELECT clause to compare // the contents of a date time column with the value oDAT*Uf a date time literal. // This function is DBMS dependent. string s_result, ls_datetime ls_datetime = String(pdt_datetime, "yyyy-mm-dd hh:mm:ss") if gs_database = 'ORACLE' then s_result = "to_date('" + ls_datetime + "', 'yyyy-mm-dd hh24:mi:ss')" else s_result = "'" + ls_datetime + "'" end if RETURN s_result end function DAT*_@[)b?KA_@_@T_@Q&`@`@a0j@j@a>k@k@!Jl@l@q^m@m@!j@@z@@@@@@^@^@ n@n@+`@F@F@mii f_copy_recordfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindows_rec_holderpointerf_listobjects2 * DAT* pdw_objpstr_recordf_copy_record=   QCdatawindow.RCs_rec_holder. x function_objectf_copy_recordstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindows_rec_holderpointer,@j@&k@@J0@m@>@@J@@^@^@jjn@q@DAT*_@_)b?LA_@_@t_@q/`@`@q9j@j@aGk@k@Sl@l@gm@m@s@@A@@@@A@@A^@^@qryjtp@p@an@n@aq@q@q+o f_retrieve_group_typesfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectwindowdatawindowtransactionsqlca2 9 DAT*pp_winp_dwp_metric_levelf_retrieve_group_typesC   QCwindow.Cdatawindow.S x function_objectf_retrieve_group_typesstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectwindowdatawindowtransaction,@j@/k@@L9@m@G@@S@@g@DAT*_@_)b?LA_@_@_@-`@`@7j@j@Ek@k@Ql@l@em@m@q@@@@@@A@@^@^@*p@p@n@n@q@q@t f_retrieve_locationsfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectwindowdatawindowtransactionsqlca2 O p_DAT*zwinp_dwp_columnp_sqlp_cityp_statep_nationf_retrieve_locationsw   ")1QCwindow.Cdatawindow.SSLLL x function_objectf_retrieve_locationsstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectwindowdatawindowtransaction,@qqj@-k@@S7DAT*_@`)b?LA _@_@_@0`@`@:j@j@Hk@k@Tl@l@hm@m@t@@@@q@@a@@^@^@qmaJtp@p@Qn@n@q@q@atip f_retrieve_metric_codesfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectwindowdatawindowtransactionsqlca2 W DAT*|win_objdw_objlevel_typesourcedeviceprocessstreamf_retrieve_metric_codesw   ")08QCwindow.Cdatawindow.SSSSS x function_objectf_retrieve_metric_codesstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectwindowdatawindowtransaction, @0DAT*_@`)b?LA_@_@_@.`@`@8j@j@Fk@k@Rl@l@fm@m@r@@@@q@@a@@^@^@aevjep@p@an@n@aq@q@inr f_retrieve_unit_codesfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectwindowdatawindowtransactionsqlcaselect meas_code from rap_metrics where code DAT*~=' ' .1LA`LLA L P 2 = p_winp_dwp_sqlp_metric_codef_retrieve_unit_codesP   LCwindow.Cdatawindow.SS x function_objectf_retrieve_unit_codesstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistvDAT*Function to get the values from all datawindow columns and store the values in a structure.global type f_copy_record from function_object end type forward prototypes global subroutine f_copy_record (datawindow pdw_obj, ref s_rec_holder pstr_record) end prototypes global subroutine f_copy_record (datawindow pdw_obj, ref s_rec_holder pstr_record); ////////////////////////////////////////////////////////////////////////// // // Function: f_copy_record // // Purpose: // // Global funcDAT*tion f_copy_record is to get the values from all // datawindow columns and store the values in a structure. // IMPORTANT - This function does not support compute fields and groups. // // Scope: public // // Arguments: // pdw_obj (datawindow/value) Contains the active datawindow // object. // // Returns : none // // DATE NAME REVISION // ---- ------------------------------------------------------------ // 8/3/94 SWJ INITIAL VERSION ///////////////////////DAT*////////////////////////////////////////////////// // Location variable declaration string ls_empty[], ls_detail_list[] string ls_obj_type, ls_data_type integer li_detail_count, li_cur_obj, & li_str_count = 1, li_long_count = 1, li_date_count = 1, & li_dt_count = 1, li_time_count = 1, li_dec_count = 1, & li_other_count = 1 long ll_cur_row, ll_empty[] date ld_empty[] datetime ldt_empty[] time lt_empty[] decimal ldec_empty[] SetPointer(HourGlass!) // Reset unboundeDAT*d arrays pstr_record.string_arg[] = ls_empty[] pstr_record.long_arg[] = ll_empty[] pstr_record.date_arg[] = ld_empty[] pstr_record.datetime_arg[] = ldt_empty[] pstr_record.time_arg[] = lt_empty[] pstr_record.decimal_arg[] = ldec_empty[] // Get the data object name for the active datawindow pstr_record.dw_data_object = pdw_obj.DataObject // Get a list of all the datawindow objects in the detail band. // Ls_detail_list[] will contain the name of all objects on datawindow // detail banDAT*d. Note that these are returned in creation order, not // by position on the datawindow. li_detail_count = f_listobjects(pdw_obj, ls_detail_list, "*", "detail") // Get the current row ll_cur_row = pdw_obj.GetRow() if ll_cur_row = 0 then MessageBox('Copy Record', 'No row is current') return elseif ll_cur_row = -1 then MessageBox('Copy Record', 'Error - GetRow() in wf_copy_record') return end if // For each object for li_cur_obj = 1 to li_detail_count // For each object, DAT*get the type of the object ls_obj_type = pdw_obj.Describe(ls_detail_list[li_cur_obj] + ".type") // Only get the data type when the object type is column if ls_obj_type = 'column' then ls_data_type = & Left(pdw_obj.Describe(ls_detail_list[li_cur_obj] + & ".coltype"), 5) // Get the data value of the object and store it in a instance // structure choose case ls_data_type case 'char(' pstr_record.string_arg[li_str_count] = & pdw_obj.GetItemString(ll_cur_DAT*row, ls_detail_list[li_cur_obj]) li_str_count = li_str_count + 1 case 'decim' pstr_record.decimal_arg[li_dec_count] = & pdw_obj.GetItemNumber(ll_cur_row, ls_detail_list[li_cur_obj]) li_dec_count = li_dec_count + 1 case 'numbe' pstr_record.long_arg[li_long_count] = & pdw_obj.GetItemNumber(ll_cur_row, ls_detail_list[li_cur_obj]) li_long_count = li_long_count + 1 case 'date' pstr_record.date_arg[li_date_count] = & pdw_obj.GetItemDaDAT*te(ll_cur_row, ls_detail_list[li_cur_obj]) li_date_count = li_date_count + 1 case 'datet' pstr_record.datetime_arg[li_dt_count] = & pdw_obj.GetItemDateTime(ll_cur_row, ls_detail_list[li_cur_obj]) li_dt_count = li_dt_count + 1 case 'time' pstr_record.time_arg[li_time_count] = & pdw_obj.GetItemTime(ll_cur_row, ls_detail_list[li_cur_obj]) li_time_count = li_time_count + 1 case 'real' // 3/98-mlk added real col type pstr_record.decimal_aDAT*rg[li_dec_count] = & pdw_obj.GetItemNumber(ll_cur_row, ls_detail_list[li_cur_obj]) li_dec_count = li_dec_count + 1 case else // 3/98-mlk was over writing string_arg //pstr_record.string_arg[li_other_count] = '' //li_other_count = li_other_count + 1 pstr_record.string_arg[li_str_count] = '' li_str_count = li_str_count + 1 end choose end if next // next object end subroutine DAT*_@[)b?KA_@_@_@&`@`@0j@j@>k@k@Jl@l@^m@m@j@@z@@@@A@@^@^@pjnq@q@  f_create_viewfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactionsqlcaf_db_error2 0 ps_view_nameps_sql_stmntf_DAT*create_view$ BSS x function_objectf_create_viewstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransaction on@ectvistr&lr@ient0nt@lfil>on@lmesJin@hild^te@eevijne@ninfzec@ansa mi@ging h@@ DAT*_@`)b?LA_@_@_@%`@`@/j@j@=k@k@Il@l@]m@m@i@@y@@A@@A@@^@^@a t f_sas_configfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectgs_inifile2  ps_modeps_output_fileps_log_fileps_nameps_geinidirps_newconfigps_DAT*sasdirps_userdirps_sasexeps_keyf_sas_config +3?LVakBSSSSSRSRSRSRSRS x function_objectf_sas_configstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobject@j@%k@@R/@m@=@DAT*Creates a view, given the view name and SQL statementglobal type f_create_view from function_object end type forward prototypes global function boolean f_create_view (string ps_view_name, string ps_sql_stmnt) end prototypes global function boolean f_create_view (string ps_view_name, string ps_sql_stmnt);// Creates a view, given the view name and SQL statement to create the view string ls_sql_stmnt // First, drop the old view, if one already exists ls_sql_stmnt = 'DROP VIEW ' + psDAT*]_view_name EXECUTE IMMEDIATE :ls_sql_stmnt; // Create the view ls_sql_stmnt = 'CREATE VIEW ' + ps_view_name + ' ' + ps_sql_stmnt EXECUTE IMMEDIATE :ls_sql_stmnt; if f_db_error(SQLCA, "Fail on creating view " + ps_view_name + ". Contact " + & "your technical support") = 1 then return FALSE else return TRUE end if end function DAT*_@[)b?KA_@_@d_@%`@`@a/j@j@q=k@k@qIl@l@]m@m@ai@@y@@@@A@@^@^@pjnq@q@  f_date_rangefunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactionsqlcaf_compare_date_time2 3 ps_activitypldt_froDAT*mpldt_tof_date_range1 SSWW x function_objectf_date_rangestructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransaction on@ectsture%ie@nvir/lf@escr=lm@gedIhi@istv]ee@itemini@poweyan@ion @aDAT*_@`)b?LA_@_@_@A/`@`@9j@j@Gk@k@Sl@l@gm@m@s@@@@q@@a@@^@^@aijep@p@ h@@ !r f_save_toolbar_profilefunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectwindowgs_inifilerapids2 7 window_nameDAT*window_parmf_save_toolbar_profile+  QSCwindow. x function_objectf_save_toolbar_profilestructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectwindowrapids on@ectiguctu/ip@env9ai@edesGai@sageSwc@lisgtr@ewitsio@opoe@n+c DAT*Returns a date range expression for activity to include in a where clauseglobal type f_date_range from function_object end type forward prototypes global function string f_date_range (string ps_activity, datetime pldt_from, datetime pldt_to) end prototypes global function string f_date_range (string ps_activity, datetime pldt_from, datetime pldt_to);// This function returns a string used as part of a WHERE clause in a select statement // to retrieve all activity records within a specifieDAT*Wd date range. string ls_date_range ls_date_range = '( ( ' + ps_activity + '.end_date_time IS NULL OR ' + ps_activity + & ".end_date_time >= " + f_compare_date_time(SQLCA, pldt_from) + " ) AND ( " + & ps_activity + ".start_date_time <= " + f_compare_date_time(SQLCA, pldt_to) + " ) )" RETURN ls_date_range end function DAT*_@[)b?KA_@_@_@#`@`@-j@j@;k@k@Gl@l@[m@m@g@@w@@@@A@@^@^@ q@q@p@ mi ieanone f_db_errorfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactionf_boolean_to_stringw_db_errorgs_databasef_oracle_connDAT*ection2 0 at_error_objectas_error_msgf_db_error0  ICtransaction.S x function_objectf_db_errorstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactionw_db_error on@ectrcruct#ci@ten-ma@lede;ma@ssagGow@dli[tDAT*_@a)b?LA_@_@_@)`@`@3j@j@Ak@k@Ml@l@am@m@m@@}@@q@@a@@A^@^@qryjtq@q@ain elor f_security_grantfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactionsqlcagf_db_message2 5 ps_object_nameps_userDAT*_namef_security_grant$ BSS x function_objectf_security_grantstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransaction@Aj@)k@@S3@m@A@@M@@a@^@amje@p@}@ @!r @DAT* _@a)b?LA_@_@d_@!*`@`@4j@j@Bk@k@Nl@l@bm@m@n@@~@@@@@@A^@^@qryjtq@q@ain elor f_security_revokefunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactionsqlcagf_db_message2 6 ps_object_nameps_useDAT*r_namef_security_revoke$ BSS x function_objectf_security_revokestructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransaction@j@*k@@M4@m@B@@N@@b@^@qnjt@q@~ @ te@stro h@@DAT*Displays a standard error window for database errors.global type f_db_error from function_object end type forward prototypes global function integer f_db_error (transaction at_error_object, string as_error_msg) end prototypes global function integer f_db_error (transaction at_error_object, string as_error_msg);/////////////////////////////////////////////////////////////////////////// // // Function: f_db_error // // Purpose: // // Function f_db_error is passed a transaction objectDAT* (i.e. SQLCA). If // the transaction object's sqlcode identifies an error, the function // then displays a window containing an error message passed from the // application in addition to the error message pertaining to the // specific RDBMS currently in use. // // The window also allows the user to print the message // // // Arguments: // at_error_object : transaction object (i.e. SQLCA ) // as_error_msg : string (application specific message) // // Returns : inteDAT*ger // // DATE NAME REVISION // ---- ------------------------------------------------------------ // Powersoft Corporation INITIAL VERSION // 7/27/95 SWJ Added a function call to check for a lost // lost connection in Oracle. ///////////////////////////////////////////////////////////////////////// string ls_string if at_error_object.sqlcode = 0 then return 0 else ls_string = as_error_msg + "~r~n~r~n" ls_string = ls_string + "Transaction Error Code : " + strinDAT*g(at_error_object.sqlcode) + "~r~n" ls_string = ls_string + "Database Error Code : " + string(at_error_object.sqldbcode)+ "~r~n" ls_string = ls_string + "DBMS : " + at_error_object.dbms+ "~r~n" ls_string = ls_string + "Database : " + at_error_object.database+ "~r~n" ls_string = ls_string + "User ID : " + at_error_object.userid+ "~r~n" ls_string = ls_string + "DBParm : " + at_error_object.dbparm+ "~r~n" ls_string = ls_strDAT*ing + "Login ID : " + at_error_object.logid+ "~r~n" ls_string = ls_string + "ServerName : " + at_error_object.servername+ "~r~n" ls_string = ls_string + "AutoCommit : " + f_boolean_to_string(at_error_object.autocommit)+ "~r~n" ls_string = ls_string + "Database Error Message : " + at_error_object.sqlerrtext + "~r~n" openwithparm(w_db_error,ls_string) if gs_database = 'ORACLE' then f_oracle_connection(at_error_object.sqldbcode) end if retuDAT*"rn 1 end if end function DAT*_@[)b?KA_@_@_@&`@`@0j@j@>k@k@Jl@l@^m@m@j@@z@@@@A@@^@^@ n@n@ f_dddw_searchfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindow2 = dw_parentdw_childcolnameselectedrowf_dddw_searchZ DAT* #LCdatawindow.Cdatawindowchild.SRL x function_objectf_dddw_searchstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindow@qaj@&k@@M0@m@>@@J@@^@^@Aj @q@zs@@ @DAT*_@a)b?LA_@_@d_@q(`@`@2j@j@a@k@k@Ll@l@`m@m@l@@|@@@@A@@A^@^@qryjtn@n@a f_set_value_amtfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindow2 ? dw_objvalval_fldval_amt_fldrow_numf_set_value_amtV DAT*  'BCdatawindow.SSSL x function_objectf_set_value_amtstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindow@!j@(k@@N2@m@@@@L@@`@^@qljt@q@| @ te@stroDAT*2_@a)b?LA_@_@t_@a*`@`@4j@j@QBk@k@aNl@l@!bm@m@n@@~@@A@@A@@^@^@%@n@n@ f_shift_highlightfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindow2 A clicked_rowdw_objectlast_clicked_rowf_shift_highlight< DAT*$Function to find the nearest match in dddwglobal type f_dddw_search from function_object end type forward prototypes global function long f_dddw_search (datawindow dw_parent, datawindowchild dw_child, string colname, ref long selectedrow) end prototypes global function long f_dddw_search (datawindow dw_parent, datawindowchild dw_child, string colname, ref long selectedrow);////////////////////////////////////////////////////////////////////////// // // Function: f_dddw_search // // PuDAT*&rpose: To find the matched data in dddw. // // Scope: Public // // Parameters: // dw_parent (datawindow/value) - Contains the handle of the datawindow // which has the dropdowndatawindow // dw_child (datawindowchild/value) - Contains the handle of the // dropdowndatawindow // colname (string/value) - Contains the name of the column which has // the dropdowndatawindow as its edit style // selectedrow (long/reference) - Contains the row number for the former // selected DAT*(row // // Returns: Long - The row number that matches the closest to what is // typed in // // Log: // 5/??/94 J?W Initial version // 5/31/94 SWJ Commented the line for highlighting the matched row, // Added return value. // 06/05/94, JBWilcox, Do not highlight row if letters discontinue to match // Do not unhighlight if selectedrow is 0 ////////////////////////////////////////////////////////////////////////// string filt long found_row int num_charsDAT** filt = dw_parent.gettext() if Len (filt) > 0 then // Do case-insensitive search found_row = Find (dw_child, "Lower(" + colname + ")>=~"" + Lower(filt) + "~"", & 1, 99999) if found_row > 0 then if lower(filt) <> lower(left(dw_child.getitemstring(found_row, colname), len(filt))) then found_row = 0 end if end if if found_row > 0 then ScrollToRow (dw_child, found_row) // SetRedraw (dw_child, false) SelectRow (dw_child, selectedrow, FALSE)DAT*, // Comment the following line out. Highlighting the row will be // performed by using postevent function in editchanged event of // the datawindow. - swj, 5/94 // SelectRow (dw_child, found_row, TRUE) // SetRedraw (dw_child, true) else // Filter function did not find any matching row //Beep(1) end if else // Filter length is 0, so unhighlight former selected row if selectedrow > 0 then SelectRow (dw_child, selectedrow, FALSE) end if end if selectedrow = fDAT*Yound_row // Remember number of highlighted row return selectedRow end function DAT*0_@Z)b?KA_@_@t_@q)`@`@a3j@j@QAk@k@qMl@l@qam@m@m@@}@@A@@A@@^@^@AY q@q@s@s@0  @ f_del_activitiesfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactiondynamicstagingareasqlsan,act_cur4_DAT*KAKA\KADelete from Rap_Activities Where Rap_Activities.Rid =0 56KAf_db_error  $ \ `  2 2 nparentridtransbdeletef_del_activities>  ILRCtransaction.B xDAT*  QLCdatawindow.L x function_objectf_shift_highlightstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindow on@ecte_stru*re@ent4t@fileBn@messNnd@ildbem@evienec@info~ct@awin ca@owt @@DAT*6_@a)b?LA_@_@d_@'`@`@1j@j@?k@k@Kl@l@_m@m@k@@{@@@@A@@^@^@qz n@n@8w f_validate_actfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindowf_check_datesf_qc_act_data_12 b dw_objrow_numDAT*level_typesource_codedevice_codeprocess_codestream_codef_validate_actp  ".:GBCdatawindow.LSSSSS x function_objectf_validate_actstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindow@aj@'k@@N1@m@?DAT*H_@b)b?LA_@_@_@(`@`@2j@j@@k@k@Ll@l@`m@m@al@@Q|@@@@@@^@^@k@s@s@ q@q@ @ t@0 f_validate_codefunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdynamicstagingareasqlsa,cursor1DAT*<Delete from rap_activitiesglobal type f_del_activities from function_object end type forward prototypes global function integer f_del_activities (long nparentrid, ref transaction trans, boolean bdelete) end prototypes global function integer f_del_activities (long nparentrid, ref transaction trans, boolean bdelete);// Function to perform cascading delete. Three arguments are // required: // nParentRid - The unique RID of the record to delete // Trans - The transaction object to use, uDAT*>sually sqlca // bDelete - Set to true for delete, FALSE gives only the count // of records that would be deleted. // The function returns the number of records deleted, or -1 if // an error occurs. Check the value of sqlcode to determine the // error when the function returns -1. //////////////////////////////////////////////////////////////////// long nCount = 0 // Number of records processed long nInd = 0 // Return indicator for functions long nRid string szSelection DAT*@ // Base the selection on the value of nParentRid if nParentRid < 0 then nParentRid = -nParentRid szSelection = "Select Rid from Rap_Activities where Ref_Rid = ?" else szSelection = "Select Rid from Rap_Activities where Rid = ?" end if // Prepare the cursor DECLARE act_cur DYNAMIC CURSOR FOR sqlsa; PREPARE sqlsa FROM :szSelection USING Trans; OPEN DYNAMIC act_cur USING :nParentRid; // Process each record DO WHILE Trans.sqlcode = 0 FETCH act_cur into :nRid; // ProDAT*Bcess the children if Trans.sqlcode = 0 then nInd = 0 // No Children if nInd >= 0 then nCount = nCount + nInd end if end if // Process the current record if Trans.sqlcode = 0 AND bDelete then Delete from Rap_Activities Where Rap_Activities.Rid = :nRid USING Trans; end if // Update the counter if Trans.sqlcode = 0 then nCount = nCount + 1 LOOP // Notify the user if something bad happened if Trans.sqlcode <> 0DAT* AND Trans.sqlcode <> 100 then f_db_error(Trans, "f_del_Activities") nCount = -1 end if Close act_cur; f_db_error(Trans, "f_del_Activities - Close failed") return nCount end function DAT*F_@Z)b?KA_@_@d_@a"`@`@q,j@j@:k@k@Fl@l@Zm@m@f@@v@@@@@@q^@^@qew cq@q@as@s@aan otarK +e_@ f_del_appfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactiondynamicstagingareasqlsa,app_curDAT*KAKATKAf_del_docsqlcaDelete from rap_applications Where rid =0 ()KAf_db_error   T X  2 + nparentridtransbdeletef_del_app=  LLCtransaction.BDAT*LAtransactionsqlcaarLA(N`LAf_db_error  ( ` d 2 0 codeattr_nametab_namef_validate_code1  BSSS x function_objectf_validate_codestructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchDAT*L_@b)b?LA_@_@_@+`@`@5j@j@Ck@k@Ol@l@cm@m@ao@@@@@@A@@^@^@ n@n@ f_validate_dev_profunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindow2 * dw_objrow_numf_validate_dev_pro/  DAT*BCdatawindow.L x function_objectf_validate_dev_prostructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindow@j@+k@@L5@m@aCQ@@O@@c@^@o@@s@ @ @t @@ @ @DAT*^_@b)b?LA_@_@_@+`@`@5j@j@Ck@k@Ol@l@cm@m@o@@@@A@@A@@A^@^@qryjtn@n@a f_validate_geo_locfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindow2 * dw_objrow_numf_validate_geo_loc/  DAT*RDelete from rap_applicationsglobal type f_del_app from function_object end type forward prototypes global function long f_del_app (long nparentrid, transaction trans, boolean bdelete) end prototypes global function long f_del_app (long nparentrid, transaction trans, boolean bdelete);// Function to perform cascading delete. Three arguments are // required: // nParentRid - The unique RID of the record to delete // Trans - The transaction object to use, usually sqlca // bDelete - Set toDAT*T true for delete, FALSE gives only the count // of records that would be deleted. // The function returns the number of records deleted, or -1 if // an error occurs. Check the value of sqlcode to determine the // error when the function returns -1. // This function deletes all document lookups for a given document. //////////////////////////////////////////////////////////////////// long nCount = 0 // Number of records processed long nInd = 0 // Return indicator for functioDAT*Vns long ll_rid string ls_sql if nParentRid < 0 then nParentRid = -nParentRid ls_sql = 'select rid from rap_applications where source_rid = ?' else ls_sql = 'select rid from rap_applications where rid = ?' end if // Prepare the cursor declare app_cur dynamic cursor for sqlsa; prepare sqlsa from :ls_sql using trans; open dynamic app_cur using :nParentRid; // Process each record do while trans.sqlcode = 0 fetch app_cur into :ll_rid; // Process the children if trans.sqlDAT*Xcode = 0 then nInd = f_del_doc(-ll_rid, 'app', trans, bDelete) if nInd >= 0 then nCount = nCount + nInd end if // Process the current record if trans.sqlcode = 0 and bDelete then Delete from rap_applications Where rid = :ll_rid; end if // Update the counter if Trans.sqlcode = 0 then nCount = nCount + 1 loop // Notify the user if something bad happened if Trans.sqlcode <> 0 AND Trans.sqlcode <> 100 then f_db_error(Trans, "f_del_app") nCount = -1 endDAT*e if close app_cur; f_db_error(trans, 'f_del_app - Close failed') return nCount end function DAT*\_@Z)b?KA_@_@_@+`@`@5j@j@aCk@k@Ol@l@cm@m@o@@@@@@A@@^@^@Ah q@q@s@s@ |<@G@ f_del_cal_protocolfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactiondynamicstagingareasqlsa,cur_calcsDAT*KAKA`KAf_del_method_metricsDelete from Rap_Calculation_Protocols Where Rap_Calculation_Protocols.Rid =0 KLKAf_db_error  ( ` d  2 4 nparentridtransbdeletef_del_cal_protocol> DAT*BCdatawindow.L x function_objectf_validate_geo_locstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindow on@ect_dros+ai@ipie5me@ailfCti@ailmOaw@wchicwi@treeoon@ionibj@data @nt 8@ @ @DAT*b_@b)b?LA"_@_@_@2`@`@<j@j@Jk@k@Vl@l@jm@m@v@@@@a@@a@@A^@^@qryjtn@n@a f_validate_legal_relationfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindow2 1 dw_objrow_numf_validate_legal_relation/ DAT* BCdatawindow.L x function_objectf_validate_legal_relationstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindow on@ect_gocs2ai@ipie<me@ailfJti@ailmVaw@wchijwi@treevon@ionibj@data @i n@on Ks@DAT*tNOT USED. Function to validate if location entered exists in the rap_geographic_locations tableglobal type f_validate_location from function_object end type forward prototypes global function boolean f_validate_location (string p_value, string p_column, long p_city, long p_state, long p_nation) end prototypes global function boolean f_validate_location (string p_value, string p_column, long p_city, long p_state, long p_nation);string ls_sql long ls_var1, ls_var2 string ls_name integer DAT*hDelete from rap_cal_protocolsglobal type f_del_cal_protocol from function_object end type forward prototypes global function long f_del_cal_protocol (long nparentrid, ref transaction trans, boolean bdelete) end prototypes global function long f_del_cal_protocol (long nparentrid, ref transaction trans, boolean bdelete);// Function to perform cascading delete. Three arguments are // required: // nParentRid - The unique RID of the record to delete // Trans - The transaction object to useDAT*j, usually sqlca // bDelete - Set to true for delete, FALSE gives only the count // of records that would be deleted. // The function returns the number of records deleted, or -1 if // an error occurs. Check the value of sqlcode to determine the // error when the function returns -1. //////////////////////////////////////////////////////////////////// long nCount = 0 // Number of records processed long nInd = 0 // Return indicator for functions long nRid string szSelectionDAT*l // Base the selection on the value of nParentRid if nParentRid < 0 then nParentRid = -nParentRid szSelection = "Select Rid from Rap_Calculation_Protocols where Rid = ?" else szSelection = "Select Rid from Rap_Calculation_Protocols where Rid = ?" end if // Prepare the cursor DECLARE cur_calcs DYNAMIC CURSOR FOR sqlsa; PREPARE sqlsa FROM :szSelection USING Trans; OPEN DYNAMIC cur_calcs USING :nParentRid; // Process each record DO WHILE Trans.sqlcode = 0 FETCH cur_caDAT*nlcs into :nRid; // Process the children if Trans.sqlcode = 0 then nInd = f_del_Method_Metrics(-nRid, Trans, bDelete) if nInd >= 0 then nCount = nCount + nInd end if end if // Process the current record if Trans.sqlcode = 0 AND bDelete then Delete from Rap_Calculation_Protocols Where Rap_Calculation_Protocols.Rid = :nRid USING Trans; end if // Update the counter if Trans.sqlcode = 0 then nCount = nCount + 1 DAT* LOOP // Notify the user if something bad happened if Trans.sqlcode <> 0 AND Trans.sqlcode <> 100 then f_db_error(Trans, "f_del_Cal_Protocol") nCount = -1 end if Close cur_calcs; f_db_error(Trans, "f_del_Cal_Protocol - Close failed") return nCount end function DAT*r_@Z)b?KA_@_@_@*`@`@a4j@j@aBk@k@Nl@l@bm@m@n@@~@@@@A@@^@^@W q@q@|*'0 f_del_connectionsfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactionSelect Count ( *) From Rap_Connections Where From_Device_Rid =0 OR To_Device_Rid =0 >?RSDAT*KATKADelete from Rap_Connections Where From_Device_Rid =0 OR To_Device_Rid =0 34GHKAf_db_error T X  2 3 nparentridtransbdeletef_del_connections>  ILRCtransaction.B x funcDAT*cnt = 0 if isnull(p_value) or len(trim(p_value)) < 1 then return true end if if gs_database = 'ORACLE' then // ls_sql = "SELECT DISTINCT rap_geographic_locations_d.name " + & // "from rap_geographic_locations rap_geographic_locations_a, " + & // " rap_geographic_locations rap_geographic_locations_b, " + & // " rap_geographic_locations rap_geographic_locations_c, " + & // " rap_geographic_locations rap_geographic_locations_d " + & // " where rap_geographic_locationDAT*xFunction to validate input for Process Schedules.global type f_validate_pro_schedule from function_object end type forward prototypes global function boolean f_validate_pro_schedule (datawindow dw_obj, long row_num) end prototypes global function boolean f_validate_pro_schedule (datawindow dw_obj, long row_num);string ls_year, ls_begin_month, ls_end_month string ls_begin_day, ls_end_day, ls_begin_hr, ls_end_hr ls_year = dw_obj.GetItemString(row_num, "year") if IsNull(ls_year) or ls_DAT*year = '' then MessageBox("DataWindow Error", "Sorry! Year is required", Information!) dw_obj.SetFocus() dw_obj.SetRow(row_num) dw_obj.SetColumn("year") dw_obj.ScrollToRow(row_num) return FALSE end if ls_begin_month = dw_obj.GetItemString(row_num, "begin_month_no") if IsNull(ls_begin_month) or ls_begin_month = '' then MessageBox("DataWindow Error", "Sorry! Start Month is required", Information!) dw_obj.SetFocus() dw_obj.SetRow(row_num) dw_obj.SetColumn("begin_monDAT*|Delete from rap_connectionsglobal type f_del_connections from function_object end type forward prototypes global function integer f_del_connections (long nparentrid, ref transaction trans, boolean bdelete) end prototypes global function integer f_del_connections (long nparentrid, ref transaction trans, boolean bdelete);// Function to perform cascading delete. Three arguments are // required: // nParentRid - The unique RID of the record to delete // Trans - The transaction object to usDAT*~e, usually sqlca // bDelete - Set to true for delete, FALSE gives only the count // of records that would be deleted. // The function returns the number of records deleted, or -1 if // an error occurs. Check the value of sqlcode to determine the // error when the function returns -1. //////////////////////////////////////////////////////////////////// long nCount = 0 // Number of records processed long nInd = 0 // Return indicator for functions if nParentRid < 0 then nPaDAT*rentRid = -nParentRid // Process the current record Select Count(*) into :nInd From Rap_Connections Where From_Device_Rid = :nParentRid OR To_Device_Rid = :nParentRid USING Trans; if Trans.sqlcode = 0 AND bDelete then Delete from Rap_Connections Where From_Device_Rid = :nParentRid OR To_Device_Rid = :nParentRid USING Trans; end if // Update the counter if Trans.sqlcode = 0 then nCount = nInd // Notify the user if something bad haDAT*ppened if Trans.sqlcode <> 0 AND Trans.sqlcode <> 100 then f_db_error(Trans, "f_del_Connections") nCount = -1 end if return nCount end function DAT*_@Z)b?KA_@_@_@.`@`@8j@j@Fk@k@Rl@l@fm@m@r@@@@@@A@@^@^@Oq@q@0 f_del_contact_reasonsfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactionSelect Count ( *) From Rap_Contact_Reasons Where Contact_Rid =0 >?DAT*KA@KADelete from Rap_Contact_Reasons Where Contact_Rid =0 34|KAf_db_error @ D  2 7 nparentridtransbdeletef_del_contact_reasons>  ILRCtransaction.B x function_objectf_del_contact_reasonsstructDAT*_@c)b?MA_@_@T_@!'`@`@A1j@j@A?k@k@AKl@l@_m@m@ak@@{@@A@@A@@^@^@2n@n@ f_validate_srcfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindow2 & dw_objrow_numf_validate_src/  DAT*BCdatawindow.L x function_objectf_validate_srcstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindow on@ect_pched'ur@ilre1vi@ent?sc@ionKe@wind_st@itemkte@nnec{ow@ject w@otot h@@ @ @ DAT*_@c)b?MA_@_@d_@a'`@`@a1j@j@Q?k@k@!Kl@l@q_m@m@ak@@{@@a@@a@@^@^@0  y! eq@    ' f_window_closefunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectgi_geo_numgi_source_numgi_DAT*Delete from rap_contact_reasonsglobal type f_del_contact_reasons from function_object end type forward prototypes global function int f_del_contact_reasons (long nparentrid, ref transaction trans, boolean bdelete) end prototypes global function int f_del_contact_reasons (long nparentrid, ref transaction trans, boolean bdelete);// Function to perform cascading delete. Three arguments are // required: // nParentRid - The unique RID of the record to delete // Trans - The transaction objeDAT*ct to use, usually sqlca // bDelete - Set to true for delete, FALSE gives only the count // of records that would be deleted. // The function returns the number of records deleted, or -1 if // an error occurs. Check the value of sqlcode to determine the // error when the function returns -1. // This function deletes all contact reasons for a given contact. //////////////////////////////////////////////////////////////////// long nCount = 0 // Number of records processed long DAT*nInd = 0 // Return indicator for functions if nParentRid < 0 then nParentRid = -nParentRid // Process the current record Select Count(*) into :nInd From Rap_Contact_Reasons Where Contact_Rid = :nParentRid USING Trans; if Trans.sqlcode = 0 AND bDelete then Delete from Rap_Contact_Reasons Where Contact_Rid = :nParentRid USING Trans; end if // Update the counter if Trans.sqlcode = 0 then nCount = nInd // Notify the user if something bad happened iDAT*f Trans.sqlcode <> 0 then f_db_error(Trans, "f_del_Contact_Reasons") nCount = -1 end if return nCount end function DAT*_@Z)b?KA_@_@_@'`@`@1j@j@?k@k@Kl@l@_m@m@k@@{@@@@A@@^@^@Oq@q@s@s@< o$den/@ f_del_contactsfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactiondynamicstagingareasqlsal,cur_contactsDAT*KAKA(N`KAf_del_contact_reasonsDelete from Rap_Contacts Where Rap_Contacts.Rid =0 12KAf_db_error  ( ` d  2 0 nparentridtransbdeletef_del_contacts>  DAT*device_numgi_process_numgl_cur_rowgl_geo_ridgl_source_ridgl_device_ridgd_process_rid2  win_namef_window_close QS x function_objectf_window_closestructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobject on@ect_struc'ec@nte1m@iled?m@essaKDAT*Keeps track of the number of windows which refer to the gl_geo_rid, gl_source_rid, gl_device_rid, gl_process_rid.global type f_window_count from function_object end type forward prototypes global subroutine f_window_count (string win_name) end prototypes global subroutine f_window_count (string win_name);choose case win_name case 'geo' gi_geo_num = gi_geo_num + 1 case 'source' if gi_geo_num > 0 then gi_geo_num = gi_geo_num + 1 end if gi_source_num = gi_source_num + 1 DAT* case 'device' gi_source_num = gi_source_num + 1 gi_device_num = gi_device_num + 1 case 'process' gi_source_num = gi_source_num + 1 gi_device_num = gi_device_num + 1 gi_process_num = gi_process_num + 1 case 'connection' gi_source_num = gi_source_num + 1 gi_device_num = gi_device_num + 1 case 'stream' gi_source_num = gi_source_num + 1 gi_device_num = gi_device_num + 1 gi_process_num = gi_process_num + 1 // gi_stream_num = gi_stream_num + 1 end choose end subrDAT*_@d)b?MA _@_@_@a%`@`@a/j@j@q=k@k@aIl@l@q]m@m@qi@@y@@@@@@^@^@qS f_write_linefunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobject2 ; pi_file_numps_fileps_headerps_textf_write_line> DAT*Delete from rap_contactsglobal type f_del_contacts from function_object end type forward prototypes global function integer f_del_contacts (long nparentrid, ref transaction trans, boolean bdelete) end prototypes global function integer f_del_contacts (long nparentrid, ref transaction trans, boolean bdelete);// Function to perform cascading delete. Three arguments are // required: // nParentRid - The unique RID of the record to delete // Trans - The transaction object to use, usually sDAT*qlca // bDelete - Set to true for delete, FALSE gives only the count // of records that would be deleted. // The function returns the number of records deleted, or -1 if // an error occurs. Check the value of sqlcode to determine the // error when the function returns -1. //////////////////////////////////////////////////////////////////// long nCount = 0 // Number of records processed long nInd = 0 // Return indicator for functions long nRid string szSelection // BaseDAT* the selection on the value of nParentRid if nParentRid < 0 then nParentRid = -nParentRid szSelection = "Select Rid from Rap_Contacts where Ref_Rid = ?" else szSelection = "Select Rid from Rap_Contacts where Rid = ?" end if // Prepare the cursor DECLARE cur_contacts DYNAMIC CURSOR FOR sqlsa; PREPARE sqlsa FROM :szSelection USING Trans; OPEN DYNAMIC cur_contacts USING :nParentRid; // Process each record DO WHILE Trans.sqlcode = 0 FETCH cur_contacts into :nRid; //DAT* Process the children if Trans.sqlcode = 0 then nInd = f_del_Contact_Reasons(-nRid, Trans, bDelete) if nInd >= 0 then nCount = nCount + nInd end if end if // Process the current record if Trans.sqlcode = 0 AND bDelete then Delete from Rap_Contacts Where Rap_Contacts.Rid = :nRid USING Trans; end if // Update the counter if Trans.sqlcode = 0 then nCount = nCount + 1 LOOP // Notify the user if something bad happDAT*ened if Trans.sqlcode <> 0 AND Trans.sqlcode <> 100 then f_db_error(Trans, "f_del_Contacts") nCount = -1 end if Close cur_contacts; f_db_error(Trans, "f_del_Contacts - Close failed") return nCount end function DAT*_@Y)b?KA_@_@_@&`@`@0j@j@>k@k@Jl@l@^m@m@j@@z@@@@A@@a^@^@aemjeq@q@as@s@qct ycsg@@0n 1 @ f_del_devicesfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectiDAT*oninfopowerobjecttransactiondynamicstagingareasqlsa,cur_devicesKAKA\KAf_del_group_memberf_del_processesf_del_contactsf_del_location_coordinate_groupsf_del_activitiesf_del_connectionsf_del_leg_ent_relf_del_doc_lookupsqlcaDelete from Rap_Devices Where Rap_Devices.Rid =0 _/0ilj7DAT*&BISSS x function_objectf_write_linestructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobject@j@%k@@K/@m@=@@I@@]@^@qijt@roy@ @o n@on @ DAT*_@d)b?MA_@_@_@/`@`@9j@j@Gk@k@Sl@l@gm@m@s@@@@@@@@A^@^@qryjtq@q@a gf_build_fatal_messagefunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransaction2 4 p_transaction_objectgf_build_fatal_message# DAT* SCtransaction. x function_objectgf_build_fatal_messagestructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransaction on@ectneuctu/ip@env9ai@edesGai@sageSwc@lisgtr@ewitsio@opoe@n+c te@stro h@@ @ DAT*generic function to handle embedded sql error messagesglobal type gf_db_message from function_object end type forward prototypes global function int gf_db_message (transaction p_transaction_object, string p_error_type) end prototypes global function int gf_db_message (transaction p_transaction_object, string p_error_type);// this function displays database error messages based on the type // of error choose case (p_error_type) case "disconnect", "rollback", "commit", "select_one" DAT* if p_transaction_object.sqlcode <> 0 then gs_error_message=gf_build_fatal_message(p_transaction_object) open(w_error_message) end if case "connect" if p_transaction_object.sqlcode <> 0 then if p_transaction_object.sqldbcode = 1017 then messagebox("Connection Error", "Invalid Password", exclamation!) return 1017 else gs_error_message=gf_build_fatal_message(p_transaction_object) open(w_error_message) end if DAT*_@N)b?JA_@_@k_@.`@`@8j@j@Fk@k@Rl@l@fm@m@r@@@@@@@@a^@^@qdojdq@q@a f_get_odbc_connectionfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransaction2 ; p_transps_dsnps_uidps_pwdf_get_odbc_connectionM DAT*J  SCtransaction.RSRSRS x function_objectf_get_odbc_connectionstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransaction on@ectia_pro.tu@ailr8nv@mentFes@tionRge@awinfis@witerit@onnepo@bjec io@DAT*Delete from rap_devicesglobal type f_del_devices from function_object end type forward prototypes global function integer f_del_devices (long nparentrid, ref transaction trans, boolean bdelete) end prototypes global function integer f_del_devices (long nparentrid, ref transaction trans, boolean bdelete);// Function to perform cascading delete. Three arguments are // required: // nParentRid - The unique RID of the record to delete // Trans - The transaction object to use, usually sqlcaDAT* // bDelete - Set to true for delete, FALSE gives only the count // of records that would be deleted. // The function returns the number of records deleted, or -1 if // an error occurs. Check the value of sqlcode to determine the // error when the function returns -1. //////////////////////////////////////////////////////////////////// long nCount = 0 // Number of records processed long nInd = 0 // Return indicator for functions long nRid string szSelection // Base theDAT* selection on the value of nParentRid if nParentRid < 0 then nParentRid = -nParentRid szSelection = "Select Rid from Rap_Devices where Source_Rid = ?" else szSelection = "Select Rid from Rap_Devices where Rid = ?" end if // Prepare the cursor DECLARE cur_devices DYNAMIC CURSOR FOR sqlsa; PREPARE sqlsa FROM :szSelection USING Trans; OPEN DYNAMIC cur_devices USING :nParentRid; // Process each record DO WHILE Trans.sqlcode = 0 FETCH cur_devices into :nRid; // ProcesDAT*s the children if Trans.sqlcode = 0 then nInd = f_del_group_member(nRid, Trans, bDelete) if nInd >= 0 then nCount = nCount + nInd nInd = f_del_Processes(-nRid, Trans, bDelete) end if if nInd >= 0 then nCount = nCount + nInd nInd = f_del_Contacts(-nRid, Trans, bDelete) end if if nInd >= 0 then nCount = nCount + nInd nInd = f_del_location_coordinate_groups(-nRid, Trans, bDelete) end if if nInd >= 0 DAT*then nCount = nCount + nInd nInd = f_del_Activities(-nRid, Trans, bDelete) end if if nInd >= 0 then nCount = nCount + nInd nInd = f_del_Connections(-nRid, Trans, bDelete) end if if nInd >= 0 then nCount = nCount + nInd nInd = f_del_leg_ent_rel(-nRid, Trans, bDelete) end if if nInd >= 0 then nCount = nCount + nInd nInd = f_del_doc_lookup(-nRid, '', Trans, bDelete) end if if nInd >DAT*= 0 then nCount = nCount + nInd end if // Process the current record if Trans.sqlcode = 0 AND bDelete then Delete from Rap_Devices Where Rap_Devices.Rid = :nRid; end if // Update the counter if Trans.sqlcode = 0 then nCount = nCount + 1 LOOP // Notify the user if something bad happened if Trans.sqlcode <> 0 AND Trans.sqlcode <> 100 then f_db_error(Trans, "f_del_Devices") nCount = -1 end if Close cur_devices; f_db_error(Trans, "f_dDAT*<el_Devices - Close failed") return nCount end function DAT*_@Y)b?KA_@_@_@"`@`@,j@j@:k@k@Fl@l@Zm@m@f@@v@@A@@A@@^@^@AY q@q@s@s@0  @ @ f_del_docfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactiondynamicstagingareasqlsa,doc_curDAT*KAKATKAf_del_doc_lookupsqlcaDelete from rap_documents Where rid =0 %&KAf_db_error   T X  2 4 pl_ridps_parentptranspb_deletef_del_docJ   DAT*_@N)b?JA_@_@l_@'`@`@1j@j@?k@k@Kl@l@_m@m@k@@{@@@@@@A^@^@qryjtromq@q@alo rp+o|@ f_get_sequencefunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectgs_databasetransactionsqlcaselect rid_storage_seq.nextval from sys.dual DAT*LJA r4JAf_db_errorselect rid from rid_storage for update of rid {JA0JAupdate rid_storage set rid =0 @ JA 4 8    @D 2  f_get_sequence DAT*_@N)b?JA#_@_@m_@3`@`@=j@j@Kk@k@Wl@l@km@m@w@@@@@@@@^@^@! q@q@p^ x  f_get_measurement_for_unitfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactionsqlcaSELECT rap_units.meas_code FROM rap_units WHERE rap_units.code =' ' DAT*N@CJAPJAf_sqlcheck P T 2 / as_unitcodef_get_measurement_for_unit SS x function_objectf_get_measurement_for_unitstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactionDAT*_@O)b?JA_@_@Dn_@q"`@`@a,j@j@a:k@k@aFl@l@aZm@m@af@@av@@@@@@^@^@Ald p@p@n@n@q@q@ f_get_sqlfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectwindowdatawindowtransactionsqlca2 & p_winp_dwp_DAT*Delete from rap_documentsglobal type f_del_doc from function_object end type forward prototypes global function long f_del_doc (long pl_rid, string ps_parent, transaction ptrans, boolean pb_delete) end prototypes global function long f_del_doc (long pl_rid, string ps_parent, transaction ptrans, boolean pb_delete);// Function to perform delete on rap_documents tables. // Three arguments are required: // pl_rid - The unique RID of the record to delete // ps_parent - String to indicate DAT*its parent type // ptrans - The transaction object to use, usually sqlca // pb_delete - Set to true for delete, FALSE gives only the count // of records that would be deleted. // The function returns the number of records deleted, or -1 if // an error occurs. Check the value of sqlcode to determine the // error when the function returns -1. // This function deletes the document record from // rap_documents table and its children record from tables // rap_document_lookups if DAT*any. //////////////////////////////////////////////////////////////////// long nCount = 0 // Number of records processed long nInd = 0 // Return indicator for functions long ll_rid string ls_sql if pl_rid < 0 then pl_rid = -pl_rid if ps_parent = 'form' then ls_sql = 'select rid from rap_documents where form_rid = ?' elseif ps_parent = 'app' then ls_sql = 'select rid from rap_documents where application_rid = ?' else MessageBox('f_del_doc', 'Invalid parent type - ' + pDAT*s_parent) return -1 end if else ls_sql = 'select rid from rap_documents where rid = ?' end if // Prepare the cursor declare doc_cur dynamic cursor for sqlsa; prepare sqlsa from :ls_sql using ptrans; open dynamic doc_cur using :pl_rid; // Process each record do while ptrans.sqlcode = 0 fetch doc_cur into :ll_rid; // Process the children if ptrans.sqlcode = 0 then nInd = f_del_doc_lookup(ll_rid, 'doc', ptrans, pb_delete) if nInd >= 0 then nCount = nCount + nInd endDAT* if // Process the current record if ptrans.sqlcode = 0 and pb_delete then Delete from rap_documents Where rid = :ll_rid; end if // Update the counter if ptrans.sqlcode = 0 then nCount = nCount + 1 loop // Notify the user if something bad happened if pTrans.sqlcode <> 0 AND pTrans.sqlcode <> 100 then f_db_error(ptrans, "f_del_doc") nCount = -1 end if close doc_cur; f_db_error(ptrans, 'f_del_doc - Close failed') return nCount end function DAT*_@Y)b?KA_@_@_@)`@`@3j@j@Ak@k@aMl@l@aam@m@m@@}@@@@@@^@^@AK q@q@s@s@2 S @@ f_del_doc_lookupfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactiondynamicstagingareasqlsa,doclook_curDAT*KAKAj`KAsqlcaDelete from rap_document_lookups Where rid =0 ,-KAf_db_error  ( ` d  2 ; pl_ridps_parentptranspb_deletef_del_doc_lookupJ   DAT*\columnf_get_sqlC   SCwindow.Cdatawindow.S x function_objectf_get_sqlstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectwindowdatawindowtransaction,#@j@"k@@W,@m@:@@F@@Z@^@!f @q@v @DAT*_@O)b?JA _@_@do_@a0`@`@q:j@j@Hk@k@Tl@l@hm@m@t@@@@A@@A@@A^@^@qryjtn@n@ainelor f_dw_get_objects_attribfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindowf_get_tokenf_dw_get_attributes2 d dw_aDAT*^rgobj_listobj_typebandattributesf_dw_get_objects_attribod XY  %.3ICdatawindow.RS[]SSS x function_objectf_dw_get_objects_attribstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindow@qaj@0k@@F:@mDAT*_@O)b?JA_@_@tp_@q%`@`@a/j@j@q=k@k@qIl@l@]m@m@i@@y@@@@@@^@^@*#`@p@ v@v@al f_get_stringfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectstr_parmsw_get_stringmessage2 G as_DAT*Delete from rap_document_lookupsglobal type f_del_doc_lookup from function_object end type forward prototypes global function long f_del_doc_lookup (long pl_rid, string ps_parent, transaction ptrans, boolean pb_delete) end prototypes global function long f_del_doc_lookup (long pl_rid, string ps_parent, transaction ptrans, boolean pb_delete);// Function to perform cascading delete. Three arguments are // required: // pl_rid - The unique RID of the record to delete // ps_parent - StringDAT* to indicate its parent type // ptrans - The transaction object to use, usually sqlca // pb_delete - Set to true for delete, FALSE gives only the count // of records that would be deleted. // The function returns the number of records deleted, or -1 if // an error occurs. Check the value of sqlcode to determine the // error when the function returns -1. // This function deletes all document lookups for a given document. //////////////////////////////////////////////////////////DAT*////////// long nCount = 0 // Number of records processed long nInd = 0 // Return indicator for functions long ll_rid string ls_sql if pl_rid < 0 then pl_rid = -pl_rid ls_sql = 'select rid from rap_document_lookups where ref_rid = ?' else if ps_parent = 'doc' then ls_sql = 'select rid from rap_document_lookups where document_rid = ?' else ls_sql = 'select rid from rap_document_lookups where rid = ?' end if end if // Prepare the cursor declare doclook_cur dynamic cDAT*ursor for sqlsa; prepare sqlsa from :ls_sql using ptrans; open dynamic doclook_cur using :pl_rid; // Process each record do while ptrans.sqlcode = 0 fetch doclook_cur into :ll_rid; // Process the current record if ptrans.sqlcode = 0 and pb_delete then Delete from rap_document_lookups Where rid = :ll_rid; end if // Update the counter if ptrans.sqlcode = 0 then nCount = nCount + 1 loop // Notify the user if something bad happened if pTrans.sqlcode <> 0 AND pDAT*Trans.sqlcode <> 100 then f_db_error(ptrans, "f_del_doc_lookup") nCount = -1 end if close doclook_cur; f_db_error(ptrans, 'f_del_doc_lookup - Close failed') return nCount end function DAT*_@Y)b?KA_@_@t_@a.`@`@a8j@j@qFk@k@Rl@l@fm@m@r@@@@A@@A@@^@^@a`U q@q@X f_del_emission_factorfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactionSelect Count ( *) From Rap_emission_factors Where profile_code =' ' @CDAT*KAD KADelete from Rap_emission_factors Where profile_code =' ' 58KASelect Count ( *) From Rap_emission_factors Where process_rid =0 and profile_code =' ' ?@SVPKAXKADelete from Rap_emission_factors Where process_rid =0 and profile_code =' DAT*`titleai_max_lenas_char_caseas_current_valuef_get_string> )SSISS x function_objectf_get_stringstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectstr_parmsw_get_stringmessage, on@ectbj_att%ur@ilre/vi@ent=sc@ionIe@wind]st@iteDAT*_@O)b?JA_@_@dq_@,`@`@Q6j@j@Dk@k@Pl@l@dm@m@p@@@@@@A@@