TOOLBOX FUNCTION: Update SQL Widths in COINS Administrative Database when Data Exceeds Format Modules Affected: All Versions Affected: Version 7 The discussion of this Toolbox utility program is divided into the following sections: Purpose... 1 Accessing the Data Exceed Format Function... 2 Listing SQL Widths... 5 Updating SQL Widths... 7 Updating Individual Fields... 9 Updating All Fields... 10 Purpose CMS users occasionally encountered SQL width-related errors with the COINS administration database. This same issue was addressed with the COINS accounting database in Toolbox document TB-SA001. To remedy this problem, SHAKER created a new Toolbox function that can identify the character fields storing more data than the SQL width format of the field. Users can then increase the SQL widths of these fields. This will save time when using the COINS administration database. Important! This Toolbox program changes important information in your COINS database. You must have a current, verified backup before running the program. Contact SHAKER Support immediately if you suspect that this Toolbox program has not finished. 01/18/06, rev. 7/25/06 1 Copyright 2006, Shaker Computer & Management Services, Inc.
Accessing the Data Exceed Format Function Follow the steps listed below to access the Data Exceed Format Toolbox function. 1. Sign into COINS and go to the Application Menu. 2. Select System Administrator from the Application Menu. 3. Select User-defined Reports from the System Administrator Menu. The Enter Report Name prompt appears (see Figure 1). Figure 1: User-Defined Reports Screen 01/12/06 C O I N S /dv/act/97c2 System Administrator Menu 1. Backup/Restore Menu 2. Database Administration Menu 3. User Log 4. Update the PR Tax Tables 5. Escape to Operating System 6. Cold Utilities 7. Clear Upgrade File Locks 8. Activate COINS Software 96. User-defined Reports X. Exit User-defined Reports Enter Report Name* satb05.p Enter data or press F4 to end. 4. Enter satb05.p at the Enter Report Name* prompt. 5. The system prompts for the licensing code for this Toolbox item (see Figure 2). Enter the code supplied by your SHAKER representative. Figure 2: Licensing Code Screen 10/10/00 T O O L B O X UTEST +-------------------------------------+ Enter Licensing Code: xxxx-xxxx-xxxx +-------------------------------------+ 01/18/06, rev. 7/25/06 2
6. A warning screen appears when the licensing code is correctly entered, as shown in Figure 3, to remind you that you need to back up the database before running the Toolbox program. Enter Y at the prompt to continue to the next screen. Figure 3: SQL Update Warning 01/12/06 C O I N S /dv/act/97c2 This program will update SQL widths in COINS Admin database. You must have a current, verified data backup before running it. Contact SHAKER Support immediately if you suspect that the program did not finish running. Do you wish to continue? Y 7. The next screen displays the List or Update SQL Widths (L/U) prompt, as shown in Figure 4. Use this screen to either list or update SQL widths in the COINS administration database, as follows: If you select L to list the SQL widths, follow the steps in the Listing SQL Widths section. If you select U to update the SQL widths, follow the steps in the Updating SQL Widths section. 01/18/06, rev. 7/25/06 3
Figure 4: List or Update SQL Widths Prompt Data Exceed Format in COINSADM List or Update SQL Widths (L/U): L Field Definitions List or Update SQL Widths (L/U) Select one of the following to either list or update the SQL widths: L (List) U (Update) When you choose this option, the database is connected in multi-user mode if there is a server for the database, or in single-user mode if there is no server. This function scans the number of records specified for the selected database. You can specify how many records to scan in a file, and what fields and files to scan. If you choose this option, the system attempts to connect to the database in single-user mode, and the following may occur: If the database you want to connect to is running in multiuser mode, the following message appears: The database [the database name] must be started in singleuser mode to Update SQL Widths. You must run "Stop Database Server" function first to continue. If the database you want to connect to is already connected in single-user mode, the following message appears: The database [the database name] is already connected in single-user mode. If the system cannot create or open the log file, the following message appears: Unable to open or create log file. After connecting to the database, the system displays any fields storing more data than the format of the field, and allows you to update the SQL format of these fields. 01/18/06, rev. 7/25/06 4
Listing SQL Widths Follow the steps below if you would like to display a listing of the SQL widths in the COINS administrative database. 1. Select L at the List or Update SQL Widths (L/U) prompt (see Figure 4). The selection screen appears, as shown in Figure 5. Figure 5: Selection Screen Data Exceed Format in COINSADM Starting File Name: Ending File Name: Starting Field Name: Ending Field Name: Number of Records to Scan: 0 Field Definitions Starting/Ending File Name Enter a Starting File Name and Ending File Name (e.g., ui_presets). If you leave these fields blank, the system scans all files, and this can be timeconsuming. Starting/Ending Field Name Enter a Starting Field Name (e.g., ups_name) and Ending Field Name (e.g., ups_value). If you leave these fields blank, the system scans all fields, and this can be time-consuming. Number of Records to Scan You must enter the Number of Records to Scan (e.g., 10). This value represents the number of records to be scanned in the database files, not the number of records to be displayed. The number of records you scan in each file increases the length of time this function takes to run. 2. Once you have entered the information above, the screen appears with a listing of SQL widths, as shown in Figure 6. When you select /, a strip menu appears at the bottom of the screen. 01/18/06, rev. 7/25/06 5
Figure 6: SQL Widths Listing Data Exceed Format SQL Stored File Name Field name Width Format Length sa_cold sco_notes 16 x(8) 37 sa_database sdb_comments 10 x(5) 17 sa_database sdb_extrachc8 16 x(8) 76 sa_fixdone saf_extrachc1 80 x(40) 81 sa_functions sfu_prog 20 x(10) 30 sa_xtra sxt_extrachc3 16 x(8) 200 ui_errmsg uem_message 80 x(40) 187 ui_presets ups_dialogid 20 x(10) 41 ui_presets ups_name 32 x(16) 50 ui_presets ups_parsedvalue 140 x(70) 6858 ui_presets ups_value 60 x(70) 5694 ui_sessionid uis_appservid 20 x(10) 72 Print Search Exit Strip Menu Definitions Print Use this option to print all information displayed on the screen. Search Exit Use this option to find a particular file. This option returns you to the System Administrator Menu (see Figure 1), where you can either exit the menu or begin the Toolbox function again. 3. Select one of the strip menu options above. When finished, use Exit to leave the Toolbox function. 01/18/06, rev. 7/25/06 6
Updating SQL Widths Follow the steps below if you would like to update SQL widths in the COINS administrative database. 1. Select U at the List or Update SQL Widths (L/U) prompt (see Figure 4). The screen appears as shown in Figure 7. Figure 7: Selection Screen Data Exceed Format in COINSADM Starting File Name: Ending File Name: Starting Field Name: Ending Field Name: Number of Records to Scan: 0 Field Definitions Starting/Ending File Name Enter a Starting File Name and Ending File Name (e.g., ui_presets). If you leave these fields blank, the system scans all files, and this can be timeconsuming. Starting/Ending Field Name Enter a Starting Field Name (e.g., ups_name) and Ending Field Name (e.g., ups_value). If you these fields blank, the system scans all fields, and this can be time-consuming. Number of Records to Scan Enter the Number of Records to Scan (e.g., 10). This value represents the number of records to be scanned in the database files, not the number of records to be displayed. The number of records you scan in each file increases the length of time this function takes to run. 2. Once you have entered the information above, the next screen appears, as shown in Figure 8. 01/18/06, rev. 7/25/06 7
Figure 8: SQL Widths Listing Data Exceed Format SQL Stored File Name Field name Width Format Length sa_cold sco_notes 16 x(8) 37 sa_database sdb_comments 10 x(5) 17 sa_database sdb_extrachc8 16 x(8) 76 sa_fixdone saf_extrachc1 80 x(40) 81 sa_functions sfu_prog 20 x(10) 30 sa_xtra sxt_extrachc3 16 x(8) 200 ui_errmsg uem_message 80 x(40) 187 ui_presets ups_dialogid 20 x(10) 41 ui_presets ups_name 32 x(16) 50 ui_presets ups_parsedvalue 140 x(70) 6858 ui_presets ups_value 60 x(70) 5694 ui_sessionid uis_appservid 20 x(10) 72 Select choice and press RETURN, or / for menu, or END to exit. 3. You now have the option of either updating a particular field or updating all fields in the database. To update a particular field, follow the steps in the Updating Individual Fields section. To update all fields, follow the steps in the Updating All Fields section. 01/18/06, rev. 7/25/06 8
Updating Individual Fields Follow the steps below to update SQL widths for individual fields in the COINS administrative database. 1. Select a File Name from the list to update the SQL width. The screen shown in Figure 9 appears. Figure 9: Update Screen Data Exceed Format SQL Stored File Name mat Length File Name: sa_cold sa_cold Field Name: sco_notes ) 37 sa_database Stored Length: 37 ) 17 sa_database New SQL Width: 16 ) 76 sa_fixdone 0) 81 sa_functions sfu_prog 20 x(10) 30 sa_xtra sxt_extrachc3 16 x(8) 200 ui_errmsg uem_message 80 x(40) 187 ui_presets ups_dialogid 20 x(10) 41 ui_presets ups_name 32 x(16) 50 ui_presets ups_parsedvalue 140 x(70) 6858 ui_presets ups_value 60 x(70) 5694 ui_sessionid uis_appservid 20 x(10) 72 2. Change the New SQL Width to a larger value (e.g., the stored length) and press Enter. Note: An error message displays if you enter a value exceeding the maximum width of 31995. 3. When you have finished updating individual SQL widths and wish to exit this Toolbox function, select /, then select Exit from the strip menu. 01/18/06, rev. 7/25/06 9
Updating All Fields Follow the steps below to update SQL widths for all fields in the COINS administrative database. 1. When you select / at the bottom of the screen (Figure 8), a strip menu appears, as shown in Figure 10. Figure 10: Strip Menu Options Data Exceed Format SQL Stored File Name Field name Width Format Length sa_cold sco_notes 16 x(8) 37 sa_database sdb_comments 10 x(5) 17 sa_database sdb_extrachc8 16 x(8) 76 sa_fixdone saf_extrachc1 80 x(40) 81 sa_functions sfu_prog 20 x(10) 30 sa_xtra sxt_extrachc3 16 x(8) 200 ui_errmsg uem_message 80 x(40) 187 ui_presets ups_dialogid 20 x(10) 41 ui_presets ups_name 32 x(16) 50 ui_presets ups_parsedvalue 140 x(70) 6858 ui_presets ups_value 60 x(70) 5694 ui_sessionid uis_appservid 20 x(10) 72 Print Search Update All Exit Strip Menu Definitions Print Use this option to print all information displayed on the screen. Search Use this option to find a particular field. Update All Exit Use this option to set all SQL widths to the stored length for all fields displayed. If you want to change SQL widths for individual fields, see the Updating Individual Fields section. This option returns you to the System Administrator Menu (see Figure 1), where you can either exit the menu or begin the Toolbox function again. 2. Select Update All to set all SQL widths to the stored length for all fields displayed. When selected, the following message displays: WARNING: This may take a few minutes. Set all SQL Widths to the Stored Length for all fields displayed (Y/N). 01/18/06, rev. 7/25/06 10
3. Enter Y to update all fields. 4. When the update is complete, the following message appears: RECOMMENDED: Print a report for all Updated SQL Widths (Y/N). The default value is Y. If you select Y, a report is printed. 5. When you have finished updating all SQL widths and wish to exit this Toolbox function, select /, then select Exit from the strip menu. 01/18/06, rev. 7/25/06 11