query builder tips and troubleshooting - u2 techconnect | rocket

15
Query Builder Tips and Troubleshooting

Upload: others

Post on 03-Feb-2022

18 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Query Builder Tips and Troubleshooting - U2 TechConnect | Rocket

Query Builder Tips and

Troubleshooting

Page 2: Query Builder Tips and Troubleshooting - U2 TechConnect | Rocket

U2 Data Management Solutions 1099 18th St., Suite 2500

Denver, CO 80202 Phone: 303.294.0800 FAX: 303.293.8880

Contributors

Kenny Brunel, Alan Buckley, Trevor Grover, Tim Rasmussen, Ed Robb, David Robertshaw, Susie Siegesmund

Page 3: Query Builder Tips and Troubleshooting - U2 TechConnect | Rocket

U2 DATA MANAGEMENT SOLUTIONS

Contents

Modifying Query Builder Commands.................................................................................1 Query Builder Hangs ............................................................................................................3 User-Defined Prompting in Query Builder .........................................................................5 Using Query Builder for Unattended Batch Processing ...................................................10

- I -

Page 4: Query Builder Tips and Troubleshooting - U2 TechConnect | Rocket

U2 DATA MANAGEMENT SOLUTIONS

Theto tBuiyou ThiBuiuse Ex WeOurWis SOR

Whpare WIT Thi

wIntegrate Tech Tips

Modifying Query Builder Commands

wIntegrate Query Builder provides a GUI front-end for building host queries. Output can be sent he display, host printer, local printer, or imported to a PC file. The advantage to using Query lder is that you don't have to understand ECL, but in exchange, you are restricted in how complex r queries can be.

s Tip discusses how a user familiar with ECL can modify a query that was set up using Query lder. We assume the reader is familiar with ECL and Query Builder. Complete instructions in the of Query Builder can be found in the Using wIntegrate manual.

ample

have a file, CUSTOMER, which contains customer information (name, address, city, state, zip). goal is to produce a list of customers who live in the city of Denver, CO or in the state of consin. At ECL, we would use the command:

T CUSTOMER WITH (STATE="CO"AND CITY="Denver") OR STATE="WI" CITY STATE

en we use Query Builder we can create a query using AND but not OR, and we can't use ntheses to control the order of the comparisons. Our Items used for the selection are:

H STATE = "CO" AND WITH CITY = "Denver" AND WITH STATE = "WI"

s selection has a very different meaning than that of our ECL query.

- 1 -

Page 5: Query Builder Tips and Troubleshooting - U2 TechConnect | Rocket

U2 DATA MANAGEMENT SOLUTIONS

The dialog box now looks like:

The information on the Query Builder dialog box is used to build an ECL query. Effectively: ECL command = Verb + Items + Sort + Output Keeping this in mind, we can edit the Items to match our ECL statement: WITH (STATE = "CO" AND CITY = "Denver") OR STATE="WI"

Now, when we execute the query using Query Builder, we produce the same result as when entering the ECL statement directly. TIP: If you run the same report periodically, save it by clicking the Save button. All of your changes will be retained when you next open this script in Query Builder.

- 2 -

Page 6: Query Builder Tips and Troubleshooting - U2 TechConnect | Rocket

U2 DATA MANAGEMENT SOLUTIONS

On find4 kn Ho wInit dyouAlsyou PC Whto rpauit’s HO Edioccresofindwor Mi ModataUniexp

wIntegrate Tech Tips

Query Builder Hangs

rare occasions, customers have reported using Query Builder to transfer files to the PC, only to it hangs at the ‘MEX F Q’ command on the PC/Mac Server, the ‘blue box’. There are, presently, own causes for this behavior.

st ignores Ctrl-B

tegrate uses CHAR(2), a Ctrl-B, to delimit data sent to the host. If the host is ignoring CHAR(2), oesn’t know how to handle the data it receives. If your host operating system is Unix, even if ’re running Pick on top of it, check your stty settings to be sure CHAR(2) isn’t being ignored. o, if you’re using Unidata, check that you don’t have a CONTROLCHARS IGNORE statement in r VOC LOGIN paragraph.

/Mac Server doesn’t start in time

en the PC/Mac server is started, the first command it receives is ‘HOST’. This enables the server eceive commands, such as MEX F Q. Because the script which runs the server has built-in ses, the server is normally ready to accept commands by the time the MEX F Q is sent. However, possible your host takes longer to get the server process running so needs more time after the ST command than usual before the MEX F Q can be processed.

t \WINTEG\WINTSYS\LIB\SERVER.WIS using a text editor. In this file are numerous urrences of the line ‘Wait Delay 20’. For every such line, change the ‘20’ to ‘100’. If this lves the problem, Query Builder will operate more slowly. You can test values lower than 100 to the point at which Query Builder hangs and use the smallest one that still allows the process to k.

smatched host routines

st of the host routines are machine type dependent. If you have the wrong type installed for your base, file transfers and Query Builder may not work properly. For example, if you are using data in its native ‘U’ flavor, but installed the host routines for Unidata in ‘P’ flavor, you can ect to have problems.

- 3 -

Page 7: Query Builder Tips and Troubleshooting - U2 TechConnect | Rocket

U2 DATA MANAGEMENT SOLUTIONS

To verify what version of the host routines are installed, as well as the machine type in use: 1. At the ECL/TCL prompt, type WIN.TRANSFER <enter>. You should get a response, 868ConnectOK. At this point you won’t see what you type echoed, but that’s OK. 2. Type 742Version <enter>. Remember, you won’t see what you type. You should see a line similar to the following: 304PVER3.0.01 10/12/96 (UD) This line shows you the version of the host routines in use and the machine type, in parentheses. If the machine type shown is not correct for your host, you will need to re-install the host routines using the correct machine type. Type 215END <enter> to return to the ECL/TCL prompt. New host routines were installed tape but not cataloged Frequently, new host routines are distributed by VARs on tape. Once loaded into WIN.PROGS, these routines need to be compiled and cataloged globally before they can be used. If you have received a tape with updated host routines, be sure to compile and catalog them.

- 4 -

Page 8: Query Builder Tips and Troubleshooting - U2 TechConnect | Rocket

U2 DATA MANAGEMENT SOLUTIONS

In Whhosafte Didup of t Us Use <<l

wIntegrate Tech Tips

User-Defined Prompting in Query Builder

troduction

en you run Query Builder you provide a variety of information to be used for the query, including t file name, Items, Output, Sort, etc. You can also provide an ECL statement to be run before or r doing the query, for example GET.LIST <list> or SAVE.LIST <list>.

you know you can also include user-defined prompting to get input from the user? You can set a query to prompt for values each time it runs. To do so, enter prompts in the Items or Before box he Query Builder dialog box.

er-defined Prompting

r-defined prompting is available in wIntegrate 3.0 and 4.0. The syntax is as follows:

abel;length;pattern;error>>

- 5 -

Page 9: Query Builder Tips and Troubleshooting - U2 TechConnect | Rocket

U2 DATA MANAGEMENT SOLUTIONS

Parameters The following table describes each parameter in the prompt.

Parameter Description << Symbol indicating the start of user prompt data. label The label for the field to appear in the dialog box. length The length of the input field (default = 10). This does not restrict

the number of characters entered. pattern The pattern for validation. Pattern format:

"" – No validation (leave blank) nt – Can be repeated as often as necessary. 0 means 0 or

more, and t is a type N – Numeric. A – Alphabetic X – Any character. 'text' – Specific text enclosed in single quotation marks.

The following examples show you how to use these formats in patterns:

1N0N specifies a whole number, such as 1, 12, or 456. 2A1N specifies two letters followed by one digit, such as

ab1 or df8. 2N'.'2N'.'2N specifies three sets of two digits separated by

dots, such as 12.31.99. error The text of the error message to be displayed if validation fails.

(The default is a generic error message.) >> Symbol indicating the end of user prompt data.

Examples Using a sample database containing names and addresses, we construct a query to extract names by STATE. We would like the user to be prompted for the 2-character state abbreviation. We can do this either by placing the prompt in the Items or in a SELECT statement in the Before box. Using a prompt in Items

- 6 -

Page 10: Query Builder Tips and Troubleshooting - U2 TechConnect | Rocket

U2 DATA MANAGEMENT SOLUTIONS

In this example, we will ask the user for the state code within the query itself. The prompt we will use is: <<State;2;2A;Must be 2 letters>> where, State - name displayed on the dialog box 2 - input field will display 2 characters 2A - input will be 2 alphabetic characters Must be 2 letters - message displayed if an error is encountered After defining our query, the Query Builder dialog box has the following information:

When this query is executed, regardless of the Output To: selection, the user is prompted for the State:

- 7 -

Page 11: Query Builder Tips and Troubleshooting - U2 TechConnect | Rocket

U2 DATA MANAGEMENT SOLUTIONS

If the user inputs anything other than 2 letters, an error box is displayed with the error message we specified in our prompt:

Using a prompt in Before In this example, we will use the same prompt as before, however, we will use it in an ECL statement to select records when STATE equals the value input by the user.

- 8 -

Page 12: Query Builder Tips and Troubleshooting - U2 TechConnect | Rocket

U2 DATA MANAGEMENT SOLUTIONS

The completed Query Builder dialog box now looks like:

- 9 -

Page 13: Query Builder Tips and Troubleshooting - U2 TechConnect | Rocket

U2 DATA MANAGEMENT SOLUTIONS

A nBuiWh ThiEveset BatScrdo “c:\ As Wh

wIntegrate Tech Tips

Using Query Builder for Unattended Batch Processing

ew feature of wIntegrate, available with version 3.0.00, gives you the capability to run Query lder scripts in a batch-like mode. Typically this would be used to run regular reports overnight. en using this feature, your PC must remain on and a wIntegrate session to the host maintained.

s script waits until the specified time is reached, then runs the reports in the displayed sequence. ry minute the PC communicates with the host to keep the line active on those systems which are to log of the user after a period of inactivity.

ch reports are run using a new script, \winteg\query\BATCHREP.WIS. To execute, select Run, ipt, then locate BATCHREP.WIS. You can also assign this script to a particular function key. To so, select Setup, Keyboard, then map the appropriate key. The actual definition will be Script winteg\query\batchrep.wis”, select Macro.

with the Query Builder, you must have the host routines installed and be at the ECL/TCL prompt. en you run the script, the following dialog box will be displayed:

- 10 -

Page 14: Query Builder Tips and Troubleshooting - U2 TechConnect | Rocket

U2 DATA MANAGEMENT SOLUTIONS

Batch Reporting Dialog Options Available reports The currently saved Query Builder scripts in \winteg\query\querysav. These scripts are created by using the Save button in Query Builder. Selected reports The scripts you wish to run, selected from Available reports Add Adds the highlighted script, from Available reports, to the list of Selected reports Insert Inserts the highlighted script, from Available reports, before the highlighted line in Selected reports Remove Removes the highlighted script from the list of Selected reports Open Displays a standard File Open dialog, which lets the user open a set of saved reports saved using the Save button. Save Shows a standard File Save dialog, which allows the user to save the Selected reports to a text file. These can be opened together with the Open button. The Sleep until time is also saved in the text file. OK Displays the second dialog box and runs the Selected reports when the Sleep until time is reached.

- 11 -

Page 15: Query Builder Tips and Troubleshooting - U2 TechConnect | Rocket

U2 DATA MANAGEMENT SOLUTIONS

Selected reports: Displays the Selected reports from the main dialog. They are displayed for information only, and cannot be changed here. Time is now: The current system time, updated each minute. Sleeping until: The Sleep until time from the main dialog. When this time is reached, the reports will begin processing. Cancel Exits the batch process and returns to the main wIntegrate dialog.

- 12 -