SQL scripts
Swisslog has a very powerful function
to run SQL Scripts which allows the execution of complicated queries to modify
fields or move data from one field into another. In this way we avoid using
complicated operations in the logbook view. Though, SQL scripts are executed in
seconds and can perform complex operations that can't be done with the available
functions provided by Swisslog.
I have created some scripts which you may
find them very useful. I'm not a SQL expert at all but with help of my knowledge
in Access and a special view to see the SQL code created in queries I could
create it with success.
To run the scripts perform the following
steps:
1. Start SWISSLOG
2. Open Tools | For experts only
| Run SQL Script
3. Select the desired script file which are
found in the SCRIPTS folder (is located as a sub-folder where Swisslog is
installed). Press OK to all confirmation messages.
VERY IMPORTANT: Due to the amount of
checkings and/or data changes some of these scripts may handle, this operation
may take some time. It depends on your computer speed and the number of QSOs in
your database. NO PROGRESSION BAR is displayed! You must wait until you see the
message "SQL script_filename.sql successfully executed" before doing
anything else in Swisslog.
SQL scripts:
NOTE: This script is executed automatically in invisible mode at first Swisslog startup of version 5.9a. You don't need to execute it again if using version 5.9a or higher. It's only explained so that users know what this script performs.
Up to now every time the prefix allocation table of certain entities was changed, a very complicated manual operations should be performed to adapt your QSO to the new situation. Thanks to the powerful SQL script function this operation can be now automatically made in just seconds!
I have created a script which automatically adapt the prefix allocations previously explained by Hardy, DL5SBA (SK) (Montenegro, Cook Islands, Bosnia Herzegowina, Juan de Nova and Europe, Glorious, Tromelin, South Sudan as well as other changes) safely, automatically and in just seconds!!. In this way we avoid using the manual procedures explained up to now which could cause errors by the user. Best of all is that even if you previously performed the manual operations, you can now run this script without any problem! If all the operations were done well nothing will be changed. Otherwise the script will correct it!
This script perform the following changes:
Sets the new entity identifier for South Sudan (DXCC=Z8) in all QSOs with ST0R station (up to now is the only one valid operation for that entity).
Sets the entity identifier for Montenegro (DXCC=4O) in all QSOs worked between 28/06/2006 and 31/12/2007 with stations with the following prefixes: YT6, YU6, YZ6, 4N6 y 4O6.
Replaces the old entity identifier in QSOs with Cook Islands (ZK1N and ZK1S) with E51N and E51S respectively.
Replaces the old entity identifier in QSOs with Bosnia Herzegovina from T9 to E7.
Replaces the old entity identifiers in QSOs with Glorious, Juan de Nova and Europe, Tromelin from FRG, FRJ, FRT to FTG, FTJ and FTT respectively. Also replaces the entity identifier for the deleted entity "Bassas da India" (if you have worked that entity before) from FRB to FTB.
Replaces the old entity identifier in QSOs with Niue from ZK2 to E6.
Replaces the entity identifiers in QSOs with Kosova from YU8 to YU.
Replaces the entity identifiers in QSOs with Curaçao, Bonaire, St Eustatius & Saba and St Maarten from PJC, PJB, PJS, PJM to PJ2C, PJ4B, PJ5ES, PJ7SM respectively. These changes are needed to adapt the DXCC abbreviations from the old country table maintained by Hardy DL5SBA (SK) to the current one.
Replaces the old WAE identifiers in QSOs with Switzerland, Serbia, Bosnia-Herzegovina and UN ITU from HB, YU8, T9 and 4U1I to HB9, YU, E7 and 4UIT respectively. This must be done for certain statistics to match with the abbreviations used in the DXCC table.
Sets the WAE identifier Z6 in all QSOs with Z6 prefix. This must be done because Kosova counts as a different country for WAE.
Sets the WAE identifier 4U1V if found any QSOs made with a list of stations (defined in the country table) operating from UN Vienna. Also replaces the old identifier 4UVIC to 4U1V.
Sets the WAE identifier GM/S if found any QSOs made with a llist of stations (defined in the country table) located in Shetland Islands. Also replaces the old identifier from GM/Sh to GM/S.
Sets the WAE identifier JW/B if found any QSOs made with a list of stations (defined in the country table) located in Bear Island.
Sets the DXCC identifier 4W if found any QSOs with 4U1ET.
Sets DXCC blank in QSOs with prefix starting with Z6 worked before 21/01/2018 because are not valid for any DXCC.
Set direct in QSO without bureau.sql
This script is very useful to avoid sending a QSL via bureau to those QSO partners with no bureau service. It selects all QSO with entities with no bureau service (having the QSL Manager field empty, no QSL has been send/received and QSL action is different from LOTW, LOTW+eQSL and eQSL) and sets "Direct" in the QSL-Action field. If a QSO contains a QSL Manager, because the QSL could be sent via bureau to the manager, it's out of the script selection.
If you want to change "Direct" by another word simply edit this file with a text editor (Notepad for example) and change "Direct" in the first line of code (is marked boldface in the code below):
UPDATE (PQTH INNER JOIN LOGBOOK ON PQTH.P_CALLID = LOGBOOK.L_CALLID) INNER JOIN DXCC_Tab ON PQTH.P_DXCC = DXCC_Tab.DXCC_ABBR SET LOGBOOK.L_QSL_ACTION = "Direct" WHERE (((LOGBOOK.L_QSL_ACTION)<>"LOTW" And (LOGBOOK.L_QSL_ACTION)<>"LOTW+eQSL" And (LOGBOOK.L_QSL_ACTION)<>"eQSL") AND ((LOGBOOK.L_QSL_RECEIVED)=0) AND ((LOGBOOK.L_QSL_SEND)=0) AND ((LOGBOOK.L_QSL_MGR) Is Null) AND ((DXCC_Tab.BUREAU)="N"));
NOTE: From version 5.94 Swisslog performs this automatically when saving new QSO. If the membership panel is activated and the "Apply QSL Actions from Membership" is checked, DIRECT will only be set if not LOTW/eQSL user.
NOTE: This script is executed automatically in invisible mode at first Swisslog startup of version 5.9a. You don't need to execute it again if using version 5.9a or higher.
This script automatically compares your QSO with an updated list of nearly 3000 stations handled by the following QSL managers: EA1EAU, EA5GL, EA5KB, EA7FTR, EB7DX, IZ8CCW, IZ8CLM, M0OXO, N2OO, UA4WHX, RW6HS and W3HNK. Then the script will set the QSL manager in all matching QSO ONLY if you have not received the QSL card (R-QSL field is 0) and the QSL manager field is empty. Keep in mind that it may take some time.
To avoid sending a QSL card to LOTW users, this script sets the word LOTW in the QSL-Action field in all QSO where a QSL has not been received. Make sure you have updated the LOTW user list before executing this script. You can update it manually in Tools | Update awards information (internet) | Update LOTW user list. In the Print QSL wizard you can avoid selecting these QSO to print your QSL cards.
NOTE: If the membership panel is activated and the "Apply QSL Actions from Membership" is checked, this is done automatically when adding new QSOs if callsign is LoTW user.
If you use the WFF (World Flora & Fauna) award you must run this SQL script to clean the contents of the Special field ONLY ONCE AND BEFORE entering any WFF references. This has to be performed, specially those users from the DOS version, because the SP field may contain obsolete data currently. Sets the WADA reference to all callsigns matching the new internal info table INF_WAPWACA. If you work this award you MUST run this script from time to time. Keep in mind that a same callsing may have been active from several WADA references. In these cases the script will set the first coincidence. User will have to check manually the reference with the QSL.NOTE: This script is executed automatically in invisible mode at first Swisslog startup of version 5.94. You don't need to execute it again if using version 5.94 or higher.
The Italian Island Award (IIA) changed all references from 1st January 2013. This script converts all old references into the new format.