Creating a Robust PROMPT SQL for use in InfoNet Scheduling – Part 2

In my previous post I highlighted some essential code to include in scheduling, in this post I will outline some useful code on how to ensure that only desired values are entered. Revisiting the code used in my previous post:

SQL Dialog Box

SQL Dialog Box

SELECT COUNT(*) INTO $COUNT FROM [CCTV Survey];
IF $COUNT > 0;

LIST $direction = ‘upstream’, ‘downstream’;

PROMPT TITLE ‘Select Direction’;
PROMPT LINE $DirectionSelected ‘Choose Direction Of Survey: ‘ STRING LIST $direction;

WHILE $DirectionSelected ‘upstream’ AND $DirectionSelected ‘downstream’;

PROMPT DISPLAY;

WEND;

IF $DirectionSelected = ‘upstream’;
SET direction = ‘U’;
SET start_manhole = ds_node_id;
SET finish_manhole = us_node_id;

ELSEIF $DirectionSelected = ‘downstream’;
SET direction = ‘D’;
SET start_manhole = us_node_id;
SET finish_manhole = ds_node_id;

ENDIF;

ENDIF;

The code of interest is the following line prioir the PROMPT…

WHILE $DirectionSelected ‘upstream’ AND $DirectionSelected ‘downstream’;

… which ensures that unless any of the values from the list are selected then the PROMPT will keep on being re-displayed. This ensures that if an end user of the SQL types in a value which is different from those in the list then the PROMPT keeps displaying an the SQL doesn’t move on.

Share this post!

    About Idris Nujjoo

    Idris is the Product Sector Leader for InfoNet and InfoMaster and has been working for Innovyze (and its earlier incarnations) since 2001 and specifically working on InfoNet and Asset Management for the past decade.
    This entry was posted in InfoNet. Bookmark the permalink.