home *** CD-ROM | disk | FTP | other *** search
/ com!online 2002 April / comcd0402.iso / vollver / adabas / f_0001 / env / sqlpl.enh < prev    next >
Encoding:
Text File  |  1999-11-01  |  170.0 KB  |  2,394 lines

  1. ENG|02          |     0     SQLPL.enh   10.05.01   1998-04-24
  2. ENG|02          |     1|  |                      HELP Resources of SQL-PL
  3. ENG|02          |     2|  |                      ------------------------
  4. ENG|02          |     4| I|                      ##11Workbench
  5. ENG|02          |     5| I|                      ##04Editor
  6. ENG|02          |     6| I|                      ##0203SQL-PL Routines
  7. ENG|02          |     7| I|                      ##05FORM
  8. ENG|02          |     8| I|                      ##09SQL Statements
  9. ENG|02          |     9| I|                      ##08REPORT Statements
  10. ENG|02          |    10| I|                      ##0208Restrictions
  11. ENG|02          |    11| I|                      ##0209Debugging Aids
  12. ENG|02          |    12| I|                      ##0211DB^Procedures
  13. ENG|02          |    14|RI|                      ##0404Help on Help
  14. ENG|0203        |     1|  |                      SQL-PL Routines
  15. ENG|0203        |     2|  |                      ---------------
  16. ENG|0203        |     4| M|                      #00Introductory Example
  17. ENG|0203        |     5| M|                      #01Statements
  18. ENG|0203        |     6| I|                      ##0207SQL-PL Functions
  19. ENG|0203        |     7| M|                      #03Standard^Functions
  20. ENG|0203        |     8| M|                      #04Syntax^Description
  21. ENG|0203        |     9|RM|                      #05Options and#05Debugging Aids
  22. ENG|020300      |     1|  |
  23. ENG|020300      |     2| E|    PROC customer.account PARM ( @cno );
  24. ENG|020300      |     3| E|    /* Program CUSTOMER - module ACCOUNT
  25. ENG|020300      |     4| E|    /* Calculates the bank balance of a customer from the database
  26. ENG|020300      |     6| E|    WRITE  CLEAR, '--- bank balance ---';
  27. ENG|020300      |     7| E|    REPEAT WRITE  NL(2), 'customer no.: ';
  28. ENG|020300      |     8| E|            READ  @cno;
  29. ENG|020300      |     9| E|            IF  @cno IS NULL  THEN RETURN;              /* end condition
  30. ENG|020300      |    10| E|            SQL ( SELECT DIRECT bank_balance
  31. ENG|020300      |    11| E|                  INTO   :balance                       /* searching the
  32. ENG|020300      |    12| E|                  FROM   customer                       /* balance of the
  33. ENG|020300      |    13| E|                  WHERE  KEY cno = :@cno );             /* customer in DB
  34. ENG|020300      |    14| E|            CASE  $RC  OF
  35. ENG|020300      |    15| E|            0   : WRITE 'bank balance:' , HI (balance); /* customer known
  36. ENG|020300      |    16| E|            100 : WRITE HI('customer not found');       /* customer unknown
  37. ENG|020300      |    17|SE|            END;
  38. ENG|020300      |    19| E|    UNTIL $RC NOT IN (0,100);
  39. ENG|020300      |    20| E|    WRITE NL,'Please call your EDP support';    /* error event
  40. ENG|020300      |    21|R |
  41. ENG|020301      |     1|  |                       SQL-PL Statements
  42. ENG|020301      |     2|  |                       -----------------
  43. ENG|020301      |     4| I|    ##02030201Assignments of Variables/Vectors/Values ##02030107CALL-FORM -Statement
  44. ENG|020301      |     5| I|    ##02030106CALL-PROC -Statement                    ##02030104CASE -Statement
  45. ENG|020301      |     6| I|    ##02030207EDIT -Statement                         ##02030212EXEC -Statement
  46. ENG|020301      |     7| I|    ##02030112FOR -Statement                          ##02030103IF -Statement
  47. ENG|020301      |     8| I|    ##02030209LTSORT/GTSORT -Statement                ##02030205QUERY Commands
  48. ENG|020301      |     9| I|    ##02030101REPEAT -Statement                       ##02030203READ -Statement
  49. ENG|020301      |    10| I|    ##02030105RETURN -Statement                       ##02030210SET -Statement
  50. ENG|020301      |    11| I|    ##02030109SKIP -Statement                         ##02030204SQL -Statement
  51. ENG|020301      |    12| I|    ##02030111STOP -Statement                         ##02030108SWITCH -Statement
  52. ENG|020301      |    13| I|    ##02030114SWITCHCALL -Statement                   ##02030211System^Time
  53. ENG|020301      |    14| I|    ##02030116TRY-CATCH -Statement                    ##02030102WHILE -Statement
  54. ENG|020301      |    15| I|    ##02030202WRITE -Statement                        ##02030206Processing Files
  55. ENG|020301      |    16| I|    ##02030113Function Calls                          ##02030110Condition
  56. ENG|020301      |    17|SI|    Calling ##02030115DB^Procedures
  57. ENG|020301      |    19|RI|                                                          ##0203040202->^Syntax
  58. ENG|02030101    |     1|  |    The  REPEAT  Statement  is used for repeating a sequence of statements.
  59. ENG|02030101    |     2|  |    Repetition is ended once the termination condition is met.  The  condi-
  60. ENG|02030101    |     3|  |    tion is checked a f t e r the statement(s) has (have) been processed.
  61. ENG|02030101    |     5|  |    Example :
  62. ENG|02030101    |     7|  |
  63. ENG|02030101    |     8| E|                      i := 1;
  64. ENG|02030101    |     9| E|                      REPEAT
  65. ENG|02030101    |    10| E|                         i := i + 1;
  66. ENG|02030101    |    11| E|                         WRITE 'i = ', i
  67. ENG|02030101    |    12| E|                      UNTIL i = 10;
  68. ENG|02030101    |    13|  |
  69. ENG|02030101    |    15|RI|                                                          ##0203040209->^Syntax
  70. ENG|02030102    |     1|  |    The  WHILE  Statement  is  used for repeating a sequence of statements.
  71. ENG|02030102    |     2|  |    Repetition  is  ended  once  the  termination  condition  is  met.  The
  72. ENG|02030102    |     3|  |    condition is checked p r i o r to processing the statement(s).
  73. ENG|02030102    |     5|  |    Example :
  74. ENG|02030102    |     6|  |
  75. ENG|02030102    |     8| E|                       i := 1;
  76. ENG|02030102    |     9| E|                       WHILE i < 10
  77. ENG|02030102    |    10| E|                       DO BEGIN
  78. ENG|02030102    |    11| E|                          i := i + 1;
  79. ENG|02030102    |    12| E|                          WRITE 'i = ', i;
  80. ENG|02030102    |    13| E|                          END;
  81. ENG|02030102    |    14|  |
  82. ENG|02030102    |    16|RI|                                                          ##0203040210->^Syntax
  83. ENG|02030103    |     1|  |    The  IF  Statement  is  used  for  executing  statements depending on a
  84. ENG|02030103    |     2|  |    condition. If the condition is  met,  it  performs  the  (sequence  of)
  85. ENG|02030103    |     3|  |    statement(s)   of   the   THEN  branch,  otherwise  the  (sequence  of)
  86. ENG|02030103    |     4|  |    statement(s) of the ELSE branch (if any).
  87. ENG|02030103    |     6|  |      Examples :
  88. ENG|02030103    |     8|  |
  89. ENG|02030103    |     9| E|         IF   (i > j) OR (i = j)
  90. ENG|02030103    |    10| E|         THEN BEGIN
  91. ENG|02030103    |    11| E|              WRITE 'i is greater than or equal to j'; ...
  92. ENG|02030103    |    12| E|              END
  93. ENG|02030103    |    13| E|         ELSE write 'i is smaller than j';
  94. ENG|02030103    |    14| E|         IF   name = 'CARL'
  95. ENG|02030103    |    15| E|         THEN WRITE 'NAME <> ''carl''';
  96. ENG|02030103    |    16|S |
  97. ENG|02030103    |    19|  |    In case of doubt ELSE belongs to the last IF.
  98. ENG|02030103    |    21|RI|                                                          ##0203040206->^Syntax
  99. ENG|02030104    |     1|  |    The CASE Statement is used for executing statements  depending  on  the
  100. ENG|02030104    |     2|  |    value  of  an  expression. That (sequence of) statement(s) is performed
  101. ENG|02030104    |     3|  |    which contains the value of the expression in its value list.  If  this
  102. ENG|02030104    |     4|  |    value does not occur in any value list, the OTHERWISE case is performed
  103. ENG|02030104    |     5|  |    (if any).
  104. ENG|02030104    |     7|  |    Examples :
  105. ENG|02030104    |     9|  |
  106. ENG|02030104    |    10| E|    CASE i OF                           CASE UPPER (s) OF
  107. ENG|02030104    |    11| E|    1.. 3 : WRITE 'i in (1,2,3)';       'ONE', 'TWO'   : BEGIN ... END;
  108. ENG|02030104    |    12| E|    4,5,6 : BEGIN                       'THREE'        : ... ;
  109. ENG|02030104    |    13| E|            WRITE 'i in (4,5,6)'; ...   'FOUR'         : ... ;
  110. ENG|02030104    |    14| E|            END;                        OTHERWISE      : BEGIN ... END;
  111. ENG|02030104    |    15| E|    END;                                END;
  112. ENG|02030104    |    16|S |
  113. ENG|02030104    |    19|RI|                                                          ##0203040207->^Syntax
  114. ENG|02030105    |     1|  |    The  RETURN  statement  ends  the  execution  of SQL-PL subroutines and
  115. ENG|02030105    |     2|  |    branches to the calling environment. The RETURN statement is  performed
  116. ENG|02030105    |     3|  |    implicitly at the end of every SQL-PL routine.
  117. ENG|02030105    |     5|  |    Example :
  118. ENG|02030105    |     6|  |
  119. ENG|02030105    |     7| E|      IF $KEY = 'F3'
  120. ENG|02030105    |     8| E|      THEN RETURN;
  121. ENG|02030105    |     9|  |
  122. ENG|02030105    |    11|  |    A value provided as the result of the function can be passed via RETURN
  123. ENG|02030105    |    12| I|    in ##0207SQL-PL functions.
  124. ENG|02030105    |    14|  |    Example :
  125. ENG|02030105    |    15|  |
  126. ENG|02030105    |    16| E|       FUNCTION stdlib.plus (@sum,@addend);
  127. ENG|02030105    |    17|SE|       RETURN (@sum+@addend);
  128. ENG|02030105    |    19|  |
  129. ENG|02030105    |    21|RI|                                                          ##0203040213->^Syntax
  130. ENG|02030106    |     1|  |    The CALL PROC statement can be used for branching to SQL-PL routines.
  131. ENG|02030106    |     3|  |    Example :
  132. ENG|02030106    |     5|  |
  133. ENG|02030106    |     6| E|       CALL PROC processing;
  134. ENG|02030106    |     7|  |
  135. ENG|02030106    |     9|  |    Once processing of the called routine is completed, the calling routine
  136. ENG|02030106    |    10|  |    is  continued. If the routine does not exist, the program is cancelled.
  137. ENG|02030106    |    11|  |    Upon calling the routine, current  parameters  may  be  specified.  The
  138. ENG|02030106    |    12|  |    values  of these parameter values are assigned to the formal parameters
  139. ENG|02030106    |    13|  |    of the called routine.
  140. ENG|02030106    |    15|  |    Example :
  141. ENG|02030106    |    17|S |    Definition : PROC customer.reservation PARMS (@cno, @today, @counter);
  142. ENG|02030106    |    19|  |    Call       : CALL PROC reservation PARMS (cno, DATE(yymmdd), counter+1);
  143. ENG|02030106    |    21|RI|                                                          ##0203040216->^Syntax
  144. ENG|02030107    |     1|  |    The CALL FORM statement can be used for branching to FORM routines.
  145. ENG|02030107    |     3|  |    Example :
  146. ENG|02030107    |     5|  |       CALL FORM   main_menu;
  147. ENG|02030107    |     7|  |    Once processing of the called routine is completed, the calling routine
  148. ENG|02030107    |     8|  |    is continued.
  149. ENG|02030107    |    10|  |    Calling a form which requires a user response implicitly terminates the
  150. ENG|02030107    |    11|  |    current database transaction, unless the  call  comes  from  an  SQL-PL
  151. ENG|02030107    |    12|  |    routine compiled with the option AUTOCOMMIT OFF.
  152. ENG|02030107    |    14|  |    If  the  form  does  not  exist,  the  program  is  cancelled.  Current
  153. ENG|02030107    |    15|S |    parameters can be specified as for CALL PROC.
  154. ENG|02030107    |    19|  |    When calling forms,  options  may  be  specified  which  influence  the
  155. ENG|02030107    |    20|  |    processing of the routine.
  156. ENG|02030107    |    22|  |    Examples :
  157. ENG|02030107    |    25|  |
  158. ENG|02030107    |    26| E|    CALL FORM form1 OPTIONS (NOINIT, ACCEPT (F1,F3,ENTER), MARK (3));
  159. ENG|02030107    |    27| E|    CALL FORM form3 OPTIONS ( PRINT (LINEFEED 2, NEWPAGE), NOINIT):
  160. ENG|02030107    |    28| E|    CALL FORM form4 ( PRINT ('X', LINEFEED 2)) PARMS (cno, DATE(yymmdd));
  161. ENG|02030107    |    29|  |
  162. ENG|02030107    |    31| I|    ##0506Further^Information^ about the Call Options.
  163. ENG|02030107    |    33|RI|                                                          ##0203040217->^Syntax
  164. ENG|02030108    |     1|  |    The  SWITCH statement ends the execution of a program and branches to a
  165. ENG|02030108    |     2|  |    successor program.
  166. ENG|02030108    |     4|  |    Examples :
  167. ENG|02030108    |     6|  |
  168. ENG|02030108    |     7| E|       SWITCH customer CALL PROC processing;
  169. ENG|02030108    |     8| E|       SWITCH product.customer CALL FORM main_menu;
  170. ENG|02030108    |     9|  |
  171. ENG|02030108    |    11|  |    Thus several small programs may be put together to  form  larger  ones.
  172. ENG|02030108    |    12|  |    Options  can  be  specified  as  for  CALL FORM; current parameters are
  173. ENG|02030108    |    13|  |    specified as for CALL.
  174. ENG|02030108    |    15|RI|                                                          ##0203040218->^Syntax
  175. ENG|02030109    |     1|  |    The SKIP statement performs an unconditional branch  to  the  specified
  176. ENG|02030109    |     2|  |    label. SKIP can only move toward the end of the routine; i.e. it is not
  177. ENG|02030109    |     3|  |    possible that loops are programmed.
  178. ENG|02030109    |     5|  |    Example :
  179. ENG|02030109    |     7|  |
  180. ENG|02030109    |     8| E|    PROC x.y
  181. ENG|02030109    |     9| E|     ...
  182. ENG|02030109    |    10| E|    IF   $RC <> 0 THEN SKIP error;
  183. ENG|02030109    |    11| E|     ...
  184. ENG|02030109    |    12| E|    error : WRITE 'error (' & $RC & ')'; RETURN;
  185. ENG|02030109    |    13|  |
  186. ENG|02030109    |    15|  |    Skip labels are only allowed outside control structures.
  187. ENG|02030109    |    17|RI|                                                          ##0203040212->^Syntax
  188. ENG|02030110    |     1|  |    The  SQL-PL  language  allows  conditions  to  be formulated within IF,
  189. ENG|02030110    |     2|  |    REPEAT, and WHILE Statements.
  190. ENG|02030110    |     5| M|    logical predicates : #01AND^OR^NOT
  191. ENG|02030110    |     7| M|    comparison predicates : #02=^<>^<^>^<=^>=^IN^BETWEEN^LIKE^EOF
  192. ENG|02030110    |     9| M|    type predicates : #03ALPHA^NUMERIC^FIXED^DATE^TIME^NULL^MODIFIED
  193. ENG|02030110    |    11| M|    vector predicates : #04ALL^EACH^ANY^SOME^ONE
  194. ENG|02030110    |    13| M|    trigger predicates : #05FIRSTCALL^LASTCALL^INSERTING^UPDATING^DELETING
  195. ENG|02030110    |    15|  |    Examples :
  196. ENG|02030110    |    17|S |
  197. ENG|02030110    |    19| E|       IF  pno = 4711 AND name = 'Smith' THEN ...;
  198. ENG|02030110    |    21| E|       REPEAT ... UNTIL (name IS NULL) OR ($KEY = F3);
  199. ENG|02030110    |    23| E|       WHILE (name IS ALPHA) AND NOT (name IN ('Meyer','Miller')) DO ...;
  200. ENG|02030110    |    25| E|       IF (name LIKE 'T*') OR (name IN ('Meyer','Myer')) THEN ...;
  201. ENG|02030110    |    27| E|       IF  number BETWEEN 1 AND 99 THEN ... ;
  202. ENG|02030110    |    29| E|       IF ALL list (1..5) IN ('0',NULL)
  203. ENG|02030110    |    31| E|      IF DELETING AND FIRSTCALL
  204. ENG|02030110    |    33|  |
  205. ENG|02030110    |    34|S |    Processing can be controlled by bracketing.
  206. ENG|02030110    |    37|RI|                                                          ##0203040146->^Syntax
  207. ENG|0203011001  |     1|  |    Logical Predicates
  208. ENG|0203011001  |     3|  |    The expression yields true, if
  209. ENG|0203011001  |     5|  |        AND : both operands are true.
  210. ENG|0203011001  |     7|  |        OR  : one of the operands is true.
  211. ENG|0203011001  |     9|  |        NOT : the operand is false.
  212. ENG|0203011001  |    12|RI|                                                          ##0203040160->^Syntax
  213. ENG|0203011002  |     1|  |    Comparison Predicates
  214. ENG|0203011002  |     3|  |    The expression yields true, if
  215. ENG|0203011002  |     5|  |        =       : both operands are equal
  216. ENG|0203011002  |     7|  |        <>      : the operands differ.
  217. ENG|0203011002  |     9|  |        <       : the first operand is smaller than the second operand.
  218. ENG|0203011002  |    11|  |        >       : the first operand is greater than the second operand.
  219. ENG|0203011002  |    13|  |        <=      : the first operand is smaller or equal to the second operand.
  220. ENG|0203011002  |    15|  |        >=      : the first operand is smaller or equal to the second operand.
  221. ENG|0203011002  |    16|SI|                                                          ##0203040161->^Syntax
  222. ENG|0203011002  |    19|  |        IN      : the first operand is an element in the given list.
  223. ENG|0203011002  |    20| I|                                                          ##0203040151->^Syntax
  224. ENG|0203011002  |    22|  |        BETWEEN : the first operand is restricted to the given interval.
  225. ENG|0203011002  |    23| I|                                                          ##0203040154->^Syntax
  226. ENG|0203011002  |    25|  |        LIKE    : the first operand matches the given pattern.
  227. ENG|0203011002  |    26| I|                                                          ##0203040155->^Syntax
  228. ENG|0203011002  |    28|  |        EOF     : the end of the given file has been reached.
  229. ENG|0203011002  |    29|RI|                                                          ##0203040145->^Syntax
  230. ENG|0203011003  |     1|  |    Type Predicates
  231. ENG|0203011003  |     3|  |    The expression yields true, if
  232. ENG|0203011003  |     5|  |        ALPHA    : the operand may be transformed into a string.
  233. ENG|0203011003  |     7|  |        NUMERIC  : the operand may be transformed into a number.
  234. ENG|0203011003  |     9|  |        FIXED    : the operand may be transformed into a number
  235. ENG|0203011003  |    10|  |                   with the given precision.
  236. ENG|0203011003  |    12|  |        DATE     : the operand can be used as a date.
  237. ENG|0203011003  |    14|  |        TIME     : the operand can be used as a time.
  238. ENG|0203011003  |    16|S |        NULL     : the operand is undefined.
  239. ENG|0203011003  |    19|  |        MODIFIED : the operand has been modified during the last FORM call.
  240. ENG|0203011003  |    22|RI|                                                          ##0203040150->^Syntax
  241. ENG|0203011004  |     1|  |    Vector Predicates
  242. ENG|0203011004  |     3|  |    The expression yields true, if
  243. ENG|0203011004  |     5|  |        ALL, EACH  : each vector element conforms to the given condition.
  244. ENG|0203011004  |     7|  |        ANY, SOME  : at least one vector element conforms to the given condition.
  245. ENG|0203011004  |     9|  |        ONE        : exactly one vector element conforms to the given condition.
  246. ENG|0203011004  |    12|RI|                                                          ##0203040145->^Syntax
  247. ENG|0203011005  |     1|  |    Trigger Predicates
  248. ENG|0203011005  |     3|  |    These predicates are meaningful only inside a trigger. They yield false
  249. ENG|0203011005  |     4|  |    in any other case.
  250. ENG|0203011005  |     6|  |    The expression yields true, if
  251. ENG|0203011005  |     8|  |        FIRSTCALL : the trigger gets called by a single row command
  252. ENG|0203011005  |     9|  |                    or the first row of a set oriented command.
  253. ENG|0203011005  |    11|  |        LASTCALL  : the trigger is called by a single row command
  254. ENG|0203011005  |    12|  |                    or the last row of a set oriented command.
  255. ENG|0203011005  |    14|  |        INSERTING, UPDATING, DELETING : the trigger is called by
  256. ENG|0203011005  |    15|S |                    an INSERT, UPDATE or DELETE respectively.
  257. ENG|0203011005  |    19|RI|                                                          ##0203040116->^Syntax
  258. ENG|02030111    |     1|  |    The STOP statement ends the execution of  an  SQL-PL  program.  If  the
  259. ENG|02030111    |     2|  |    program  was  called without going through the workbench, then a return
  260. ENG|02030111    |     3|  |    code  and  message  are  passed  to  the   calling   operating   system
  261. ENG|02030111    |     4|  |    environment.
  262. ENG|02030111    |     5|  |    This  return code must only assume values from the interval 0..127; the
  263. ENG|02030111    |     6|  |    return code is implicitly mapped to this interval, if necessary.
  264. ENG|02030111    |     8|  |    Examples:
  265. ENG|02030111    |    10|  |
  266. ENG|02030111    |    11| E|      IF   $RC < 0                   STOP ($COUNT);
  267. ENG|02030111    |    12| E|      THEN STOP ($RC, $RT);          STOP;
  268. ENG|02030111    |    13|  |
  269. ENG|02030111    |    15|RI|                                                          ##0203040214->^Syntax
  270. ENG|02030112    |     1|  |    The FOR Statement is used for repeating a sequence of  statements.  The
  271. ENG|02030112    |     2|  |    number  of  repetitions  is calculated b e f o r e passing the loop for
  272. ENG|02030112    |     3|  |    the first time, using the upper and lower  limit  specifications.  Upon
  273. ENG|02030112    |     4|  |    each pass the loop variable is either increased or decreased by 1.
  274. ENG|02030112    |     6|  |      Examples :
  275. ENG|02030112    |     8|  |
  276. ENG|02030112    |     9| E|      FOR i := 1 to 5 DO
  277. ENG|02030112    |    10| E|          WRITE 'I =',i;
  278. ENG|02030112    |    11| E|      FOR i := LENGTH (string) DOWNTO 1 DO
  279. ENG|02030112    |    12| E|          BEGIN
  280. ENG|02030112    |    13| E|          WRITE NL, SUBSTR (string, i, 1);
  281. ENG|02030112    |    14| E|          END;
  282. ENG|02030112    |    15|  |
  283. ENG|02030112    |    17|RI|                                                          ##0203040211->^Syntax
  284. ENG|02030113    |     1|  |    Calling Functions
  285. ENG|02030113    |     3|  |    An SQL-PL function call is preceded by the percent (%) sign.
  286. ENG|02030113    |     5|  |    Function  calls  can be used in expressions; but they may also occur as
  287. ENG|02030113    |     6|  |    statements in their own right.
  288. ENG|02030113    |     8|  |    Examples :
  289. ENG|02030113    |    10|  |
  290. ENG|02030113    |    11| E|      sum := %sum (a, b, c, d, e);
  291. ENG|02030113    |    12| E|      %list ('customers');
  292. ENG|02030113    |    13|  |
  293. ENG|02030113    |    15|  |    When used in expressions, a value must be returned to the function  via
  294. ENG|02030113    |    16|SI|    the RETURN statement ( --> ##0207SQL-PL Functions ).
  295. ENG|02030113    |    19|RI|                                                          ##0203040141->^Syntax
  296. ENG|02030114    |     1|  |    The SWITCHCALL statement branches to another program. Once this program
  297. ENG|02030114    |     2|  |    is   completed,  the  processing  is  continued  after  the  SWITCHCALL
  298. ENG|02030114    |     3|  |    statement. All variables keep the values assigned to them.
  299. ENG|02030114    |     5|  |    Examples :
  300. ENG|02030114    |     7|  |
  301. ENG|02030114    |     8| E|       SWITCHCALL db_io CALL PROC insert_customer (cno, cname, rc);
  302. ENG|02030114    |     9| E|       SWITCHCALL global.info CALL FORM start;
  303. ENG|02030114    |    10|  |
  304. ENG|02030114    |    12|  |    Thus standard programs can be put together which can be used  in  other
  305. ENG|02030114    |    13|  |    programs.
  306. ENG|02030114    |    15|  |    Options  can  be  specified  as  for  CALL FORM; current parameters are
  307. ENG|02030114    |    16|S |    specified as for CALL.
  308. ENG|02030114    |    19|RI|                                                          ##0203040219->^Syntax
  309. ENG|02030115    |     1|  |    Calling DB Procedures
  310. ENG|02030115    |     3|  |    The CALL DBPROC statement can be used to execute DB procedures.
  311. ENG|02030115    |     5|  |    Example :
  312. ENG|02030115    |     7|  |
  313. ENG|02030115    |     8| E|      CALL DBPROC hotel.reservation ( @customer, @theDate, @hotel, @sum );
  314. ENG|02030115    |    10| E|      CALL DBPROC author.hotel.reservation ( @customer, @theDate, @hotel, @sum )
  315. ENG|02030115    |    11| E|        WITH COMMIT;
  316. ENG|02030115    |    12|  |
  317. ENG|02030115    |    14|  |    After the call $RC and $RT are set to values. If the DB  procedure  was
  318. ENG|02030115    |    15|  |    terminated without an error, the output variables contain new values.
  319. ENG|02030115    |    17|S |    If  WITH COMMIT was specified, a successful execution is concluded with
  320. ENG|02030115    |    19|  |    an implicit COMMIT WORK ( an implicit ROLLBACK WORK is not performed in
  321. ENG|02030115    |    20|  |    case of a failure ).
  322. ENG|02030115    |    23|RI|                                                          ##0203040225->^Syntax
  323. ENG|02030116    |     1|  |    Exception Handling
  324. ENG|02030116    |     3|  |    The TRY-CATCH statement allows the programmer to handle runtime  errors
  325. ENG|02030116    |     4|  |    without aborting the running program.
  326. ENG|02030116    |     6|  |    If  an  error or a STOP statement occurs inside the TRY statement, then
  327. ENG|02030116    |     7|  |    control is transfered to the CATCH clause with  the  appropriate  error
  328. ENG|02030116    |     8|  |    number.  If a selector matches the error number, then the corresponding
  329. ENG|02030116    |     9|  |    statement  executed,  execution  continues  after  the  CATCH   clause.
  330. ENG|02030116    |    10|  |    Otherwise, the error is not handled and the program is aborted ( unless
  331. ENG|02030116    |    11|  |    the  error  is handled in an enclosing TRY-CATCH statement ). Selectors
  332. ENG|02030116    |    12|  |    are specified similar to the CASE statement, an OTHERWISE branch is not
  333. ENG|02030116    |    13|  |    allowed.
  334. ENG|02030116    |    15|  |    Beispiel :
  335. ENG|02030116    |    17|S |
  336. ENG|02030116    |    19| E|      TRY
  337. ENG|02030116    |    20| E|          BEGIN
  338. ENG|02030116    |    21| E|          CALL PROC do_command;
  339. ENG|02030116    |    22| E|          END
  340. ENG|02030116    |    23| E|      CATCH @errno OF
  341. ENG|02030116    |    24| E|      16102 : ERROR := 'Out of memory';
  342. ENG|02030116    |    25| E|      16801 : ERROR := 'Command cancelled';
  343. ENG|02030116    |    26| E|      END;
  344. ENG|02030116    |    27|  |
  345. ENG|02030116    |    30|RI|                                                          ##0203040240->^Syntax
  346. ENG|02030201    |     1|  |    SQL-PL distinguishes between simple  variables  and  vector  variables.
  347. ENG|02030201    |     2|  |    Vector variables are a collection of simple variables. They can have up
  348. ENG|02030201    |     3|  |    to 255 elements. The scope of variables may be limited. Therefore there
  349. ENG|02030201    |     4|  |    are global, local-dynamic, and local-static variables.
  350. ENG|02030201    |     6|  |    Global  variables  are known everywhere within a program; values can be
  351. ENG|02030201    |     7|  |    assigned to them anywhere.
  352. ENG|02030201    |     9|  |    Local-dynamic variables are only  known  within  one  module  and  when
  353. ENG|02030201    |    10|  |    branching  back  to  the  calling  environment,  they  are deleted. For
  354. ENG|02030201    |    11|  |    recursive calls of the module,  a  new  shaping  of  the  variables  is
  355. ENG|02030201    |    12|S |    generated each time!
  356. ENG|02030201    |    19|  |    Local-static variables, too, are only accessible within the module they
  357. ENG|02030201    |    20|  |    have been declared. In contrast to the dynamic variables, they keep the
  358. ENG|02030201    |    21|  |    values assigned to them even if the procedure temporarily branches back
  359. ENG|02030201    |    22|  |    to  the  calling  environment.  They  only  lose their values, when the
  360. ENG|02030201    |    23|  |    program is left. With recursive calls  of  the  module,  the  same  (!)
  361. ENG|02030201    |    24|  |    variable may always be used.
  362. ENG|02030201    |    26|  |    Attention: Local-static variables declared in SQL-PL functions
  363. ENG|02030201    |    27|S |               keep their values beyond program changes.
  364. ENG|02030201    |    37|  |    A value assignment assigns a value of an expression to
  365. ENG|02030201    |    38|  |    an SQL-PL variable.
  366. ENG|02030201    |    40|  |    Examples :
  367. ENG|02030201    |    42|  |
  368. ENG|02030201    |    43| E|       name (i)            := lastname (i) & firstname (i);/* global vectors
  369. ENG|02030201    |    44| E|       @name               := 'Smith';      /* local dynamic variable
  370. ENG|02030201    |    45| E|       @@name (1..10)      := NULL;         /* local static variable
  371. ENG|02030201    |    46| E|       account_new (1..no) := account_old (1..no);
  372. ENG|02030201    |    47| E|       @i                  := @i + 1;
  373. ENG|02030201    |    48| E|       j                   := NULL;
  374. ENG|02030201    |    49| E|       time                := TIME (hhmmss);
  375. ENG|02030201    |    50| E|       sum                 := %sum (v1,v2,v3,v4);    /* function call
  376. ENG|02030201    |    51|  |
  377. ENG|02030201    |    53|S |    Rem.:  Prior  to  the  first  assignment, variables implicitly have the
  378. ENG|02030201    |    55|  |           NULL value.
  379. ENG|02030201    |    56|  |    SQL-PL variables have no particular type; i.e. both digits and  strings
  380. ENG|02030201    |    57|  |    may be assigned to them.
  381. ENG|02030201    |    59| I|                                                          ##0203040203<assign^stmt>->^Syntax
  382. ENG|02030201    |    60|RI|                                                          ##0203040205<vector^assign^stmt>->^Syntax
  383. ENG|02030202    |     1|  |    In  contrast  to the CALL FORM statement, the WRITE statement writes to
  384. ENG|02030202    |     2|  |    the screen in a line-oriented manner.
  385. ENG|02030202    |     4|  |    The following control instructions may be used :
  386. ENG|02030202    |     6|  |         NL          : causes one line feed.
  387. ENG|02030202    |     7|  |         NL (n)      : causes n line feeds.
  388. ENG|02030202    |     8|  |         COL (n)     : determines the output column.
  389. ENG|02030202    |     9|  |         HIGH        : has the effect that the next value is bright on output
  390. ENG|02030202    |    10|  |         HI (v,...)  : has the effect that several values are bright on
  391. ENG|02030202    |    11|  |                       output.
  392. ENG|02030202    |    12|  |         CLEAR       : clears the screen.
  393. ENG|02030202    |    13|  |         NOCLEAR       has the effect that the screen is not cleared,
  394. ENG|02030202    |    14|  |                       when the screen margin is reached by NL.
  395. ENG|02030202    |    15|  |         POS (l, c)  : determines the coordinates of the screen
  396. ENG|02030202    |    16|  |                       for the next output.
  397. ENG|02030202    |    17|S |         SIZE (n)    : determines the length of the next output field.
  398. ENG|02030202    |    19|  |         PAUSE       : requires acknowledgement (e.g. ENTER) by the user.
  399. ENG|02030202    |    23|  |         OPEN          has the effect that subsequent WRITE output
  400. ENG|02030202    |    24|  |                       is not displayed on the screen
  401. ENG|02030202    |    25|  |                       (until CLOSE or PAUSE is specified).
  402. ENG|02030202    |    26|  |         CLOSE         releases screen output of the collected data.
  403. ENG|02030202    |    27|  |         HOLD          has the effect that a release key must be
  404. ENG|02030202    |    28|  |                       pressed in order to automatically clear a
  405. ENG|02030202    |    29|  |                       screen page filled with writing.
  406. ENG|02030202    |    31|RI|                                                          ##0203040248->^Syntax
  407. ENG|02030203    |     1|  |    The READ statement allows data to be read from the screen  into  SQL-PL
  408. ENG|02030203    |     2|  |    variables. After each input, a release key is to be pressed.
  409. ENG|02030203    |     4|  |    The following control instructions may be used :
  410. ENG|02030203    |     6|  |         NL          : causes one line feed.
  411. ENG|02030203    |     7|  |         NL (n)      : causes n line feeds.
  412. ENG|02030203    |     8|  |         COL (n)     : determines the output column.
  413. ENG|02030203    |     9|  |         HIGH        : has the effect that the characters in the input
  414. ENG|02030203    |    10|  |                       field appear brightly.
  415. ENG|02030203    |    11|  |         DARK        : has the effect that the characters in the input
  416. ENG|02030203    |    12|  |                       field are not visible.
  417. ENG|02030203    |    13|  |         CLEAR       : clears the screen.
  418. ENG|02030203    |    14|  |         POS (l, c)  : determines the coordinates of the screen
  419. ENG|02030203    |    15|  |                       for the next input field.
  420. ENG|02030203    |    16|S |         SIZE (n)    : determines the length of the next input field.
  421. ENG|02030203    |    19|  |         OUTIN (v)   : has the effect that the current value of the variable
  422. ENG|02030203    |    20|  |                       is displayed and may be overwritten.
  423. ENG|02030203    |    21|  |         PROMPT 'c'  : may be used together with OUTIN. The specified
  424. ENG|02030203    |    22|  |                       character will be displayed when the variable
  425. ENG|02030203    |    23|  |                       has the NULL value.
  426. ENG|02030203    |    25|RI|                                                          ##0203040249->^Syntax
  427. ENG|02030204    |     1|  |                    Database Commands with SQL
  428. ENG|02030204    |     2|  |                    --------------------------
  429. ENG|02030204    |     4| M|                    #01Accessing^the^Database
  430. ENG|02030204    |     5| M|                    #02Dynamic^SQL^Commands
  431. ENG|02030204    |     6| M|                    #03Dynamic^FETCH^Commands
  432. ENG|02030204    |     7| M|                    #04Mass^Fetch
  433. ENG|02030204    |     8| M|                    Routines for #05SQL^Error^Handling
  434. ENG|02030204    |     9| M|                    #06Multi-DB^Accessibility
  435. ENG|02030204    |    10|RI|                                                          ##0203040227->^Syntax
  436. ENG|0203020401  |     1|  |    The  SQL  interface  of  the  ADABAS database system is integrated into
  437. ENG|0203020401  |     2|  |    SQL-PL. It handles  the  data  exchange  between  database  and  SQL-PL
  438. ENG|0203020401  |     3|  |    program.  After  each  SQL call a check can be made via $RC in order to
  439. ENG|0203020401  |     4|  |    know which code has been returned by the DBMS.
  440. ENG|0203020401  |     6|  |    Static SQL commands:
  441. ENG|0203020401  |     8|  |    These commands are checked while storing the routine. Input and  output
  442. ENG|0203020401  |     9|  |    variables  may occur in the command. These SQL variables are denoted by
  443. ENG|0203020401  |    10|  |    a colon within the command.
  444. ENG|0203020401  |    17|S |    Examples :
  445. ENG|0203020401  |    19|  |
  446. ENG|0203020401  |    20| E|       SQL (  SELECT  DIRECT name
  447. ENG|0203020401  |    21| E|              INTO   :c_name
  448. ENG|0203020401  |    22| E|              FROM    customer
  449. ENG|0203020401  |    23| E|              KEY     cno = :c_no );
  450. ENG|0203020401  |    26| E|      SQL ( INSERT  customer
  451. ENG|0203020401  |    27| E|            SET     cno = :c_no, name = :c_name, city = :c_city );
  452. ENG|0203020401  |    29| E|      SQL ( UPDATE  customer
  453. ENG|0203020401  |    30| E|            SET     city = 'Washington', account = :@sum
  454. ENG|0203020401  |    31| E|            KEY     cno = :c_no );
  455. ENG|0203020401  |    33| E|      SQL ( SELECT  res (cno, name)
  456. ENG|0203020401  |    34| E|            FROM    customer
  457. ENG|0203020401  |    35|SE|            WHERE   city = :@c_city );
  458. ENG|0203020401  |    37| E|      SQL ( FETCH FIRST res
  459. ENG|0203020401  |    38| E|            INTO   :c_no, :c_name );
  460. ENG|0203020401  |    39|  |
  461. ENG|0203020401  |    41|RI|                                                          ##0203040227->^Syntax
  462. ENG|0203020402  |     1|  |    Dynamic SQL commands:
  463. ENG|0203020402  |     3|  |    These commands are only checked at execution time.
  464. ENG|0203020402  |     4|  |    !!! No SQL variables may occur in dynamic commands. !!!
  465. ENG|0203020402  |     6|  |    Example :
  466. ENG|0203020402  |     8|  |
  467. ENG|0203020402  |     9| E|       command := 'SELECT * FROM customer WHERE name = ''';
  468. ENG|0203020402  |    11| E|       READ name;
  469. ENG|0203020402  |    13| E|       SQL EXECUTE IMMEDIATE command & name & '''';
  470. ENG|0203020402  |    14|S |
  471. ENG|0203020402  |    19|  |    Dynamic SQL commands:
  472. ENG|0203020402  |    21|  |    These commands are only checked at execution time.
  473. ENG|0203020402  |    23|  |    Execution without preparation :
  474. ENG|0203020402  |    25| M|    #01EXECUTE^IMMEDIATE
  475. ENG|0203020402  |    27| M|    #01EXECUTE^IMMEDIATE^USING
  476. ENG|0203020402  |    30|  |    Preparation and multiple execution :
  477. ENG|0203020402  |    32| M|    #02PREPARE^FROM
  478. ENG|0203020402  |    34|SM|    #02EXECUTE^USING
  479. ENG|0203020402  |    37| M|    #02DESCRIBE^INTO
  480. ENG|0203020402  |    39|RI|                                                          ##0203040229->^Syntax
  481. ENG|020302040201|     1|  |    Immediate execution without SQL variables :
  482. ENG|020302040201|     3|  |
  483. ENG|020302040201|     4| E|      cmd := 'SELECT * FROM customer WHERE name = '''';
  484. ENG|020302040201|     6| E|      READ name;
  485. ENG|020302040201|     8| E|      SQL EXECUTE IMMEDIATE cmd & name & '''';
  486. ENG|020302040201|     9|  |
  487. ENG|020302040201|    10|  |    Immediate execution with SQL variables :
  488. ENG|020302040201|    12|  |    Positions of SQL variables in the command string are represented
  489. ENG|020302040201|    13|  |    by question marks.
  490. ENG|020302040201|    15|  |
  491. ENG|020302040201|    16|SE|      cmd := 'SELECT * FROM customer WHERE name = ?';
  492. ENG|020302040201|    19| E|      READ name;
  493. ENG|020302040201|    21| E|      SQL EXECUTE IMMEDIATE cmd USING name;
  494. ENG|020302040201|    22|  |
  495. ENG|020302040201|    24|RI|                                                          ##0203040229->^Syntax
  496. ENG|020302040202|     1|  |    Preparation of a dynamic SQL command
  497. ENG|020302040202|     3|  |    Positions of SQL variables in the command string are represented
  498. ENG|020302040202|     4|  |    by question marks.
  499. ENG|020302040202|     6|  |
  500. ENG|020302040202|     7| E|      cmd := 'SELECT DIRECT cust_no INTO ?'
  501. ENG|020302040202|     8| E|        & ' WHERE name = ? AND city = ?';
  502. ENG|020302040202|     9| E|      SQL PREPARE sel FROM cmd;
  503. ENG|020302040202|    10| E|        ;
  504. ENG|020302040202|    11|  |
  505. ENG|020302040202|    13|  |    Execution of a prepared command :
  506. ENG|020302040202|    15|  |    A prepared command may be executed multiple times using the same or
  507. ENG|020302040202|    16|S |    different variables.
  508. ENG|020302040202|    19|  |
  509. ENG|020302040202|    20| E|      SQL EXECUTE sel USING c_no, name, @city;
  510. ENG|020302040202|    21|  |
  511. ENG|020302040202|    23|  |    Accessing information about SQL variables :
  512. ENG|020302040202|    25|  |
  513. ENG|020302040202|    26| E|      SQL DESCRIBE sel INTO @info(1..10);
  514. ENG|020302040202|    27|  |
  515. ENG|020302040202|    28|  |      @info(1)  ->  'OUT   FIXED (    6 , 0 ) NOT NULL'
  516. ENG|020302040202|    29|  |      @info(2)  ->  'IN    CHAR  (   20 )     NOT NULL'
  517. ENG|020302040202|    30|  |      @info(3)  ->  'IN    CHAR  (   20 )'
  518. ENG|020302040202|    31|  |      $COUNT    ->  3
  519. ENG|020302040202|    34|RI|                                                          ##0203040229->^Syntax
  520. ENG|0203020403  |     1|  |    Dynamic FETCH Commands :
  521. ENG|0203020403  |     3|  |    The dynamic FETCH command is provided in order that the values selected
  522. ENG|0203020403  |     4|  |    by means of a dynamic SQL command can be  assigned  to  variables.  The
  523. ENG|0203020403  |     5|  |    values  of the current line of the specified result set are assigned to
  524. ENG|0203020403  |     6|  |    the variables (local or global variables or vector  slices)  designated
  525. ENG|0203020403  |     7|  |    by a ':'.
  526. ENG|0203020403  |     8|  |    If  no  result  set  is specified, the FETCH command refers to the last
  527. ENG|0203020403  |     9|  |    generated result set.
  528. ENG|0203020403  |    11|  |    Example :
  529. ENG|0203020403  |    13|  |
  530. ENG|0203020403  |    14| E|      table   := 'customer';
  531. ENG|0203020403  |    15| E|      READ upper_limit;
  532. ENG|0203020403  |    16| E|      command := 'SELECT res (name, city) FROM ' & table
  533. ENG|0203020403  |    17|SE|                    & ' where ' & 'cno < ' & upper_limit;
  534. ENG|0203020403  |    19| E|      SQL EXECUTE IMMEDIATE command;
  535. ENG|0203020403  |    20| E|      SQL FETCH IMMEDIATE FIRST res INTO :@cname, :@ccity;
  536. ENG|0203020403  |    21| E|      WHILE $RC = 0 DO
  537. ENG|0203020403  |    22| E|          BEGIN
  538. ENG|0203020403  |    23| E|          WRITE NL, @cname, @ccity;
  539. ENG|0203020403  |    24| E|          SQL FETCH IMMEDIATE NEXT res INTO :@cname, :@ccity;
  540. ENG|0203020403  |    25| E|          END;
  541. ENG|0203020403  |    26|  |
  542. ENG|0203020403  |    28|RI|                                                          ##0203040230->^Syntax
  543. ENG|0203020404  |     1|  |    Mass Fetch :
  544. ENG|0203020404  |     3|  |    SQL-PL offers an efficient possibility of processing result  sets  with
  545. ENG|0203020404  |     4|  |    an  extended  FETCH  command.  Specifying  vector  slices  in the FETCH
  546. ENG|0203020404  |     5|  |    command has the effect that up to 255 rows of a result set are provided
  547. ENG|0203020404  |     6|  |    with one SQL order.
  548. ENG|0203020404  |     8|  |    Example :
  549. ENG|0203020404  |    10|  |
  550. ENG|0203020404  |    11| E|    SQL ( select cno, name FROM customer order by cno );
  551. ENG|0203020404  |    12| E|    IF   $RC = 0 AND $COUNT <= 255
  552. ENG|0203020404  |    13| E|    THEN SQL ( FETCH INTO cno(1..$COUNT),name(1..$COUNT))
  553. ENG|0203020404  |    14| E|    ELSE ...
  554. ENG|0203020404  |    15|  |
  555. ENG|0203020404  |    17|RI|                                                          ##0203040231->^Syntax
  556. ENG|0203020405  |     1|  |    SQL-PL supports the handling of SQL errors in the following way:
  557. ENG|0203020405  |     2|  |    It checks, according to  the  SQL  return  code,  whether  the  current
  558. ENG|0203020405  |     3|  |    program  has  a  routine  with  the  name  specified below. If so, this
  559. ENG|0203020405  |     4|  |    routine is called implicitly via CALL, otherwise the current routine is
  560. ENG|0203020405  |     5|  |    continued with the next statement.
  561. ENG|0203020405  |     6|  |    SQL error handling routines may have one formal parameter.  The  SQL-PL
  562. ENG|0203020405  |     7|  |    runtime  system  assigns  the  name  of the routine where the SQL error
  563. ENG|0203020405  |     8|  |    occurred to it.
  564. ENG|0203020405  |    11|  |      SQLEXCEPTION  :  100 < $RC < 700
  565. ENG|0203020405  |    12| I|                                                          ##0203040236->^Syntax
  566. ENG|0203020405  |    13|  |      SQLNOTFOUND   :  $RC = 100
  567. ENG|0203020405  |    14| I|                                                          ##0203040237->^Syntax
  568. ENG|0203020405  |    15|  |      SQLTIMEOUT    :  $RC = 700
  569. ENG|0203020405  |    16| I|                                                          ##0203040238->^Syntax
  570. ENG|0203020405  |    17|S |      SQLERROR      :  $RC < 0
  571. ENG|0203020405  |    19| I|                                                          ##0203040235->^Syntax
  572. ENG|0203020405  |    20|  |      SQLWARNING    :  $SQLWARNING  (a warning is set)
  573. ENG|0203020405  |    21|RI|                                                          ##0203040239->^Syntax
  574. ENG|0203020406  |     1|  |    The CONNECT statement establishes the connection to other databases  or
  575. ENG|0203020406  |     2|  |    other user areas located on the same database.
  576. ENG|0203020406  |     4|  |    CONNECT symbolic_dbname AS (<username>, <password>, <serverdb>,
  577. ENG|0203020406  |     5|  |                               /<servernode>/)
  578. ENG|0203020406  |     7|  |    The <servernode> must only be specified, if the database is stored on a
  579. ENG|0203020406  |     8|  |    servernode other than the current node.
  580. ENG|0203020406  |    10|  |    Example :
  581. ENG|0203020406  |    12|  |
  582. ENG|0203020406  |    13| E|      READ @username, DARK, @password;
  583. ENG|0203020406  |    14| E|      CONNECT db2 AS (@username, @password, 'OTHERDB');
  584. ENG|0203020406  |    16| E|      db := 'DB2';
  585. ENG|0203020406  |    17|SE|      CONNECT :db AS ('MILLER', 'BEGINNING', 'OTHERDB', 'NODE2');
  586. ENG|0203020406  |    19|  |
  587. ENG|0203020406  |    21| I|                                                          ##0203040233->^Syntax
  588. ENG|0203020406  |    23|  |    The error codes and error messages are available in $RC and $RT.
  589. ENG|0203020406  |    25|  |    The connection is implicitly released after program execution.
  590. ENG|0203020406  |    27|  |    The  connection  can  be  released  explicitly  by means of the RELEASE
  591. ENG|0203020406  |    28|  |    statement.
  592. ENG|0203020406  |    30|  |
  593. ENG|0203020406  |    31| E|      RELEASE symbolic_dbname
  594. ENG|0203020406  |    32|  |
  595. ENG|0203020406  |    34|  |    The symbolic database name  to  which  a  physical  database  name  was
  596. ENG|0203020406  |    35|S |    assigned  in  the CONNECT statement is specified after the keyword SQL.
  597. ENG|0203020406  |    37|  |    Then the specified command is sent to the corresponding DBMS  in  order
  598. ENG|0203020406  |    38|  |    to be executed.
  599. ENG|0203020406  |    40|  |    Example :
  600. ENG|0203020406  |    42|  |
  601. ENG|0203020406  |    43| E|      READ @username, DARK, @password;
  602. ENG|0203020406  |    44| E|      CONNECT db2 AS (@username, @password, 'OTHERDB');
  603. ENG|0203020406  |    45| E|      SQL db2 ( SELECT cno, name FROM customer );
  604. ENG|0203020406  |    46| E|      SQL db2 ( FETCH INTO :cno, :name ); ...
  605. ENG|0203020406  |    47| E|      RELEASE db2;
  606. ENG|0203020406  |    48|  |
  607. ENG|0203020406  |    50|RI|                                                          ##0203040234->^Syntax
  608. ENG|02030205    |     1|  |    REPORT and Stored Commands
  609. ENG|02030205    |     3| M|    Editing Tables with #01REPORT
  610. ENG|02030205    |     4| M|    Calling #02Stored^Commands
  611. ENG|02030205    |     5| M|    in #03Multi-DB^Mode
  612. ENG|02030205    |     6| M|    Specifying a #04Header
  613. ENG|02030205    |     7| M|    #05Options
  614. ENG|02030205    |     8|RM|    Reusing the Results ( #06RESULT )
  615. ENG|0203020501  |     1|  |    The  interface with the ADABAS report generator is provided for editing
  616. ENG|0203020501  |     2|  |    database result sets.
  617. ENG|0203020501  |     4|  |
  618. ENG|0203020501  |     5| E|       SQL ( SELECT * FROM customer );
  619. ENG|0203020501  |     6| E|       REPORT CMD ( TTITLE ''== customers =='');
  620. ENG|0203020501  |     7|  |
  621. ENG|0203020501  |     9| I|    Any ##08REPORT commands may be specified - separated by semicolons  or  the
  622. ENG|0203020501  |    10|  |    end of line.
  623. ENG|0203020501  |    12|  |    Example :
  624. ENG|0203020501  |    14|  |
  625. ENG|0203020501  |    15| E|       SQL ( SELECT * FROM customer );
  626. ENG|0203020501  |    16| E|       REPORT CMD ( TTITLE ''== customers =='' ; TOTAL bank balance
  627. ENG|0203020501  |    17|SE|                GROUP customer number );
  628. ENG|0203020501  |    19|  |
  629. ENG|0203020501  |    23|  |    SQL-PL variables denoted by a colon are replaced by text prior to being
  630. ENG|0203020501  |    24|  |    called.
  631. ENG|0203020501  |    26|  |    Example :
  632. ENG|0203020501  |    28|  |
  633. ENG|0203020501  |    29| E|       variable_with_REPORT_commands := 'GROUP customer number ; TOTAL 1';
  634. ENG|0203020501  |    30| E|       SQL ( SELECT * FROM customer );
  635. ENG|0203020501  |    31| E|       READ @title;
  636. ENG|0203020501  |    32| E|       REPORT CMD (:variable_with_REPORT_commands ; TTITLE :@title);
  637. ENG|0203020501  |    33|  |
  638. ENG|0203020501  |    35|S |    To  edit  named  result  sets  with REPORT, the result set name must be
  639. ENG|0203020501  |    37|  |    specified. This may also be a variable name (denoted by a leading ':').
  640. ENG|0203020501  |    39|  |
  641. ENG|0203020501  |    40| E|       SQL ( SELECT  result (*) FROM customer );
  642. ENG|0203020501  |    41| E|       REPORT result CMD (TTITLE ''== customers =='');
  643. ENG|0203020501  |    43| E|      res := 'RESULT';
  644. ENG|0203020501  |    44| E|      REPORT :res CMD (TTITLE ''== customers =='');
  645. ENG|0203020501  |    45|  |
  646. ENG|0203020501  |    47|  |    REPORT SHOW edits the result set of the last SHOW or EXPLAIN command.
  647. ENG|0203020501  |    49| I|    ##0203020503Another^database, a ##0203020504header, ##0203020505options,  or  ##0203020506results^to^be^reused  may  be
  648. ENG|0203020501  |    50|  |    specified in addition.
  649. ENG|0203020501  |    52|S |    Example :
  650. ENG|0203020501  |    55|  |
  651. ENG|0203020501  |    56| E|      REPORT res
  652. ENG|0203020501  |    57| E|             DBNAME = database2
  653. ENG|0203020501  |    58| E|             HEADER 'customers'
  654. ENG|0203020501  |    59| E|             CMD ( TTITLE 'all customers'
  655. ENG|0203020501  |    60| E|                   TOTAL 'total sum : ' 3 )
  656. ENG|0203020501  |    61| E|             OPTIONS ( BACKGROUND, SETLOCAL )
  657. ENG|0203020501  |    62| E|             RESULT ( tot_sum = SUM (3), average = AVG (4) );
  658. ENG|0203020501  |    63|  |
  659. ENG|0203020501  |    65|RI|                                                          ##0203040243->^Syntax
  660. ENG|0203020502  |     1|  |    There  are  two  syntactical ways of calling stored commands defined in
  661. ENG|0203020502  |     2|  |    QUERY.
  662. ENG|0203020502  |     5|  |    On the one hand the QUERY syntax may be used  for  calling  the  stored
  663. ENG|0203020502  |     6|  |    command.  The  keyword CMD is followed by the call as it is used in the
  664. ENG|0203020502  |     7|  |    QUERY command line. In SQL-PL variables may be specified  in  addition.
  665. ENG|0203020502  |     8|  |    These  must  be  denoted by a leading ':'. Before the stored command is
  666. ENG|0203020502  |     9|  |    called, the variables will be substituted by their current values.
  667. ENG|0203020502  |    11|  |    Example :
  668. ENG|0203020502  |    13|  |
  669. ENG|0203020502  |    14| E|      QUERY  CMD ( run customer_list );
  670. ENG|0203020502  |    16| E|      QUERY  CMD ( run :$USER.customer_list :no 'customers' );
  671. ENG|0203020502  |    17|S |
  672. ENG|0203020502  |    19|  |    The second way of calling a stored command is to specify its  name  and
  673. ENG|0203020502  |    20|  |    that  of  its  owner,  if  necessary. This specification may be done as
  674. ENG|0203020502  |    21|  |    constant or variable (denoted by a leading ':').
  675. ENG|0203020502  |    23|  |    Parameters which may be required are specified after the  keyword  PARM
  676. ENG|0203020502  |    24|  |    (or  PARMS),  separated from each other by a comma. Any expressions may
  677. ENG|0203020502  |    25|  |    be passed as parameters. NULL values are not allowed !!!
  678. ENG|0203020502  |    27|  |    Example :
  679. ENG|0203020502  |    29|  |
  680. ENG|0203020502  |    30| E|      QUERY  customer_list;
  681. ENG|0203020502  |    32| E|      QUERY  :$USER.customer_list
  682. ENG|0203020502  |    33| E|             PARMS ( no, 'customers' );
  683. ENG|0203020502  |    34|S |
  684. ENG|0203020502  |    37| I|    ##0203020503Another^database, and - if the stored command contains a REPORT call  -
  685. ENG|0203020502  |    38| I|    a   ##0203020504header,  ##0203020505options,  or  ##0203020506results^to^be^reused  may  be  specified  in
  686. ENG|0203020502  |    39|  |    addition.
  687. ENG|0203020502  |    41|  |    Examples :
  688. ENG|0203020502  |    43|  |
  689. ENG|0203020502  |    44| E|      QUERY  DBNAME = database2
  690. ENG|0203020502  |    45| E|             HEADER 'customers'
  691. ENG|0203020502  |    46| E|             CMD ( run :$USER.customer_list :no 'customers' )
  692. ENG|0203020502  |    47| E|             OPTION ( SETOFF )
  693. ENG|0203020502  |    48| E|             RESULT ( tot_sum = SUM (3) );
  694. ENG|0203020502  |    50| E|      QUERY  :$USER.customer_list
  695. ENG|0203020502  |    51| E|             DBNAME = database2
  696. ENG|0203020502  |    52| E|             HEADER 'customers'
  697. ENG|0203020502  |    53|SE|             PARMS ( no, 'customers' )
  698. ENG|0203020502  |    55| E|             OPTION ( SETOFF )
  699. ENG|0203020502  |    56| E|             RESULT ( tot_sum = SUM (3) );
  700. ENG|0203020502  |    57|  |
  701. ENG|0203020502  |    59|RI|                                                          ##0203040241->^Syntax
  702. ENG|0203020503  |     1|  |    Result sets which were not generated in the default database  can  also
  703. ENG|0203020503  |     2|  |    be  edited  with  REPORT.  The  symbolic  database  name  is  therefore
  704. ENG|0203020503  |     3|  |    specified.
  705. ENG|0203020503  |     5|  |    In the same way stored commands may be called by another database.
  706. ENG|0203020503  |     7|  |    Examples:
  707. ENG|0203020503  |     9|  |
  708. ENG|0203020503  |    10| E|      SQL db2 ( SELECT  result (*) FROM customer );
  709. ENG|0203020503  |    11| E|      REPORT result CMD (TTITLE ''== customers =='')
  710. ENG|0203020503  |    12| E|             DBNAME = db2;
  711. ENG|0203020503  |    14| E|      QUERY customer_list
  712. ENG|0203020503  |    15| E|            DBNAME = db2;
  713. ENG|0203020503  |    17|SE|      QUERY  :$USER.customer_list PARMS ( no, 'customers' )
  714. ENG|0203020503  |    19| E|             DBNAME = db2;
  715. ENG|0203020503  |    20|  |
  716. ENG|0203020503  |    22|RI|                                                          ##0203040241->^Syntax
  717. ENG|0203020504  |     1|  |    A title of up to 40 characters may be defined for  a  REPORT  page.  An
  718. ENG|0203020504  |     2|  |    expression  (e.g.  a  character  string  or  a  variable)  is therefore
  719. ENG|0203020504  |     3|  |    specified after the keyword HEADER. The title is truncated to the first
  720. ENG|0203020504  |     4|  |    40 characters, if necessary. If no title is specified, the name of  the
  721. ENG|0203020504  |     5|  |    result table is output as such.
  722. ENG|0203020504  |     7|  |    Examples :
  723. ENG|0203020504  |     9|  |
  724. ENG|0203020504  |    10| E|      QUERY  HEADER 'customers'
  725. ENG|0203020504  |    11| E|             CMD ( run :$USER.customer_list :no 'customers' );
  726. ENG|0203020504  |    13| E|      QUERY  :$USER.customer_list
  727. ENG|0203020504  |    14| E|             PARMS ( no, 'customers' )
  728. ENG|0203020504  |    15| E|             HEADER 'customers of the ' & DATE (dd.mm.yyyy);
  729. ENG|0203020504  |    17|SE|      REPORT HEADER 'customers'
  730. ENG|0203020504  |    19| E|             CMD ( TTITLE 'all customers'
  731. ENG|0203020504  |    20| E|                   TOTAL 'total sum : ' 3 )
  732. ENG|0203020504  |    21|  |
  733. ENG|0203020504  |    23|RI|                                                          ##0203040241->^Syntax
  734. ENG|0203020505  |     1|  |    It  is  possible  to  specify  options for the execution of REPORT. The
  735. ENG|0203020505  |     2|  |    option BACKGROUND prevents a result set edited by the REPORT  generator
  736. ENG|0203020505  |     3|  |    from being output to the screen up to the next screen output.
  737. ENG|0203020505  |     5|  |    During REPORT execution interactive modifications to the SET parameters
  738. ENG|0203020505  |     6|  |        can be prevented by means of SETOFF,
  739. ENG|0203020505  |     7|  |        can  be  allowed  temporarily  by  means of SETLOCAL, i.e. when the
  740. ENG|0203020505  |     8|  |        REPORT display is left again, the SET parameters are reset  to  the
  741. ENG|0203020505  |     9|  |        values they had before the REPORT call.
  742. ENG|0203020505  |    10|  |    If  no  option is specified for the modification of the SET parameters,
  743. ENG|0203020505  |    11|  |    any modification made to these parameters will have  a  global  effect,
  744. ENG|0203020505  |    12|  |    i.e. it will be valid up to the next alteration of the SET parameters.
  745. ENG|0203020505  |    17|S |    Examples :
  746. ENG|0203020505  |    19|  |
  747. ENG|0203020505  |    20| E|      QUERY  OPTION ( SETOFF )
  748. ENG|0203020505  |    21| E|             CMD ( run :$USER.customer_list :no 'customers' );
  749. ENG|0203020505  |    23| E|      QUERY  :$USER.customer_list
  750. ENG|0203020505  |    24| E|             PARMS ( no, 'customers' )
  751. ENG|0203020505  |    25| E|             OPTION ( SETOFF );
  752. ENG|0203020505  |    27| E|      REPORT CMD ( TTITLE 'all customers'
  753. ENG|0203020505  |    28| E|                   TOTAL 'total sum : ' 3 )
  754. ENG|0203020505  |    29| E|             OPTIONS ( BACKGROUND, SETLOCAL );
  755. ENG|0203020505  |    30|  |
  756. ENG|0203020505  |    32|RI|                                                          ##0203040245->^Syntax
  757. ENG|0203020506  |     1|  |    Total results computed by the REPORT generator for result table columns
  758. ENG|0203020506  |     2|  |    (SUM,  AVG, MIN, MAX, COUNT, or user-defined arithmetic expression) may
  759. ENG|0203020506  |     3|  |    be used in SQL-PL. The corresponding result is therefore assigned to  a
  760. ENG|0203020506  |     4|  |    variable.  A  result  is  only  not NULL if during REPORT execution any
  761. ENG|0203020506  |     5|  |    result was computed for the specified column, i.e. when the  result  is
  762. ENG|0203020506  |     6|  |    defined  either  with  the  REPORT  call or interactively during REPORT
  763. ENG|0203020506  |     7|  |    execution.
  764. ENG|0203020506  |     9|  |    Examples :
  765. ENG|0203020506  |    11|  |
  766. ENG|0203020506  |    12| E|      QUERY  CMD ( run :$USER.customer_list :no 'customers' )
  767. ENG|0203020506  |    13| E|             RESULT ( tot_sum = SUM (3) );
  768. ENG|0203020506  |    15| E|      QUERY  :$USER.customer_list PARMS ( no, 'customers' )
  769. ENG|0203020506  |    16|SE|             RESULT ( tot_sum = SUM (3) );
  770. ENG|0203020506  |    19| E|      REPORT CMD ( TTITLE 'all customers'; TOTAL 'total sum : ' 3 )
  771. ENG|0203020506  |    20| E|             RESULT ( tot_sum = SUM (3), average = AVG (4) );
  772. ENG|0203020506  |    21|  |
  773. ENG|0203020506  |    23|RI|                                                          ##0203040244->^Syntax
  774. ENG|02030206    |     1|  |                    Editing Operating System Files
  775. ENG|02030206    |     2|  |                    ------------------------------
  776. ENG|02030206    |     4| M|                    #01Opening and#01Closing OS Files
  777. ENG|02030206    |     5| M|                    #02Reading OS Files
  778. ENG|02030206    |     6|RM|                    #03Writing OS Files
  779. ENG|0203020601  |     1|  |
  780. ENG|0203020601  |     2| E|      OPEN  fileid  filename   READ or WRITE or APPEND
  781. ENG|0203020601  |     4| E|      CLOSE fileid
  782. ENG|0203020601  |     5|  |
  783. ENG|0203020601  |     7|  |    The <fileid> is an internal name for a file. This <fileid> can be  used
  784. ENG|0203020601  |     8|  |    with  READFILE,  WRITEFILE,  or CLOSE to relate to the file opened with
  785. ENG|0203020601  |     9|  |    OPEN. READ opens a file in read mode, WRITE in write mode. APPEND opens
  786. ENG|0203020601  |    10|  |    an existing file in write mode preserving its previous contents.
  787. ENG|0203020601  |    12|  |    Examples :
  788. ENG|0203020601  |    14|  |
  789. ENG|0203020601  |    15| E|    OPEN input 'input file' READ
  790. ENG|0203020601  |    16| E|    READFILE input a:5,b:6;
  791. ENG|0203020601  |    17|SE|    CLOSE input
  792. ENG|0203020601  |    19|  |
  793. ENG|0203020601  |    21| I|                                                          ##0203040250<open^file^stmt>->^Syntax
  794. ENG|0203020601  |    22|RI|                                                          ##0203040251<close^file^stmt>->^Syntax
  795. ENG|0203020602  |     1|  |    The READFILE statement can be used for reading data from OS files  into
  796. ENG|0203020602  |     2|  |    SQL-PL variables. The data must exist in readable form.
  797. ENG|0203020602  |     4|  |    Example :
  798. ENG|0203020602  |     6|  |
  799. ENG|0203020602  |     7| E|    OPEN input 'input file' READ;
  800. ENG|0203020602  |     8| E|    READFILE input l:5 , b:l , c;
  801. ENG|0203020602  |     9|  |
  802. ENG|0203020602  |    10|  |    /* The length of the subsequent value will be read into the
  803. ENG|0203020602  |    11|  |    /* variable l !
  804. ENG|0203020602  |    13|  |    A  length specification must be made for each variable - except for the
  805. ENG|0203020602  |    14|  |    last one.
  806. ENG|0203020602  |    16|RI|                                                          ##0203040254->^Syntax
  807. ENG|0203020603  |     1|  |    The WRITEFILE statement can be used for writing data to an OS file.
  808. ENG|0203020603  |     3|  |    Example :
  809. ENG|0203020603  |     5|  |
  810. ENG|0203020603  |     6| E|    filename := 'input file';
  811. ENG|0203020603  |     7| E|    OPEN output filename WRITE
  812. ENG|0203020603  |     8| E|    WRITEFILE output 'This file is named ', filename:7 ;
  813. ENG|0203020603  |     9| E|    WRITEFILE output 'Now follow 25 blanks ',' ':25;
  814. ENG|0203020603  |    10|  |
  815. ENG|0203020603  |    12|  |    A  length  specification  can  follow  the  values.   If   the   length
  816. ENG|0203020603  |    13|  |    specification  is omitted, the value is output in its actual length. If
  817. ENG|0203020603  |    14|  |    the length specification is too  large  or  too  small,  the  value  is
  818. ENG|0203020603  |    15|  |    truncated or padded with blanks.
  819. ENG|0203020603  |    17|RI|                                                          ##0203040252->^Syntax
  820. ENG|02030207    |     1|  |    It  is  possible  to call the editor out of an SQL-PL routine. A vector
  821. ENG|02030207    |     2|  |    slice or a variable must be specified as argument.
  822. ENG|02030207    |     4|  |    If a vector slice is specified, each vector  component  corresponds  to
  823. ENG|02030207    |     5|  |    one line of the edit form.
  824. ENG|02030207    |     7|  |    nf Example:
  825. ENG|02030207    |     9|  |
  826. ENG|02030207    |    10| E|              EDIT ( text (1..20) ); E$}
  827. ENG|02030207    |    12| E|    If  a  variable  is  specified,  the  text  edited within the editor is
  828. ENG|02030207    |    13| E|    assigned to it. This  text  can  be  reedited  at  any  time.  It  can,
  829. ENG|02030207    |    14| E|    particularly, be stored in the database in a STRING column.
  830. ENG|02030207    |    16| E|    Example  :
  831. ENG|02030207    |    17|SE|    {$E
  832. ENG|02030207    |    19| E|                      PROC customer.c_maintain
  833. ENG|02030207    |    20| E|                       ...
  834. ENG|02030207    |    21| E|                      SQL ( OPEN COLUMN ... IN WRITE MODE );
  835. ENG|02030207    |    22| E|                      SQL ( READ COLUMN ... BUFFER :text );
  836. ENG|02030207    |    23| E|                      EDIT ( text );
  837. ENG|02030207    |    24| E|                      SQL ( WRITE COLUMN ... BUFFER :text );
  838. ENG|02030207    |    25| E|                      SQL ( CLOSE COLUMN ... );
  839. ENG|02030207    |    26|  |
  840. ENG|02030207    |    28|  |    The following parameters can be specified in addition:
  841. ENG|02030207    |    30|  |    POS  (<line>,  <column>) determines the position of the upper left-hand
  842. ENG|02030207    |    31|  |    corner of the editor window on the screen.
  843. ENG|02030207    |    33|  |    SIZE (<lines>, <columns>) determines the size of the window.
  844. ENG|02030207    |    35|S |    MARK (<lines>, <columns>) determines the cursor position.
  845. ENG|02030207    |    37|  |    MSG = <expression> sets the message line of the editor to a value.
  846. ENG|02030207    |    39|  |    LABEL = <expression> (or HEADER) sets the header line of the editor  to
  847. ENG|02030207    |    40|  |    a value.
  848. ENG|02030207    |    42|  |    COMPID  =  <expression>  sets  the left field in the header line of the
  849. ENG|02030207    |    43|  |    editor to a value.
  850. ENG|02030207    |    45|  |    PRINT prints the contents of the editor.
  851. ENG|02030207    |    47|  |    KEYSWAP has the effect that the key assignment is transferred from  the
  852. ENG|02030207    |    48|  |    SQL-PL routine to the editor.
  853. ENG|02030207    |    50|  |    NOINIT  has the effect that the position of the editor window is stored
  854. ENG|02030207    |    51|  |    when leaving the editor. This position will be reestablished  with  the
  855. ENG|02030207    |    52|S |    next editor call made with NOINIT option and the same SQL-PL variable.
  856. ENG|02030207    |    55|  |    F1  =  <expression>  activates  the  first  function  key (PF1 or SK1).
  857. ENG|02030207    |    56|  |    Possible is the specification of F1 to F9, HELP, UP, and DOWN.
  858. ENG|02030207    |    58|  |    MAXLINES = <expression>  determines  the  number  of  alterable  vector
  859. ENG|02030207    |    59|  |    components.
  860. ENG|02030207    |    61|  |    After  calling the editor, the variables $CMD, $EDITLINES, and $KEY are
  861. ENG|02030207    |    62|  |    set.
  862. ENG|02030207    |    64|RI|                                                          ##0203040247->^Syntax
  863. ENG|02030209    |     1|  |    The components of the first vector are sorted either in ascending order
  864. ENG|02030209    |     2|  |    (GTSORT) or in descending (LTSORT) order. The  components  of  all  the
  865. ENG|02030209    |     3|  |    other vectors are permuted accordingly.
  866. ENG|02030209    |     5|  |    Examples :
  867. ENG|02030209    |     7|  |
  868. ENG|02030209    |     8| E|      GTSORT ( lastname(1..10), firstname(), city() );
  869. ENG|02030209    |     9| E|      LTSORT ( length(1..number) );
  870. ENG|02030209    |    10|  |
  871. ENG|02030209    |    12|RI|                                                          ##0203040215->^Syntax
  872. ENG|02030210    |     1|  |    The values of the user-specific SET parameters can be changed in SQL-PL
  873. ENG|02030210    |     2|  |    programs by means of the SET statement.
  874. ENG|02030210    |     4|  |    Examples :
  875. ENG|02030210    |     6|  |
  876. ENG|02030210    |     7| E|      SET ( NULL, '' );
  877. ENG|02030210    |     8| E|      SET ( DECIMALREP, '//./' );
  878. ENG|02030210    |     9|  |
  879. ENG|02030210    |    11| M|    Only runtime-relevant SET parameters can be determined via #01keywords.
  880. ENG|02030210    |    13| I|    The  ##0203030311SET^function  can  be  used  to  find  out  the  values of the SET
  881. ENG|02030210    |    14|  |    parameters.
  882. ENG|02030210    |    16|RI|                                                          ##0203040311->^Syntax
  883. ENG|0203021001  |     1|  |    The following key words are available for the SET-command
  884. ENG|0203021001  |     3|  |    LANGUAGE        the language of the current program
  885. ENG|0203021001  |     4|  |    NULLVALUE       the representation of the null value
  886. ENG|0203021001  |     5|  |    SEPARATOR       the symbol used as separator of REPORT columns
  887. ENG|0203021001  |     6|  |    DECIMALREP      the representation of numeric values
  888. ENG|0203021001  |     7|  |    DATE            the representation of date values
  889. ENG|0203021001  |     8|  |    TIME            the representation of time values
  890. ENG|0203021001  |     9|  |    COPIES          the number of copies for print jobs
  891. ENG|0203021001  |    10|  |    PROTOCOL        the name of the file for SQLTRACE/MODULETRACE output
  892. ENG|0203021001  |    11| I|    SYSEDITOR       the name of the editor specified for ##040314SYSEDIT
  893. ENG|0203021001  |    12|  |    PRINFORMAT      the name of the current print format
  894. ENG|0203021001  |    13|  |    PRESENTATION    the name of the current screen setting
  895. ENG|0203021001  |    15|RI|                                                          ##0203040302->^Syntax
  896. ENG|02030211    |     1|  |    The dollar functions $SEC and $MICRO  can  be  used  to  find  out  the
  897. ENG|02030211    |     2|  |    duration of runs.
  898. ENG|02030211    |     3|  |    For  this  purpose  the  statement  INITTIME  starts the stop watch and
  899. ENG|02030211    |     4|  |    initializes  the  two  variables.  GETTIME  assigns  the   seconds   or
  900. ENG|02030211    |     5|  |    microseconds passed since INITTIME to $SEC and $MICRO.
  901. ENG|02030211    |     7|  |    Example :
  902. ENG|02030211    |     9|  |
  903. ENG|02030211    |    10| E|      PROC systime.control_appl;
  904. ENG|02030211    |    12| E|      READ @applname, @startmodule;
  905. ENG|02030211    |    14| E|      INITTIME;
  906. ENG|02030211    |    15| E|      SWITCHCALL :@applname CALL PROC :@startmodule;
  907. ENG|02030211    |    16|SE|      GETTIME;
  908. ENG|02030211    |    19| E|      WRITE 'program execution', :@applname, NL;
  909. ENG|02030211    |    20| E|      WRITE $SEC, $MICRO, PAUSE;
  910. ENG|02030211    |    21|  |
  911. ENG|02030211    |    23|RI|                                                          ##0203040313->^Syntax
  912. ENG|02030212    |     1|  |    The  EXEC command may be used for calling operating system commands out
  913. ENG|02030212    |     2|  |    of an SQL-PL program.
  914. ENG|02030212    |     4|  |    Operating  system  commands  usually  are  called  synchronously.  Some
  915. ENG|02030212    |     5|  |    operating systems allow an asynchronous command call in addition.
  916. ENG|02030212    |     7|  |    In  case  of  a  synchronous  call  a program result is returned to any
  917. ENG|02030212    |     8|  |    SQL-PL variable. In case of an asynchronous call there is  not  such  a
  918. ENG|02030212    |     9|  |    result.
  919. ENG|02030212    |    11|  |    Examples:
  920. ENG|02030212    |    13|  |
  921. ENG|02030212    |    14| E|      EXEC 'ls -l' RESULT resultvar;         /* synchronous call
  922. ENG|02030212    |    16| E|      EXEC ASYNC 'ls -l > list';             /* asynchronous call
  923. ENG|02030212    |    17|S |
  924. ENG|02030212    |    19|RI|                                                          ##0203040257->^Syntax
  925. ENG|020303      |     1|  |                      Standard Functions
  926. ENG|020303      |     2|  |                      ------------------
  927. ENG|020303      |     4| M|                      #01$^Functions
  928. ENG|020303      |     5| M|                      #02Arithmetic^Functions
  929. ENG|020303      |     6| M|                      #03String^Functions
  930. ENG|020303      |     7|RM|                      #04Date^and^Time^Functions
  931. ENG|02030301    |     1|  |                            $-Funktionen
  932. ENG|02030301    |     2|  |                            ------------
  933. ENG|02030301    |     4| M|    #02$ACTION               #05$MAXLINES             #03$SEC
  934. ENG|02030301    |     5| M|    #02$CMD                  #05$MAXCOLS              #03$SERVERDB
  935. ENG|02030301    |     6| M|    #09$COLNO               ##02030211$MICRO                #03$SQLCODE
  936. ENG|02030301    |     7| M|    #04$COUNT                #07$MSGLINES             #03$SQLERRMC
  937. ENG|02030301    |     8| M|    #02$CURSOR               #08$OS                   #03$SQLERRPOS
  938. ENG|02030301    |     9| M|    #02$EDITLINES            #08$PROCESSID            #06$SQLWARN
  939. ENG|02030301    |    10| M|    #02$FUNCTION             #03$RC                   #10$SYSRC
  940. ENG|02030301    |    11| M|    #01$GROUP                #09$ROWNO                #10$SYSRT
  941. ENG|02030301    |    12| M|    #10$ITEMS                #03$RT                   #08$TERM
  942. ENG|02030301    |    13| M|    #07$KEY                  #05$SCREENCOLS           #01$USER
  943. ENG|02030301    |    14| M|    #05$KEYLINES             #05$SCREENLNS            #01$USERMODE
  944. ENG|02030301    |    16|RI|                                                          ##0203040253->^Syntax
  945. ENG|0203030101  |     1|  |    $USER       provides the name of the user who called the routine.
  946. ENG|0203030101  |     3|  |    $GROUP      provides the name of the usergroup.
  947. ENG|0203030101  |     5|  |    $SERVERDB   provides the name of the database.
  948. ENG|0203030101  |     7|  |    $USERMODE   provides the status of the user (STANDARD, RESOURCE, DBA)
  949. ENG|0203030101  |     9|RI|                                                          ##0203040315->^Syntax
  950. ENG|0203030102  |     1|  |    $KEY        provides the last release key used.
  951. ENG|0203030102  |     2|  |                Possible keys are : F1, ..., F9, ENTER, HELP
  952. ENG|0203030102  |     4|  |    $CURSOR     provides the number of the input field where the
  953. ENG|0203030102  |     5|  |                cursor was placed for the last FORM call.
  954. ENG|0203030102  |     7|  |    $CMD        provides the contents of the editor command line, when
  955. ENG|0203030102  |     8|  |                the editor was called out of an SQL-PL routine.
  956. ENG|0203030102  |    10|  |    $EDITLINES  provides the number of lines edited for an editor call.
  957. ENG|0203030102  |    12|  |    $ACTION     provides the activated field of the action bar.
  958. ENG|0203030102  |    14|  |    $FUNCTION   provides the selected field of a pulldown menu.
  959. ENG|0203030102  |    16|RI|                                                          ##0203040316->^Syntax
  960. ENG|0203030103  |     1|  |    $RC provides the return code of the last SQL command.
  961. ENG|0203030103  |     3|  |    Some important return codes :
  962. ENG|0203030103  |     5|  |                    0   - everything OK
  963. ENG|0203030103  |     6|  |                    100 - row not found
  964. ENG|0203030103  |     7|  |                    200 - duplicate key
  965. ENG|0203030103  |     8|  |                    300 - integrity violation
  966. ENG|0203030103  |    10|  |    $RT provides the (error) text appropriate for $RC.
  967. ENG|0203030103  |    12|  |    Example :
  968. ENG|0203030103  |    14|  |       $RC = 100   -->  $RT = '100 row not found'
  969. ENG|0203030103  |    16|S |    Synonym for $RC is $SQLCODE; for $RT  $SQLERRMC.
  970. ENG|0203030103  |    19|  |    $SQLERRPOS provides the error position within the SQL statement
  971. ENG|0203030103  |    20|  |               in case the analysis fails.
  972. ENG|0203030103  |    22|RI|                                                          ##0203040316->^Syntax
  973. ENG|0203030104  |     1|  |    $COUNT provides the number of rows found with a mass select.
  974. ENG|0203030104  |     2|  |    After the SQL command
  975. ENG|0203030104  |     4|  |         SQL ( select * from customer );
  976. ENG|0203030104  |     6|  |    the following is possible:
  977. ENG|0203030104  |     8|  |         $COUNT = 0      no row found ( $RC = 100 )
  978. ENG|0203030104  |     9|  |         $COUNT = n      n rows found
  979. ENG|0203030104  |    10|  |         $COUNT IS NULL  rows found, but the number
  980. ENG|0203030104  |    11|  |                         is not known yet.
  981. ENG|0203030104  |    13|  |    After  UPDATE,  INSERT,  DELETE,  and SHOW commands $COUNT provides the
  982. ENG|0203030104  |    14|  |    number of affected rows in addition.
  983. ENG|0203030104  |    16|RI|                                                          ##0203040315->^Syntax
  984. ENG|0203030105  |     1|  |    $SCREENLNS    provides the maximum number of lines in the form
  985. ENG|0203030105  |     2|  |                  called last.
  986. ENG|0203030105  |     4|  |    $SCREENCOLS   provides the maximum number of characters possible
  987. ENG|0203030105  |     5|  |                  per line in the form called last.
  988. ENG|0203030105  |     7|  |    $MAXLINES     provides the maximum number of lines possible per
  989. ENG|0203030105  |     8|  |                  form.
  990. ENG|0203030105  |    10|  |    $MAXCOLS      provides the maximum number of characters per screen
  991. ENG|0203030105  |    11|  |                  line.
  992. ENG|0203030105  |    13|RI|                                                          ##0203040314->^Syntax
  993. ENG|0203030106  |     1|  |    $SQLWARN
  994. ENG|0203030106  |     3|  |    The warnings returned by the database system can be checked  with  this
  995. ENG|0203030106  |     4|  |    function.  The  function  must be used within logical expressions (e.g.
  996. ENG|0203030106  |     5|  |    IF). $SQLWARN results true, if further  warnings  have  been  returned;
  997. ENG|0203030106  |     6|  |    these can be checked with $SQLWARN(1) ... $SQLWARN(15).
  998. ENG|0203030106  |     8|  |    Example :
  999. ENG|0203030106  |    10|  |
  1000. ENG|0203030106  |    11| E|    IF   $SQLWARN          /* any warning ?
  1001. ENG|0203030106  |    12| E|    THEN FOR i := 1 to 15
  1002. ENG|0203030106  |    13| E|             IF   $SQLWARN (i)
  1003. ENG|0203030106  |    14| E|             THEN WRITE NL,'Warning ',i,' is set';
  1004. ENG|0203030106  |    15|  |
  1005. ENG|0203030106  |    17|RI|                                                          ##0203040316->^Syntax
  1006. ENG|0203030107  |     1|  |    $KEYLINES  provides 1, if there is a key for the softkey line
  1007. ENG|0203030107  |     2|  |               available on the screen, otherwise it provides 0.
  1008. ENG|0203030107  |     4|  |    $MSGLINES  provides 1, if there is an additional system line
  1009. ENG|0203030107  |     5|  |               available on the screen for the message, otherwise
  1010. ENG|0203030107  |     6|  |               it provides 0.
  1011. ENG|0203030107  |     8|RI|                                                          ##0203040315->^Syntax
  1012. ENG|0203030108  |     1|  |    $OS         provides the name of the current operating system
  1013. ENG|0203030108  |     3|  |    $TERM       provides the value of the environment variable TERM
  1014. ENG|0203030108  |     5|  |    $PROCESSID  provides the numerical value of the current operating
  1015. ENG|0203030108  |     6|  |                system process
  1016. ENG|0203030108  |     8|RI|                                                          ##0203040315->^Syntax
  1017. ENG|0203030109  |     1|  |    $ROWNO, $COLNO  provide, after a REPORT call, the row and column
  1018. ENG|0203030109  |     2|  |                    of the REPORT display where the cursor was
  1019. ENG|0203030109  |     3|  |                    positioned last. If the cursor was positioned
  1020. ENG|0203030109  |     4|  |                    outside the REPORT display, then $ROWNO and $COLNO
  1021. ENG|0203030109  |     5|  |                    are 0.
  1022. ENG|0203030109  |     7|RI|                                                          ##0203040314->^Syntax
  1023. ENG|0203030110  |     1|  |    $SYSRC      provides the return code of the last file or EXEC command
  1024. ENG|0203030110  |     3|  |    $SYSRT      provides an explanation of the error
  1025. ENG|0203030110  |     5|  |    $ITEMS      provides the number of fields parsed during the last
  1026. ENG|0203030110  |     6|  |                TOKENIZE or SEPARATE. $ITEMS provides also the number
  1027. ENG|0203030110  |     7|  |                of replacements made during the last CHANGE
  1028. ENG|0203030110  |     9|RI|                                                          ##0203040315->^Syntax
  1029. ENG|02030302    |     1|  |                      Arithmetic Functions
  1030. ENG|02030302    |     2|  |                      --------------------
  1031. ENG|02030302    |     4| M|                      #07ABS          #01MIN
  1032. ENG|02030302    |     5| M|                      #03ARCTAN       #05PI
  1033. ENG|02030302    |     6| M|                      #01AVG          #02ROUND
  1034. ENG|02030302    |     7| M|                      #03COS          #03SIGN
  1035. ENG|02030302    |     8| M|                      #04EXP          #03SIN
  1036. ENG|02030302    |     9| M|                      #04LN           #06SQR
  1037. ENG|02030302    |    10| M|                      #01MAX          #06SQRT
  1038. ENG|02030302    |    11| M|                      #05MDS          #02TRUNC
  1039. ENG|02030302    |    12|RI|                                                          ##0203040259->^Syntax
  1040. ENG|0203030201  |     1|  |    MIN  provides the smallest value of the specified set.
  1041. ENG|0203030201  |     3|  |    MAX  provides the largest value of the specified set.
  1042. ENG|0203030201  |     5|  |    AVG  provides the average value of the specified set.
  1043. ENG|0203030201  |     7|  |    Examples :
  1044. ENG|0203030201  |     9|  |
  1045. ENG|0203030201  |    10| E|      MIN (1,2,3)     --> 1
  1046. ENG|0203030201  |    11| E|      MAX (1,1/0,3)   --> 3            ( 1/0  -> NULL ! )
  1047. ENG|0203030201  |    12| E|      AVG (1,10/0,3)  --> NULL
  1048. ENG|0203030201  |    13|  |
  1049. ENG|0203030201  |    15|RI|                                                          ##0203040302->^Syntax
  1050. ENG|0203030202  |     1|  |    ROUND  rounds the number to the specified number of fractional digits.
  1051. ENG|0203030202  |     3|  |    TRUNC  truncates the number to the specified number of fractional digits.
  1052. ENG|0203030202  |     5|  |    Examples :
  1053. ENG|0203030202  |     7|  |
  1054. ENG|0203030202  |     8| E|      ROUND (1234.567 , 2)  --> 1234.57
  1055. ENG|0203030202  |     9| E|      TRUNC (1234.567 , 2)  --> 1234.56
  1056. ENG|0203030202  |    10| E|      TRUNC (1/0,3)         --> NULL         ( 1/0  -> NULL ! )
  1057. ENG|0203030202  |    11|  |
  1058. ENG|0203030202  |    13|RI|                                                          ##0203040259->^Syntax
  1059. ENG|0203030203  |     1|  |    SIN COS ARCTAN
  1060. ENG|0203030203  |     3|  |    The known trigonometrical functions.
  1061. ENG|0203030203  |     4|  |    The radian is expected as argument.
  1062. ENG|0203030203  |     6|  |    Examples :
  1063. ENG|0203030203  |     8|  |
  1064. ENG|0203030203  |     9| E|      SIN (0)     --> 0
  1065. ENG|0203030203  |    10| E|      COS (0)     --> 1
  1066. ENG|0203030203  |    11| E|      ARCTAN (0)  --> 0
  1067. ENG|0203030203  |    12|  |
  1068. ENG|0203030203  |    14|RI|                                                          ##0203040259->^Syntax
  1069. ENG|0203030204  |     1|  |    EXP LN
  1070. ENG|0203030204  |     3|  |    The known mathematical functions
  1071. ENG|0203030204  |     5|  |    Example :
  1072. ENG|0203030204  |     7|  |
  1073. ENG|0203030204  |     8| E|      LN (EXP(5)) --> 5  (approx.)
  1074. ENG|0203030204  |     9|  |
  1075. ENG|0203030204  |    11|RI|                                                          ##0203040259->^Syntax
  1076. ENG|0203030205  |     1|  |    PI   provides the value of Pi with a precision of 18 digits.
  1077. ENG|0203030205  |     3|  |    MDS  provides the maximum size of a variable value.
  1078. ENG|0203030205  |     5|RI|                                                          ##0203040259->^Syntax
  1079. ENG|0203030206  |     1|  |    SQR   provides the square of an expression.
  1080. ENG|0203030206  |     3|  |    SQRT  provides the square root.
  1081. ENG|0203030206  |     5|  |    Examples :
  1082. ENG|0203030206  |     7|  |
  1083. ENG|0203030206  |     8| E|      SQR (2)   --> 4
  1084. ENG|0203030206  |     9| E|      SQRT (4)  --> 2
  1085. ENG|0203030206  |    10|  |
  1086. ENG|0203030206  |    12|RI|                                                          ##0203040259->^Syntax
  1087. ENG|0203030207  |     1|  |    ABS  provides the absolute amount of a numeric expression.
  1088. ENG|0203030207  |     3|  |    Examples :
  1089. ENG|0203030207  |     5|  |
  1090. ENG|0203030207  |     6| E|      ABS (-1)  --> 1
  1091. ENG|0203030207  |     7| E|      ABS (1)   --> 1
  1092. ENG|0203030207  |     8|  |
  1093. ENG|0203030207  |    10|RI|                                                          ##0203040259->^Syntax
  1094. ENG|0203030208  |     1|  |    SIGN   provides the sign of a numeric expression.
  1095. ENG|0203030208  |     3|  |    Examples :
  1096. ENG|0203030208  |     5|  |
  1097. ENG|0203030208  |     6| E|      SIGN(100)     ->  1
  1098. ENG|0203030208  |     7| E|      SIGN(-PI)     -> -1
  1099. ENG|0203030208  |     8| E|      SIGN(0)       ->  0
  1100. ENG|0203030208  |     9|  |
  1101. ENG|0203030208  |    11|RI|                                                          ##0203040259->^Syntax
  1102. ENG|02030303    |     1|  |                      String Functions
  1103. ENG|02030303    |     2|  |                      ----------------
  1104. ENG|02030303    |     4| M|                      #12BREAK        #15SEPARATE
  1105. ENG|02030303    |     5| M|                      #07CHANGE       #11SET
  1106. ENG|02030303    |     6| M|                      #08CHR          #13SPAN
  1107. ENG|02030303    |     7| M|                      #04FORMAT       #06STRPOS
  1108. ENG|02030303    |     8| M|                      #05INDEX        #02SUBSTR
  1109. ENG|02030303    |     9| M|                      #09HEX          #03TRIM
  1110. ENG|02030303    |    10| M|                      #03LENGTH       #15TOKENIZE
  1111. ENG|02030303    |    11| M|                      #10LOWER        #10UPPER
  1112. ENG|02030303    |    12| M|                      #08ORD          #02Concatenation (&)
  1113. ENG|02030303    |    13| M|                      #14PAD          #01Character Repetition
  1114. ENG|02030303    |    14|RI|                                                          ##0203040305->^Syntax
  1115. ENG|0203030301  |     1|  |    The  specified character is repeated according to the number defined by
  1116. ENG|0203030301  |     2|  |    the numeric expression.
  1117. ENG|0203030301  |     4|  |    Examples :
  1118. ENG|0203030301  |     6|  |
  1119. ENG|0203030301  |     7| E|      '.'(5)     --> '.....';
  1120. ENG|0203030301  |     8| E|      a := 5;
  1121. ENG|0203030301  |     9| E|      BLANK(a)   --> '     '
  1122. ENG|0203030301  |    10|R |
  1123. ENG|0203030302  |     1|  |    Concatenation (&) combines strings.
  1124. ENG|0203030302  |     3|  |    SUBSTR  starting with the specified position finds out the substring
  1125. ENG|0203030302  |     4|  |            in the specified length or, if no length is specified, up to
  1126. ENG|0203030302  |     5|  |            the end of the string.
  1127. ENG|0203030302  |     7|  |    Examples :
  1128. ENG|0203030302  |     9|  |
  1129. ENG|0203030302  |    10| E|      name   := firstname & lastname;
  1130. ENG|0203030302  |    11| E|      name   := 'Lastname : ' & lastname & ' Firstname : ' & firstname;
  1131. ENG|0203030302  |    12| E|      string := SUBSTR ('abcdefg',3,2)  --> 'cd'
  1132. ENG|0203030302  |    13| E|      string := SUBSTR ('abcdefg',3)    --> 'cdefg'
  1133. ENG|0203030302  |    14| E|      string := SUBSTR ('abcdefg',8)    --> NULL
  1134. ENG|0203030302  |    15| E|      string := SUBSTR ('abcdefg',4,10) --> 'defg'
  1135. ENG|0203030302  |    16|S |
  1136. ENG|0203030302  |    19|RI|                                                          ##0203040305->^Syntax
  1137. ENG|0203030303  |     1|  |    LENGTH  finds out the length of the specified expression.
  1138. ENG|0203030303  |     3|  |    TRIM    removes the specified character (blank, if nothing else
  1139. ENG|0203030303  |     4|  |            has been specified) from the beginning and end of the
  1140. ENG|0203030303  |     5|  |            string expression. An additional argument may restrict
  1141. ENG|0203030303  |     6|  |            trimming to one side.
  1142. ENG|0203030303  |     8|  |    Examples :
  1143. ENG|0203030303  |    10|  |
  1144. ENG|0203030303  |    11| E|      LENGTH ('three')                --> 4
  1145. ENG|0203030303  |    12| E|      LENGTH ('thirty' & 'three')     --> 15
  1146. ENG|0203030303  |    13| E|      TRIM ('   A   ');               --> 'A'
  1147. ENG|0203030303  |    14| E|      TRIM ('   A   ','.');           --> '   A   '
  1148. ENG|0203030303  |    15| E|      TRIM ('...A   ','.');           --> 'A   '
  1149. ENG|0203030303  |    16| E|      TRIM ('  A  ', ' ', RIGHT )     -->   '  A'
  1150. ENG|0203030303  |    17|SE|      TRIM ('  A  ', ' ', LEFT  )     -->   'A  '
  1151. ENG|0203030303  |    19| E|      TRIM ('  A  ', ' ', BOTH  )     -->   'A'
  1152. ENG|0203030303  |    20|  |
  1153. ENG|0203030303  |    22|RI|                                                          ##0203040305->^Syntax
  1154. ENG|0203030304  |     1|  |    FORMAT  serves to edit numbers for output.
  1155. ENG|0203030304  |     3|  |    Examples :
  1156. ENG|0203030304  |     5|  |
  1157. ENG|0203030304  |     6| E|      FORMAT ( 1234,  '9 999' )       --> '1 234'
  1158. ENG|0203030304  |     7| E|      FORMAT ( 1234,  '9,999.99 Kg' ) --> '1,234.00 Kg'
  1159. ENG|0203030304  |     8| E|      FORMAT ( 12.3,  'DM 999,99' )   --> 'DM  12,30'
  1160. ENG|0203030304  |     9| E|      FORMAT ( 1.234, '9 Kg 555 g' )  --> '1 Kg 234 g'
  1161. ENG|0203030304  |    10| E|      FORMAT ( 12.34, '.9999e-99' )   --> '.1234e+02'
  1162. ENG|0203030304  |    11| E|      FORMAT ( -123,  '99 999' )      --> '  -123'
  1163. ENG|0203030304  |    12| E|      FORMAT (  123,  '+9 999' )      --> '+  123'
  1164. ENG|0203030304  |    13| E|      FORMAT (-1234,  '99 999-' )     --> ' 1 234-'
  1165. ENG|0203030304  |    14| E|      FORMAT ( 123,   '099 999' )     --> '000 123'
  1166. ENG|0203030304  |    15| E|      FORMAT ( 123,   '*99 999' )     --> '****123'
  1167. ENG|0203030304  |    16| E|      FORMAT ( 123,   '$>99 999' )    --> '   $123'
  1168. ENG|0203030304  |    17|S |
  1169. ENG|0203030304  |    19|RI|                                                          ##0203040305->^Syntax
  1170. ENG|0203030305  |     1|  |    INDEX  searches a vector for a certain value.
  1171. ENG|0203030305  |     2|  |           If this value is encountered, the function
  1172. ENG|0203030305  |     3|  |           provides the index of the vector component.
  1173. ENG|0203030305  |     5|  |    Example :
  1174. ENG|0203030305  |     7|  |
  1175. ENG|0203030305  |     8| E|      a (5..7) := 'x';
  1176. ENG|0203030305  |     9| E|      INDEX (a(1..10),'x')        --> 5
  1177. ENG|0203030305  |    10| E|      INDEX (a(10..1),'x')        --> 7
  1178. ENG|0203030305  |    11| E|      INDEX (a(1..3),'x')         --> NULL
  1179. ENG|0203030305  |    12| E|      INDEX (a(1..10), NOT NULL ) --> 5
  1180. ENG|0203030305  |    13|  |
  1181. ENG|0203030305  |    15|RI|                                                          ##0203040301->^Syntax
  1182. ENG|0203030306  |     1|  |    STRPOS  searches a variable value for the specified character string.
  1183. ENG|0203030306  |     2|  |            If this is encountered, STRPOS returns the initial position
  1184. ENG|0203030306  |     3|  |            as the result; otherwise it provides the NULL value.
  1185. ENG|0203030306  |     4|  |            It is possible to specify the starting position of the
  1186. ENG|0203030306  |     5|  |            search.
  1187. ENG|0203030306  |     7|  |    Examples :
  1188. ENG|0203030306  |     9|  |
  1189. ENG|0203030306  |    10| E|      STRPOS ('aabbccbbee','bb')    --> 3;
  1190. ENG|0203030306  |    11| E|      STRPOS ('aabbccbbee','bb',4)  --> 7;
  1191. ENG|0203030306  |    12| E|      STRPOS ('aabbccbbee','xx',4)  --> NULL;
  1192. ENG|0203030306  |    13|  |
  1193. ENG|0203030306  |    15|RI|                                                          ##0203040301->^Syntax
  1194. ENG|0203030307  |     1|  |    CHANGE  replaces a character string in a variable value with another
  1195. ENG|0203030307  |     2|  |            character string. $ITEMS contains the number of changes.
  1196. ENG|0203030307  |     4|  |    Example :
  1197. ENG|0203030307  |     6|  |
  1198. ENG|0203030307  |     7| E|      string := CHANGE (string,' ','_'); /* replaces blanks with underscores
  1199. ENG|0203030307  |     8| E|      string := CHANGE (string,' ');     /* eliminates blanks
  1200. ENG|0203030307  |     9|  |
  1201. ENG|0203030307  |    11|RI|                                                          ##0203040305->^Syntax
  1202. ENG|0203030308  |     1|  |    CHR  provides for the given numeric value the character that
  1203. ENG|0203030308  |     2|  |         corresponds to the CHAR representation of this value. If
  1204. ENG|0203030308  |     3|  |         there is something else specified instead of a numeric value,
  1205. ENG|0203030308  |     4|  |         or if there is no CHAR representation for the numeric value,
  1206. ENG|0203030308  |     5|  |         CHR provides the NULL value as the result.
  1207. ENG|0203030308  |     7|  |    ORD  is the inverse function of CHR. It provides the corresponding
  1208. ENG|0203030308  |     8|  |         numeric value for a character.
  1209. ENG|0203030308  |    10|  |    Examples :
  1210. ENG|0203030308  |    12|  |
  1211. ENG|0203030308  |    13| E|      b := ORD ('a');
  1212. ENG|0203030308  |    14| E|      a := CHR (b);         --> a = 'a';
  1213. ENG|0203030308  |    15|  |
  1214. ENG|0203030308  |    17|RI|                                                          ##0203040305->^Syntax
  1215. ENG|0203030309  |     1|  |    HEX  can be applied to any string expression.
  1216. ENG|0203030309  |     2|  |         It provides a string of double length in
  1217. ENG|0203030309  |     3|  |         hexadecimal representation.
  1218. ENG|0203030309  |     5|  |    Examples :
  1219. ENG|0203030309  |     7|  |
  1220. ENG|0203030309  |     8| E|      hxstr := HEX ('Hallo');
  1221. ENG|0203030309  |     9|  |
  1222. ENG|0203030309  |    11|RI|                                                          ##0203040305->^Syntax
  1223. ENG|0203030310  |     1|  |    LOWER  converts the specified character string into
  1224. ENG|0203030310  |     2|  |           lower case characters.
  1225. ENG|0203030310  |     4|  |    UPPER  converts the specified character string into
  1226. ENG|0203030310  |     5|  |           upper case characters.
  1227. ENG|0203030310  |     7|  |    Examples:
  1228. ENG|0203030310  |     9|  |
  1229. ENG|0203030310  |    10| E|    LOWER ('Good MORNING !')  --> 'good morning !'
  1230. ENG|0203030310  |    11| E|    UPPER ('Good MORNING !')  --> 'GOOD MORNING !'
  1231. ENG|0203030310  |    12|  |
  1232. ENG|0203030310  |    14|RI|                                                          ##0203040305->^Syntax
  1233. ENG|0203030311  |     1|  |    The values of the user-specific SET parameters  can  be  found  out  by
  1234. ENG|0203030311  |     2|  |    means of the SET function.
  1235. ENG|0203030311  |     4|  |    Examples :
  1236. ENG|0203030311  |     6|  |
  1237. ENG|0203030311  |     7| E|      @lang := SET ( LANGUAGE );
  1238. ENG|0203030311  |     8| E|      @lang := SET ( 2 );
  1239. ENG|0203030311  |     9|  |
  1240. ENG|0203030311  |    11|  |    Only runtime-relevant SET parameters can be retrieved/requested via
  1241. ENG|0203030311  |    12| I|    ##0203021001keywords.
  1242. ENG|0203030311  |    14| I|    The SET parameters are changed by means of the ##02030210SET statement.
  1243. ENG|0203030311  |    16|RI|                                                          ##0203040310->^Syntax
  1244. ENG|0203030312  |     1|  |    BREAK searches a variable value for the first occurence of a
  1245. ENG|0203030312  |     2|  |          character included in the specified character string.
  1246. ENG|0203030312  |     3|  |          BREAK returns the initial position as the result.
  1247. ENG|0203030312  |     4|  |          It is possible to specify the starting position of the
  1248. ENG|0203030312  |     5|  |          search.
  1249. ENG|0203030312  |     7|  |    Beispiele :
  1250. ENG|0203030312  |     9|  |
  1251. ENG|0203030312  |    10| E|      BREAK ( '999.999,99', '.,' )     -->  4
  1252. ENG|0203030312  |    11| E|      BREAK ( '999.999,99', '.,', 5 )  -->  8
  1253. ENG|0203030312  |    12| E|      BREAK ( '999.999,99', 'abc', 5 ) --> 11
  1254. ENG|0203030312  |    13|  |
  1255. ENG|0203030312  |    15|RI|                                                          ##0203040301->^Syntax
  1256. ENG|0203030313  |     1|  |    SPAN searches a variable value for the first occurence of a
  1257. ENG|0203030313  |     2|  |         character not included in the specified character string.
  1258. ENG|0203030313  |     3|  |         SPAN returns the initial position as the result.
  1259. ENG|0203030313  |     4|  |         It is possible to specify the starting position of the
  1260. ENG|0203030313  |     5|  |         search.
  1261. ENG|0203030313  |     7|  |    Beispiele :
  1262. ENG|0203030313  |     9|  |
  1263. ENG|0203030313  |    10| E|      SPAN ( 'aabbccdd', 'ab' )               --> 5
  1264. ENG|0203030313  |    11| E|      SPAN ( '999.999,99', '0123456789' )     --> 4
  1265. ENG|0203030313  |    12| E|      SPAN ( 'aabbccdd', 'abcd' )             --> 9
  1266. ENG|0203030313  |    13|  |
  1267. ENG|0203030313  |    15|RI|                                                          ##0203040301->^Syntax
  1268. ENG|0203030314  |     1|  |    PAD expands a character string to the given length. An additional
  1269. ENG|0203030314  |     2|  |         argument may specify whether blanks are added left, right or
  1270. ENG|0203030314  |     3|  |         on both sides.
  1271. ENG|0203030314  |     5|  |    Examples :
  1272. ENG|0203030314  |     7|  |
  1273. ENG|0203030314  |     8| E|        PAD ( 'abc', 7 )         -->     'abc    '
  1274. ENG|0203030314  |     9| E|        PAD ( 'abc', 7, RIGHT )  -->     'abc    '
  1275. ENG|0203030314  |    10| E|        PAD ( 'abc', 7, LEFT  )  -->     '    abc'
  1276. ENG|0203030314  |    11| E|        PAD ( 'abc', 7, BOTH  )  -->     '  abc  '
  1277. ENG|0203030314  |    12|  |
  1278. ENG|0203030314  |    14|RI|                                                          ##0203040305->^Syntax
  1279. ENG|0203030315  |     1|  |    TOKENIZE and SEPARATE fill a vector slice using the fields contained in
  1280. ENG|0203030315  |     2|  |    a  character  string. Fields a separated by any character of the second
  1281. ENG|0203030315  |     3|  |    argument. TOKENIZE  merges  multiple  continous  separators  into  one,
  1282. ENG|0203030315  |     4|  |    SEPARATE  assumes  a field between two separators and assigns to it the
  1283. ENG|0203030315  |     5|  |    value NULL. After the  call,  $ITEMS  contains  the  number  of  parsed
  1284. ENG|0203030315  |     6|  |    fields.
  1285. ENG|0203030315  |     8|  |    Beispiele :
  1286. ENG|0203030315  |    10|  |
  1287. ENG|0203030315  |    11| E|    @t(1..20) := TOKENIZE ( '1,2,,3', ',' );
  1288. ENG|0203030315  |    12|  |
  1289. ENG|0203030315  |    13|  |    @t(1)   ->  '1';
  1290. ENG|0203030315  |    14|  |    @t(2)   ->  '2';
  1291. ENG|0203030315  |    15|  |    @t(3)   ->  '3';
  1292. ENG|0203030315  |    17|S |
  1293. ENG|0203030315  |    19| E|    @t(1..20) := SEPARATE ( '1,2,,3', ',' );
  1294. ENG|0203030315  |    20|  |
  1295. ENG|0203030315  |    21|  |    @t(1)   ->  '1';
  1296. ENG|0203030315  |    22|  |    @t(2)   ->  '2';
  1297. ENG|0203030315  |    23|  |    @t(3)   ->  NULL;
  1298. ENG|0203030315  |    24|  |    @t(4)   ->  '3';
  1299. ENG|0203030315  |    26|RI|                                                          ##0203040305->^Syntax
  1300. ENG|02030304    |     1|  |                      Date and Time Functions
  1301. ENG|02030304    |     2|  |                      -----------------------
  1302. ENG|02030304    |     4| M|                      #02ADDDATE
  1303. ENG|02030304    |     5| M|                      #04ADDTIME
  1304. ENG|02030304    |     6| M|                      #01DATE
  1305. ENG|02030304    |     7| M|                      #02DATEDIFF
  1306. ENG|02030304    |     8| M|                      #03DAYOFWEEK
  1307. ENG|02030304    |     9| M|                      #03DAYOFYEAR
  1308. ENG|02030304    |    10| M|                      #05MAKETIME
  1309. ENG|02030304    |    11| M|                      #02SUBDATE
  1310. ENG|02030304    |    12| M|                      #04SUBTIME
  1311. ENG|02030304    |    13| M|                      #01TIME
  1312. ENG|02030304    |    14| M|                      #04TIMEDIFF
  1313. ENG|02030304    |    15| M|                      #03WEEKOFYEAR
  1314. ENG|02030304    |    16|RI|                                                          ##0203040307->^Syntax
  1315. ENG|0203030401  |     1|  |    DATE and TIME can be used for generating and transforming date and time
  1316. ENG|0203030401  |     2|  |    specifications.
  1317. ENG|0203030401  |     4|  |    Examples of current date and current time :
  1318. ENG|0203030401  |     6|  |      January 21, 89 produces
  1319. ENG|0203030401  |     7|  |
  1320. ENG|0203030401  |     8| E|      DATE (mm/dd/yy)     -->  '01/21/89'
  1321. ENG|0203030401  |     9| E|      DATE (yyyy mm.dd)   -->  '1989 01.21'
  1322. ENG|0203030401  |    10| E|      DATE (dd mmm yyyy)  -->  '21 Jan 1989'
  1323. ENG|0203030401  |    11| E|      DATE (yyyy)         -->  '1989'
  1324. ENG|0203030401  |    12|  |
  1325. ENG|0203030401  |    13|  |      17.23 and 11 seconds produces
  1326. ENG|0203030401  |    14|  |
  1327. ENG|0203030401  |    15| E|      TIME  (hh:mm-ss) --> '17:23-11'
  1328. ENG|0203030401  |    16| E|      TIME  (hhmm)        --> '1723'
  1329. ENG|0203030401  |    17|S |
  1330. ENG|0203030401  |    19|  |    Examples of given dates :
  1331. ENG|0203030401  |    20|  |
  1332. ENG|0203030401  |    21| E|      today := '01.01.88';
  1333. ENG|0203030401  |    22| E|      today := DATE ( YYYY/MM/DD, today, dd.mm.yy );
  1334. ENG|0203030401  |    24| E|      today := '09.03.94';
  1335. ENG|0203030401  |    25| E|      today := DATE ( , today, dd.mm.yy );
  1336. ENG|0203030401  |    27| E|      now   := '12:00:05';
  1337. ENG|0203030401  |    28| E|      now   := TIME ( hhmmss, now, hh:mm:ss );
  1338. ENG|0203030401  |    29|  |
  1339. ENG|0203030401  |    30|  |    The  second mask describes the format of the input value. If one of the
  1340. ENG|0203030401  |    31|  |    descriptions is missing, the format defined in the  SET  parameters  is
  1341. ENG|0203030401  |    32|  |    used.
  1342. ENG|0203030401  |    34|RI|                                                          ##0203040307->^Syntax
  1343. ENG|0203030402  |     1|  |    ADDDATE   adds n days to a given date.
  1344. ENG|0203030402  |     3|  |    SUBDATE   subtracts n days from a given date.
  1345. ENG|0203030402  |     5|  |    DATEDIFF  indicates the difference between two date
  1346. ENG|0203030402  |     6|  |              specifications in days.
  1347. ENG|0203030402  |     8|  |    Examples :
  1348. ENG|0203030402  |    10|  |
  1349. ENG|0203030402  |    11| E|      ADDDATE ('19871231',1)           --> '19880101'
  1350. ENG|0203030402  |    12| E|      SUBDATE ('19871231',31)          --> '19871130'
  1351. ENG|0203030402  |    13| E|      DATEDIFF ('19880101','19870101') --> 365
  1352. ENG|0203030402  |    14|  |
  1353. ENG|0203030402  |    16|S |    Date specifications must be made in the format 'YYYYMMDD'.
  1354. ENG|0203030402  |    19|RI|                                                          ##0203040307->^Syntax
  1355. ENG|0203030403  |     1|  |    DAYOFWEEK   provides a numeric value between 1 and 7
  1356. ENG|0203030403  |     2|  |                which identifies the day of the week,
  1357. ENG|0203030403  |     3|  |                where 1 represents Monday.
  1358. ENG|0203030403  |     5|  |    DAYOFYEAR   provides a numeric value between 1 and 366.
  1359. ENG|0203030403  |     7|  |    WEEKOFYEAR  provides a value between 1 and 53.
  1360. ENG|0203030403  |     9|  |    Examples :
  1361. ENG|0203030403  |    11|  |
  1362. ENG|0203030403  |    12| E|      DAYOFWEEK  ('19880105')   --> 2
  1363. ENG|0203030403  |    13| E|      DAYOFYEAR  ('19870101')   --> 1
  1364. ENG|0203030403  |    14| E|      WEEKOFYEAR ('19880101')  --> 53
  1365. ENG|0203030403  |    15|  |
  1366. ENG|0203030403  |    17|S |    Date specifications must be made in the format 'YYYYMMDD'.
  1367. ENG|0203030403  |    19|RI|                                                          ##0203040309->^Syntax
  1368. ENG|0203030404  |     1|  |    SUBTIME   provides a time which results from the difference
  1369. ENG|0203030404  |     2|  |              between the two specified values.
  1370. ENG|0203030404  |     4|  |    ADDTIME   provides a time which results from the sum of the two
  1371. ENG|0203030404  |     5|  |              specified values.
  1372. ENG|0203030404  |     7|  |    TIMEDIFF  provides the positive difference of the specified times
  1373. ENG|0203030404  |     8|  |              in seconds.
  1374. ENG|0203030404  |     9|  |    Examples :
  1375. ENG|0203030404  |    11|  |
  1376. ENG|0203030404  |    12| E|      SUBTIME ('00105523','00000023')   --> '00105500'
  1377. ENG|0203030404  |    13| E|      ADDTIME ('00105523','00000037')   --> '00105600'
  1378. ENG|0203030404  |    14| E|      TIMEDIFF ('00000005','00000000')  --> 5
  1379. ENG|0203030404  |    15|  |
  1380. ENG|0203030404  |    17|S |    Time specifications must be made in the format 'HHHHMMSS'.
  1381. ENG|0203030404  |    19|RI|                                                          ##0203040308->^Syntax
  1382. ENG|0203030405  |     1|  |    MAKETIME  provides a time which results from the sum of the three
  1383. ENG|0203030405  |     2|  |              arguments ( MAKETIME (<hours>,<minutes>,<seconds>) ).
  1384. ENG|0203030405  |     4|  |    Examples :
  1385. ENG|0203030405  |     6|  |
  1386. ENG|0203030405  |     7| E|      MAKETIME (10,59,33)  --> '00105933'
  1387. ENG|0203030405  |     8| E|      MAKETIME (10,59,63)  --> '00110003'
  1388. ENG|0203030405  |     9|  |
  1389. ENG|0203030405  |    11|RI|                                                          ##0203040308->^Syntax
  1390. ENG|020304      |     1|  |                      Syntax Description
  1391. ENG|020304      |     2|  |                      ------------------
  1392. ENG|020304      |     4| M|                      #01Syntax elements
  1393. ENG|020304      |     5|RM|                      #05Keywords
  1394. ENG|02030401    |     1| I|    ##0203040101<prog^name>
  1395. ENG|02030401    |     2| I|    ##0203040102<mod^name>
  1396. ENG|02030401    |     3| I|    ##0203040103<routine>
  1397. ENG|02030401    |     4| I|    ##0203040104<parm^decl>
  1398. ENG|02030401    |     5| I|    ##0203040107<function>
  1399. ENG|02030401    |     6| I|    ##0203040108<db^procedure>
  1400. ENG|02030401    |     7| I|    ##0203040109<dbproc^parm^decl^list>
  1401. ENG|02030401    |     8| I|    ##0203040110<dbproc^parm^decl>
  1402. ENG|02030401    |     9| I|    ##0203040111<dir>
  1403. ENG|02030401    |    10| I|    ##0203040112<data^type>
  1404. ENG|02030401    |    11| I|    ##0203040113<trigger>
  1405. ENG|02030401    |    12| I|    ##0203040114<trigger^parm^decl>
  1406. ENG|02030401    |    13| I|    ##0203040115<trigger^column^spec>
  1407. ENG|02030401    |    14| I|    ##0203040116<trigger^predicat>
  1408. ENG|02030401    |    15| I|    ##0203040117<help^form>
  1409. ENG|02030401    |    16| I|    ##0203040118<name>
  1410. ENG|02030401    |    17|SI|    ##0203040119<literal>
  1411. ENG|02030401    |    19| I|    ##0203040120<numeric>
  1412. ENG|02030401    |    20| I|    ##0203040121<unsigned^integer>
  1413. ENG|02030401    |    21| I|    ##0203040122<digit>
  1414. ENG|02030401    |    22| I|    ##0203040123<fixed^point>
  1415. ENG|02030401    |    23| I|    ##0203040124<floating^point>
  1416. ENG|02030401    |    24| I|    ##0203040125<sign>
  1417. ENG|02030401    |    25| I|    ##0203040126<string^literal>
  1418. ENG|02030401    |    26| I|    ##0203040127<any^char>
  1419. ENG|02030401    |    27| I|    ##0203040128<hexstring^literal>
  1420. ENG|02030401    |    28| I|    ##0203040129<langdep^literal>
  1421. ENG|02030401    |    29| I|    ##0203040133<variable>
  1422. ENG|02030401    |    30| I|    ##0203040134<vector^slice>
  1423. ENG|02030401    |    31| I|    ##0203040135<variable^name>
  1424. ENG|02030401    |    32| I|    ##0203040136<expr>
  1425. ENG|02030401    |    33| I|    ##0203040137<num^expr>
  1426. ENG|02030401    |    34| I|    ##0203040138<term^list>
  1427. ENG|02030401    |    35|SI|    ##0203040139<term>
  1428. ENG|02030401    |    37| I|    ##0203040140<factor>
  1429. ENG|02030401    |    38| I|    ##0203040141<function^call>
  1430. ENG|02030401    |    39| I|    ##0203040142<str^expr>
  1431. ENG|02030401    |    40| I|    ##0203040143<basic^str>
  1432. ENG|02030401    |    41| I|    ##0203040144<repeat^string>
  1433. ENG|02030401    |    42| I|    ##0203040145<boolean^term>
  1434. ENG|02030401    |    43| I|    ##0203040146<boolean^expr>
  1435. ENG|02030401    |    44| I|    ##0203040147<expr^comparison>
  1436. ENG|02030401    |    45| I|    ##0203040148<check^cond>
  1437. ENG|02030401    |    46| I|    ##0203040149<simple^cond>
  1438. ENG|02030401    |    47| I|    ##0203040150<is^cond>
  1439. ENG|02030401    |    48| I|    ##0203040151<in^cond>
  1440. ENG|02030401    |    49| I|    ##0203040152<value^spec^list>
  1441. ENG|02030401    |    50| I|    ##0203040153<value^spec>
  1442. ENG|02030401    |    51| I|    ##0203040154<between^cond>
  1443. ENG|02030401    |    52| I|    ##0203040155<like^cond>
  1444. ENG|02030401    |    53|SI|    ##0203040156<var^section>
  1445. ENG|02030401    |    55| I|    ##0203040157<var^decl>
  1446. ENG|02030401    |    56| I|    ##0203040158<array^spec>
  1447. ENG|02030401    |    57| I|    ##0203040159<lab^stmt^list>
  1448. ENG|02030401    |    58| I|    ##0203040160<logic^op>
  1449. ENG|02030401    |    59| I|    ##0203040161<comp^op>
  1450. ENG|02030401    |    60| I|    ##0203040201<compound>
  1451. ENG|02030401    |    61| I|    ##0203040202<stmt>
  1452. ENG|02030401    |    62| I|    ##0203040203<assign^stmt>
  1453. ENG|02030401    |    63| I|    ##0203040204<assign^expr>
  1454. ENG|02030401    |    64| I|    ##0203040205<vector^assign^stmt>
  1455. ENG|02030401    |    65| I|    ##0203040206<if^stmt>
  1456. ENG|02030401    |    66| I|    ##0203040207<case^stmt>
  1457. ENG|02030401    |    67| I|    ##0203040208<case^list>
  1458. ENG|02030401    |    68| I|    ##0203040209<repeat^stmt>
  1459. ENG|02030401    |    69| I|    ##0203040210<while^stmt>
  1460. ENG|02030401    |    70| I|    ##0203040211<for^stmt>
  1461. ENG|02030401    |    71|SI|    ##0203040212<skip^stmt>
  1462. ENG|02030401    |    73| I|    ##0203040213<return^stmt>
  1463. ENG|02030401    |    74| I|    ##0203040214<stop^stmt>
  1464. ENG|02030401    |    75| I|    ##0203040215<vectsort^stmt>
  1465. ENG|02030401    |    76| I|    ##0203040216<proc^call>
  1466. ENG|02030401    |    77| I|    ##0203040216<form^call>
  1467. ENG|02030401    |    78| I|    ##0203040218<switch^stmt>
  1468. ENG|02030401    |    79| I|    ##0203040219<switchcall^stmt>
  1469. ENG|02030401    |    80| I|    ##0203040220<name^expr>
  1470. ENG|02030401    |    81| I|    ##0203040221<param>
  1471. ENG|02030401    |    82| I|    ##0203040222<parm^spec^list>
  1472. ENG|02030401    |    83| I|    ##0203040225<dbproc^call>
  1473. ENG|02030401    |    84| I|    ##0203040227<sql^stmt>
  1474. ENG|02030401    |    85| I|    ##0203040228<sql^cmd>
  1475. ENG|02030401    |    86| I|    ##0203040229<dynamic^sql^stmt>
  1476. ENG|02030401    |    87| I|    ##0203040230<dynamic^fetch^stmt>
  1477. ENG|02030401    |    88| I|    ##0203040231<mass^fetch^stmt>
  1478. ENG|02030401    |    89|SI|    ##0203040233<connect^stmt>
  1479. ENG|02030401    |    91| I|    ##0203040234<release^stmt>
  1480. ENG|02030401    |    92| I|    ##0203040235<sqlerror^routine>
  1481. ENG|02030401    |    93| I|    ##0203040236<sqlexception^routine>
  1482. ENG|02030401    |    94| I|    ##0203040237<sqlnotfound^routine>
  1483. ENG|02030401    |    95| I|    ##0203040238<sqltimeout^routine>
  1484. ENG|02030401    |    96| I|    ##0203040239<sqlwarning^routine>
  1485. ENG|02030401    |    97| I|    ##0203040240<try^catch^stmt>
  1486. ENG|02030401    |    98| I|    ##0203040241<query^stmt>
  1487. ENG|02030401    |    99| I|    ##0203040242<querycmd^spec>
  1488. ENG|02030401    |   100| I|    ##0203040243<report^stmt>
  1489. ENG|02030401    |   101| I|    ##0203040244<further^facilities>
  1490. ENG|02030401    |   102| I|    ##0203040245<query^option>
  1491. ENG|02030401    |   103| I|    ##0203040246<result^spec>
  1492. ENG|02030401    |   104| I|    ##0203040247<edit^call>
  1493. ENG|02030401    |   105| I|    ##0203040248<write^stmt>
  1494. ENG|02030401    |   106| I|    ##0203040249<read^stmt>
  1495. ENG|02030401    |   107|SI|    ##0203040250<open^file^stmt>
  1496. ENG|02030401    |   109| I|    ##0203040251<close^file^stmt>
  1497. ENG|02030401    |   110| I|    ##0203040252<write^file^stmt>
  1498. ENG|02030401    |   111| I|    ##0203040253<write^file^args>
  1499. ENG|02030401    |   112| I|    ##0203040254<read^file^stmt>
  1500. ENG|02030401    |   113| I|    ##0203040255<read^file^args>
  1501. ENG|02030401    |   114| I|    ##0203040256<writetrace^stmt>
  1502. ENG|02030401    |   115| I|    ##0203040257<exec^command>
  1503. ENG|02030401    |   116| I|    ##0203040258<operating^system^command>
  1504. ENG|02030401    |   117| I|    ##0203040259<arith^function>
  1505. ENG|02030401    |   118| I|    ##0203040260<index^function>
  1506. ENG|02030401    |   119| I|    ##0203040301<strpos^function>
  1507. ENG|02030401    |   120| I|    ##0203040302<set^function>
  1508. ENG|02030401    |   121| I|    ##0203040303<mixed^expr>
  1509. ENG|02030401    |   122| I|    ##0203040304<sign^function>
  1510. ENG|02030401    |   123| I|    ##0203040305<string^function>
  1511. ENG|02030401    |   124| I|    ##0203040301<strpos^function>
  1512. ENG|02030401    |   125|SI|    ##0203040307<date^function>
  1513. ENG|02030401    |   127| I|    ##0203040308<date^str^function>
  1514. ENG|02030401    |   128| I|    ##0203040309<date^arith^function>
  1515. ENG|02030401    |   129| I|    ##0203040311<set^stmt>
  1516. ENG|02030401    |   130| I|    ##0203040312<set^id>
  1517. ENG|02030401    |   131| I|    ##0203040313<systime^func>
  1518. ENG|02030401    |   132| I|    ##0203040314<dollar^numeric^variable>
  1519. ENG|02030401    |   133| I|    ##0203040315<dollar^string^variable>
  1520. ENG|02030401    |   134| I|    ##0203040316<dollar^boolean^variable>
  1521. ENG|02030401    |   135| I|    ##0203040317<object^header>
  1522. ENG|02030401    |   136|RI|    ##0203040318<module^option>
  1523. ENG|0203040101  |     1|  |    <prog name> ::=
  1524. ENG|0203040101  |     2|RI|           ##0203040118<name>
  1525. ENG|0203040102  |     1|  |    <mod name> ::=
  1526. ENG|0203040102  |     2|RI|           ##0203040118<name>
  1527. ENG|0203040103  |     1|  |    <routine> ::=
  1528. ENG|0203040103  |     2| I|             PROC ##0203040101<prog^name> . ##0203040102<mod^name>
  1529. ENG|0203040103  |     3| I|             [PARMS ( ##0203040104<parm^decl> ,...)]
  1530. ENG|0203040103  |     4| I|             [OPTIONS ( ##0203040318<module^option> ,...)]
  1531. ENG|0203040103  |     5| I|             [ ##0203040156<var^section> ]
  1532. ENG|0203040103  |     6|RI|             ##0203040159<lab^stmt^list>
  1533. ENG|0203040104  |     1|  |    <parm decl> ::=
  1534. ENG|0203040104  |     2|R |             <varname> [()]
  1535. ENG|0203040107  |     1|  |    <function> ::=
  1536. ENG|0203040107  |     2| I|             FUNCTION ##0203040101<prog^name> . ##0203040102<mod^name>
  1537. ENG|0203040107  |     3| I|             [PARMS ( ##0203040104<parm^decl> ,...)]
  1538. ENG|0203040107  |     4| I|             [OPTIONS ( ##0203040318<module^option> ,...)]
  1539. ENG|0203040107  |     5| I|             [ ##0203040156<var^section> ]
  1540. ENG|0203040107  |     6|RI|             ##0203040159<lab^stmt^list>
  1541. ENG|0203040108  |     1|  |    <db procedure> ::=
  1542. ENG|0203040108  |     2| I|             DBPROC ##0203040101<prog^name> . ##0203040102<mod^name>
  1543. ENG|0203040108  |     3| I|             [PARMS ( ##0203040110<dbproc^parm^decl> ,...)]
  1544. ENG|0203040108  |     4| I|             [OPTIONS ( ##0203040318<module^option> ,...)]
  1545. ENG|0203040108  |     5| I|             [ ##0203040156<var^section> ]
  1546. ENG|0203040108  |     6|RI|             ##0203040159<lab^stmt^list>
  1547. ENG|0203040109  |     1|  |    <dbproc parm decl list> ::=
  1548. ENG|0203040109  |     2| I|               ##0203040104<parm^decl> ,...
  1549. ENG|0203040109  |     3|RI|             | ##0203040110<dbproc^parm^decl> ,...
  1550. ENG|0203040110  |     1|  |    <dbproc parm decl> ::=
  1551. ENG|0203040110  |     2|RI|             ##0203040111<dir> ##0203040118<name> ##0203040112<data^type>
  1552. ENG|0203040111  |     1|R |    <dir> ::= IN | OUT | INOUT
  1553. ENG|0203040112  |     1|  |    <data type> ::=
  1554. ENG|0203040112  |     2| I|              FIXED [ ( ##0203040121<unsigned^integer> [, <unsigned integer> ] ) ]
  1555. ENG|0203040112  |     3|  |             | FLOAT [ ( <unsigned integer> ) ]
  1556. ENG|0203040112  |     4|  |             | CHAR [ ( <unsigned integer> ) ]   [ BYTE ]
  1557. ENG|0203040112  |     5|  |             | DBYTE [ ( <unsigned integer> ) ]
  1558. ENG|0203040112  |     6|  |             | DATE
  1559. ENG|0203040112  |     7|R |             | TIME
  1560. ENG|0203040113  |     1|  |    <trigger> ::=
  1561. ENG|0203040113  |     2|  |             TRIGGER <libname>.<funcname>
  1562. ENG|0203040113  |     3| I|             [PARMS ( ##0203040114<trigger^parm^decl> ,...)]
  1563. ENG|0203040113  |     4| I|             [OPTIONS ( ##0203040318<module^option> ,...)]
  1564. ENG|0203040113  |     5| I|             [ ##0203040156<var^section> ]
  1565. ENG|0203040113  |     6|RI|             ##0203040159<lab^stmt^list>
  1566. ENG|0203040114  |     1|  |    <trigger parm decl> ::=
  1567. ENG|0203040114  |     2|RI|             ##0203040111<dir> ##0203040115<trigger^column^spec> ##0203040112<data^type>
  1568. ENG|0203040115  |     1|  |    <trigger column spec> ::=
  1569. ENG|0203040115  |     2|  |               <column name>
  1570. ENG|0203040115  |     3|  |             | NEW.<column name>
  1571. ENG|0203040115  |     4|R |             | OLD.<column name>
  1572. ENG|0203040116  |     1|  |    <trigger predicat> ::=
  1573. ENG|0203040116  |     2|  |               FIRSTCALL|LASTCALL|INSERTING
  1574. ENG|0203040116  |     3|R |             | UPDATING|DELETING
  1575. ENG|0203040117  |     1|  |    <help form> ::=
  1576. ENG|0203040117  |     2| I|             HELPFORM  ##0203040101<prog^name> . ##0203040102<mod^name>
  1577. ENG|0203040117  |     3|  |                   [OPTIONS (<form option>,...)]
  1578. ENG|0203040117  |     4| I|                   [PARMS ( ##0203040104<parm^decl> ,...)]
  1579. ENG|0203040117  |     5| I|             [ ##0203040156<var^section> ]
  1580. ENG|0203040117  |     6|  |             <form layout>
  1581. ENG|0203040117  |     7|R |             [ <processing spec>;... ]
  1582. ENG|0203040118  |     1|  |    <name> ::= <firstchar>  [<name char> ... ]
  1583. ENG|0203040118  |     3|  |    <firstchar> ::= <letter> | # | @ | $
  1584. ENG|0203040118  |     5| I|    <name char> ::= <letter> | ##0203040122<digit> | _ | # | @ | $
  1585. ENG|0203040118  |     7|R |    <letter> ::= a | .. | z | A |..| Z
  1586. ENG|0203040119  |     1|  |    <literal> ::=  <numeric literal>
  1587. ENG|0203040119  |     2| I|             | ##0203040126<string^literal>
  1588. ENG|0203040119  |     3| I|             | ##0203040128<hexstring^literal>
  1589. ENG|0203040119  |     4| I|             | ##0203040129<langdep^literal>
  1590. ENG|0203040119  |     5|  |             | <key literal>
  1591. ENG|0203040119  |     7|RI|    <numeric literal> ::= ##0203040120<numeric>
  1592. ENG|0203040120  |     1| I|    <numeric> ::= ##0203040121<unsigned^integer>
  1593. ENG|0203040120  |     2| I|             | ##0203040123<fixed^point>
  1594. ENG|0203040120  |     3|RI|             | ##0203040124<floating^point>
  1595. ENG|0203040121  |     1| I|    <unsigned integer> ::= ##0203040122<digit>  [<unsigned integer>]
  1596. ENG|0203040121  |     2|R |                        maximum 18 places
  1597. ENG|0203040122  |     1|R |    <digit> ::=  0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
  1598. ENG|0203040123  |     1|RI|    <fixed point> ::= ##0203040121<unsigned^integer>  [.<unsigned integer>]
  1599. ENG|0203040124  |     1|RI|    <floating point> ::= ##0203040123<fixed^point> E ##0203040125<sign> ##0203040122<digit> [<digit>]
  1600. ENG|0203040125  |     1|R |    <sign> ::= + | -
  1601. ENG|0203040126  |     1|RI|    <string literal> ::= ' ##0203040127<any^char> ...'
  1602. ENG|0203040127  |     1|R |    <any char> ::= any character on the keyboard
  1603. ENG|0203040128  |     1|  |    <hexstring literal> ::=
  1604. ENG|0203040128  |     2|  |             X'<hex digit seq>'  |  x'<hex digit seq>'
  1605. ENG|0203040128  |     4|  |    <hex digit seq> ::=
  1606. ENG|0203040128  |     5|  |             <hex digit><hex digit>[<hex digit seq>]
  1607. ENG|0203040128  |     7|  |    <hex digit> ::=
  1608. ENG|0203040128  |     8|  |               0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
  1609. ENG|0203040128  |     9|R |             | A | B | C | D | E | F | a | b | c | d | e | f
  1610. ENG|0203040129  |     1| I|    <langdep literal> ::= ##0203040118!<name> [ (<literal size>) ]
  1611. ENG|0203040129  |     3|R |    <literal size> ::= S | M | L | XL
  1612. ENG|0203040133  |     1| I|    <variable> ::= ##0203040135<variable^name> [ (##0203040136<expr>) ]
  1613. ENG|0203040133  |     2|  |             | MESSAGE
  1614. ENG|0203040133  |     3|R |             | ERROR
  1615. ENG|0203040134  |     1|RI|    <vector slice> ::= ##0203040135<variable^name> ( ##0203040136<expr> .. <expr>)
  1616. ENG|0203040135  |     1|RI|    <variable name> ::= ##0203040118<name>
  1617. ENG|0203040136  |     1|RI|    <expr> ::=  ##0203040137<num^expr> | ##0203040142<str^expr>
  1618. ENG|0203040137  |     1|RI|    <num expr> ::=  [ ##0203040125<sign> ]  ##0203040139<term>  [ ##0203040138<term^list> ]
  1619. ENG|0203040138  |     1|RI|    <term list> ::=  ##0203040125<sign> ##0203040139<term> [<term list>]
  1620. ENG|0203040139  |     1| I|    <term> ::=  ##0203040140<factor>  [<mult op> <term>]
  1621. ENG|0203040139  |     3|R |    <mult op> ::=  * | / | MOD | DIV
  1622. ENG|0203040140  |     1|  |    <factor> ::=
  1623. ENG|0203040140  |     2| I|               ##0203040120<numeric>
  1624. ENG|0203040140  |     3| I|             | ##0203040133<variable>
  1625. ENG|0203040140  |     4| I|             | ( ##0203040136<expr> )
  1626. ENG|0203040140  |     5| I|             | ##0203040259<arith^function>
  1627. ENG|0203040140  |     6| I|             | ##0203040141<function^call>
  1628. ENG|0203040140  |     7|RI|             | ##0203040314<dollar^numeric^variable>
  1629. ENG|0203040141  |     1|R |    <function call> ::= %<function name>
  1630. ENG|0203040142  |     1|  |    <str expr> ::=
  1631. ENG|0203040142  |     2|RI|             ##0203040143<basic^str>  [& ##0203040136<expr>]
  1632. ENG|0203040143  |     1|  |    <basic str> ::=
  1633. ENG|0203040143  |     2| I|               ##0203040153<value^spec>
  1634. ENG|0203040143  |     3| I|             | ##0203040140<factor>
  1635. ENG|0203040143  |     4| I|             | ##0203040305<string^function>
  1636. ENG|0203040143  |     5| I|             | ##0203040301<strpos^function>
  1637. ENG|0203040143  |     6| I|             | ##0203040307<date^function>
  1638. ENG|0203040143  |     7|RI|             | ##0203040302<set^function>
  1639. ENG|0203040144  |     1|  |    <repeat string> ::=
  1640. ENG|0203040144  |     2| I|             <repeat char> ( ##0203040136<expr> )
  1641. ENG|0203040144  |     4|  |    <repeat char> ::=
  1642. ENG|0203040144  |     5|RI|             '##0203040127<any^char>' | BLANK
  1643. ENG|0203040145  |     1|  |    <boolean term> ::=
  1644. ENG|0203040145  |     2| I|              ( ##0203040146<boolean^expr> )
  1645. ENG|0203040145  |     3| I|             | ##0203040147<expr^comparison>
  1646. ENG|0203040145  |     4| I|             | ##0203040136<expr> ##0203040148<check^cond>
  1647. ENG|0203040145  |     5| I|             | ALL  ##0203040134<vector^slice> <check cond>
  1648. ENG|0203040145  |     6|  |             | EACH <vector slice> <check cond>
  1649. ENG|0203040145  |     7|  |             | ANY  <vector slice> <check cond>
  1650. ENG|0203040145  |     8|  |             | SOME <vector slice> <check cond>
  1651. ENG|0203040145  |     9|  |             | ONE  <vector slice> <check cond>
  1652. ENG|0203040145  |    10|  |             | EOF (<fileid>)
  1653. ENG|0203040145  |    11| I|             | $SQLWARN [( ##0203040136<expr> )]
  1654. ENG|0203040145  |    12|R |             | FORM IS MODIFIED
  1655. ENG|0203040146  |     1|  |    <boolean expr> ::=
  1656. ENG|0203040146  |     2|RI|             [NOT] ##0203040145<boolean^term>  [ ##0203040160<logic^op> <boolean expr>]
  1657. ENG|0203040147  |     1|  |    <expr comparison> ::=
  1658. ENG|0203040147  |     2|RI|             ##0203040136<expr> ##0203040161<comp^op> <expr>
  1659. ENG|0203040148  |     1|  |    <check cond> ::=
  1660. ENG|0203040148  |     2|RI|             ##0203040149<simple^cond>  [ ##0203040160<logic^op> <check cond>]
  1661. ENG|0203040149  |     1|  |    <simple cond> ::=
  1662. ENG|0203040149  |     2| I|             ##0203040150<is^cond>
  1663. ENG|0203040149  |     3| I|             | [NOT] ##0203040151<in^cond>
  1664. ENG|0203040149  |     4| I|             | [NOT] ##0203040154<between^cond>
  1665. ENG|0203040149  |     5|RI|             | [NOT] ##0203040155<like^cond>
  1666. ENG|0203040150  |     1|  |    <is cond> ::=
  1667. ENG|0203040150  |     2|  |               IS [NOT]  ALPHA
  1668. ENG|0203040150  |     3|  |             | IS [NOT]  NUMERIC
  1669. ENG|0203040150  |     4|  |             | IS [NOT]  BLANK
  1670. ENG|0203040150  |     5|  |             | IS [NOT]  NULL
  1671. ENG|0203040150  |     6|  |             | IS [NOT]  MODIFIED
  1672. ENG|0203040150  |     7| I|             | IS [NOT]  FIXED ( ##0203040136<expr> ,<expr>)
  1673. ENG|0203040150  |     8|  |             | IS [NOT]  DATE [ (<date mask>) ]
  1674. ENG|0203040150  |     9|R |             | IS [NOT]  TIME [ (<time mask>) ]
  1675. ENG|0203040151  |     1|  |    <in cond> ::=
  1676. ENG|0203040151  |     2|RI|             IN ( ##0203040152<value^spec^list> )
  1677. ENG|0203040152  |     1|  |    <value spec list> ::=
  1678. ENG|0203040152  |     2| I|             ##0203040153<value^spec> [..<value spec>]  [,<value spec list>]
  1679. ENG|0203040152  |     3|R |             | NULL  [,<value spec list> ]
  1680. ENG|0203040153  |     1|  |    <value spec> ::=
  1681. ENG|0203040153  |     2| I|               ##0203040119<literal>
  1682. ENG|0203040153  |     3| I|             | ##0203040144<repeat^string>
  1683. ENG|0203040153  |     4|  |             | BLANK
  1684. ENG|0203040153  |     5| I|             | ##0203040314<dollar^numeric^variable>
  1685. ENG|0203040153  |     6|RI|             | ##0203040315<dollar^string^variable>
  1686. ENG|0203040154  |     1|  |    <between cond> ::=
  1687. ENG|0203040154  |     2|RI|             BETWEEN ##0203040136<expr> AND <expr>
  1688. ENG|0203040155  |     1|  |    <like cond> ::=
  1689. ENG|0203040155  |     2|RI|             LIKE ##0203040136<expr> [ ESCAPE <expr> ]
  1690. ENG|0203040156  |     1|  |    <var section> ::=
  1691. ENG|0203040156  |     2| I|             VAR ##0203040157<var^decl> ,...;
  1692. ENG|0203040156  |     3|R |             [ VAR STATIC <var decl>,...; ]
  1693. ENG|0203040157  |     1|  |    <var decl> ::=
  1694. ENG|0203040157  |     2|RI|             <varname> [ ##0203040158<array^spec> ]
  1695. ENG|0203040158  |     1|  |    <array spec> ::=
  1696. ENG|0203040158  |     2|R |             ()
  1697. ENG|0203040159  |     1|  |    <lab stmt list> ::=
  1698. ENG|0203040159  |     2|RI|             [<label>]  ##0203040201<compound>  [<lab stmt list>]
  1699. ENG|0203040160  |     1|  |    <logic op> ::=
  1700. ENG|0203040160  |     2|R |           AND | OR
  1701. ENG|0203040161  |     1|  |    <comp op> ::=
  1702. ENG|0203040161  |     2|R |           = | < | > | <> | <= | >=
  1703. ENG|0203040201  |     1|  |    <compound> ::=
  1704. ENG|0203040201  |     2|RI|             BEGIN ##0203040202<stmt> ;... END | <stmt>
  1705. ENG|0203040202  |     1|  |    <stmt> ::=
  1706. ENG|0203040202  |     2| I|               ##0203040203<assign^stmt>        | ##0203040205<vector^assign^stmt>
  1707. ENG|0203040202  |     3| I|             | ##0203040206<if^stmt>            | ##0203040207<case^stmt>
  1708. ENG|0203040202  |     4| I|             | ##0203040209<repeat^stmt>        | ##0203040210<while^stmt>
  1709. ENG|0203040202  |     5| I|             | ##0203040211<for^stmt>           | ##0203040212<skip^stmt>
  1710. ENG|0203040202  |     6| I|             | ##0203040213<return^stmt>        | ##0203040214<stop^stmt>
  1711. ENG|0203040202  |     7| I|             | ##0203040215<vectsort^stmt>      | ##0203040219<switchcall^stmt>
  1712. ENG|0203040202  |     8| I|             | ##0203040216<proc^call>          | ##0203040216<form^call>
  1713. ENG|0203040202  |     9| I|             | ##0203040218<switch^stmt>        | ##0203040141<function^call>
  1714. ENG|0203040202  |    10| I|             | ##0203040225<dbproc^call>        | ##0203040227<sql^stmt>
  1715. ENG|0203040202  |    11| I|             | ##0203040233<connect^stmt>       | ##0203040234<release^stmt>
  1716. ENG|0203040202  |    12| I|             | ##0203040241<query^stmt>         | ##0203040243<report^stmt>
  1717. ENG|0203040202  |    13| I|             | ##0203040247<edit^call>          | ##0203040248<write^stmt>
  1718. ENG|0203040202  |    14| I|             | ##0203040249<read^stmt>          | ##0203040250<open^file^stmt>
  1719. ENG|0203040202  |    15| I|             | ##0203040252<write^file^stmt>    | ##0203040254<read^file^stmt>
  1720. ENG|0203040202  |    16| I|             | ##0203040251<close^file^stmt>    | ##0203040257<exec^command>
  1721. ENG|0203040202  |    17|RI|             | ##0203040311<set^stmt>           | <systime stmt>
  1722. ENG|0203040203  |     1|RI|    <assign stmt> ::=  ##0203040133<variable> := ##0203040204<assign^expr>
  1723. ENG|0203040204  |     1|RI|    <assign expr> ::=  ##0203040136<expr> | NULL
  1724. ENG|0203040205  |     1|  |    <vector assign stmt> ::=
  1725. ENG|0203040205  |     2| I|               ##0203040134<vector^slice> := ##0203040204<assign^expr>
  1726. ENG|0203040205  |     3|R |             | <vector slice> := <vector slice>
  1727. ENG|0203040206  |     1| I|    <if stmt> ::= IF ##0203040146<boolean^expr>
  1728. ENG|0203040206  |     2| I|              THEN ##0203040201<compound>
  1729. ENG|0203040206  |     3|R |             [ELSE <compound>]
  1730. ENG|0203040207  |     1|  |    <case stmt> ::=
  1731. ENG|0203040207  |     2| I|             CASE ##0203040136<expr> OF
  1732. ENG|0203040207  |     3| I|                      ##0203040208<case^list>
  1733. ENG|0203040207  |     4| I|                      [OTHERWISE ##0203040201<compound> ]
  1734. ENG|0203040207  |     5|R |             END
  1735. ENG|0203040208  |     1|  |    <case list> ::=
  1736. ENG|0203040208  |     2|RI|             ##0203040152<value^spec^list> : ##0203040201<compound> [;<case list>] ;
  1737. ENG|0203040209  |     1|RI|    <repeat stmt> ::=  REPEAT ##0203040202<stmt> ;... UNTIL ##0203040146<boolean^expr>
  1738. ENG|0203040210  |     1|RI|    <while stmt> ::=  WHILE ##0203040146<boolean^expr> DO ##0203040201<compound>
  1739. ENG|0203040211  |     1|  |    <for stmt> ::=
  1740. ENG|0203040211  |     2| I|             FOR ##0203040133<variable> := ##0203040136<expr> <direction> <expr>
  1741. ENG|0203040211  |     3| I|             DO ##0203040201<compound>
  1742. ENG|0203040211  |     5|R |    <direction> ::=  TO | DOWNTO
  1743. ENG|0203040212  |     1|RI|    <skip stmt> ::=  SKIP ##0203040118<name>
  1744. ENG|0203040213  |     1|  |    <return stmt> ::=
  1745. ENG|0203040213  |     2|  |               RETURN
  1746. ENG|0203040213  |     3|RI|             | RETURN (##0203040136<expr>)   <-- in SQL-PL functions only
  1747. ENG|0203040214  |     1|RI|    <stop stmt> ::=  STOP  [( ##0203040136<expr> [, <expr>] )]
  1748. ENG|0203040215  |     1|  |    <vectsort stmt> ::=
  1749. ENG|0203040215  |     2| I|               LTSORT ( ##0203040134<vector^slice>,... )
  1750. ENG|0203040215  |     3|R |             | GTSORT ( <vector slice>,... )
  1751. ENG|0203040216  |     1|  |    <proc call> ::=
  1752. ENG|0203040216  |     2|RI|             CALL PROC ##0203040220<name^expr> [PARMS ( ##0203040221<param> ,...)]
  1753. ENG|0203040217  |     1|  |    <form call> ::=
  1754. ENG|0203040217  |     2| I|             CALL FORM ##0203040220<name^expr>
  1755. ENG|0203040217  |     3|  |             [OPTIONS (<form calling options>)]
  1756. ENG|0203040217  |     4|RI|             [PARMS ( ##0203040221<param> ,...)]
  1757. ENG|0203040218  |     1|  |    <switch stmt> ::=
  1758. ENG|0203040218  |     2| I|               SWITCH [ ##0203040220<name^expr> .] <name expr> ##0203040216<form^call>
  1759. ENG|0203040218  |     3|RI|             | SWITCH [<name expr>.] <name expr> ##0203040216<proc^call>
  1760. ENG|0203040219  |     1|  |    <switchcall stmt> ::=
  1761. ENG|0203040219  |     2| I|               SWITCHCALL [ ##0203040220<name^expr> .] <name expr> ##0203040216<form^call>
  1762. ENG|0203040219  |     3|RI|             | SWITCHCALL [<name expr>.] <name expr> ##0203040216<proc^call>
  1763. ENG|0203040220  |     1|  |    <name expr> ::=
  1764. ENG|0203040220  |     2|RI|             ##0203040118<name> | : ##0203040136<expr>
  1765. ENG|0203040221  |     1|  |    <param> ::=
  1766. ENG|0203040221  |     2|RI|             ##0203040118<name>
  1767. ENG|0203040222  |     1|  |    <parm spec list> ::=
  1768. ENG|0203040222  |     2|RI|             PARM/S/ ( ##0203040157<var^decl> ,...)
  1769. ENG|0203040225  |     1|  |    <dbproc call> ::=
  1770. ENG|0203040225  |     2|  |               CALL DBPROC [[<owner>.]<progname>.]<dbproc name>
  1771. ENG|0203040225  |     3| I|                   [PARMS ( ##0203040221<param> ,...] [WITH COMMIT]
  1772. ENG|0203040225  |     4|  |             | SQL ( DBPROC[EDURE] [[<owner>.]<progname>.]<dbproc name>
  1773. ENG|0203040225  |     5|RI|                   [( ##0203040226<host^var> ,...)] [WITH COMMIT] )
  1774. ENG|0203040226  |     1|RI|    <host var> := ##0203040118:<name>
  1775. ENG|0203040227  |     1|  |    <sql stmt> ::=
  1776. ENG|0203040227  |     2| I|               SQL [<dbname>] ( ##0203040228<sql^cmd> )
  1777. ENG|0203040227  |     3| I|             | ##0203040229<dynamic^sql^stmt>
  1778. ENG|0203040227  |     4| I|             | ##0203040230<dynamic^fetch^stmt>
  1779. ENG|0203040227  |     5|RI|             | ##0203040231<mass^fetch^stmt>
  1780. ENG|0203040228  |     1|  |    <sql cmd> ::=
  1781. ENG|0203040228  |     2|R |             see ADABAS Reference Manual
  1782. ENG|0203040229  |     1|  |    <dynamic sql stmt> ::=
  1783. ENG|0203040229  |     2| I|               SQL [<dbname>] EXECUTE IMMEDIATE ##0203040136<expr>
  1784. ENG|0203040229  |     3|  |             | SQL EXECUTE IMMEDIATE <expr> USING <expr list>
  1785. ENG|0203040229  |     4| I|             | SQL EXECUTE ##0203040118<name> USING <expr list>
  1786. ENG|0203040229  |     5|  |             | SQL PREPARE <name> FROM <expr>
  1787. ENG|0203040229  |     6|RI|             | SQL DESCRIBE <name> INTO ##0203040134<vector^slice>
  1788. ENG|0203040230  |     1|  |    <dynamic fetch stmt> ::=
  1789. ENG|0203040230  |     2|RI|             SQL [<dbname>] FETCH IMMEDIATE INTO ##0203040226<host^var> ,...
  1790. ENG|0203040231  |     1|  |    <mass fetch stmt> ::=
  1791. ENG|0203040231  |     2|RI|             SQL [<dbname>] ( FETCH INTO ##0203040134<vector^slice> ,... )
  1792. ENG|0203040232  |     1|  |    <fetch dynamic descr> ::=
  1793. ENG|0203040232  |     2|RI|             SQL FETCH LONGDESCR INTO ##0203040133:<variable>
  1794. ENG|0203040233  |     1|  |    <connect stmt> ::=
  1795. ENG|0203040233  |     2|  |               CONNECT <dbname>
  1796. ENG|0203040233  |     3|  |                   AS ( <username>, <password>, <serverdb>
  1797. ENG|0203040233  |     4|  |                      [,<servernode>] )
  1798. ENG|0203040233  |     5|  |             | CONNECT :<var>
  1799. ENG|0203040233  |     6|  |                   AS ( <username>, <password>, <serverdb>
  1800. ENG|0203040233  |     7|R |                      [,<servernode>] )
  1801. ENG|0203040234  |     1|  |    <release stmt> ::=
  1802. ENG|0203040234  |     2|  |               RELEASE <dbname>
  1803. ENG|0203040234  |     3|R |             | RELEASE :<var>
  1804. ENG|0203040235  |     1|  |    <sqlerror routine> ::=
  1805. ENG|0203040235  |     2|  |             PROC <progname>.SQLERROR ( <modulename> )
  1806. ENG|0203040235  |     3|RI|             ##0203040159<lab^stmt^list>
  1807. ENG|0203040236  |     1|  |    <sqlexception routine> ::=
  1808. ENG|0203040236  |     2|  |             PROC <progname>.SQLEXCEPTION ( <modulename> )
  1809. ENG|0203040236  |     3|RI|             ##0203040159<lab^stmt^list>
  1810. ENG|0203040237  |     1|  |    <sqlnotfound routine> ::=
  1811. ENG|0203040237  |     2|  |             PROC <progname>.SQLNOTFOUND ( <modulename> )
  1812. ENG|0203040237  |     3|RI|             ##0203040159<lab^stmt^list>
  1813. ENG|0203040238  |     1|  |    <sqltimeout routine> ::=
  1814. ENG|0203040238  |     2|  |             PROC <progname>.SQLTIMEOUT ( <modulename> )
  1815. ENG|0203040238  |     3|RI|             ##0203040159<lab^stmt^list>
  1816. ENG|0203040239  |     1|  |    <sqlwarning routine> ::=
  1817. ENG|0203040239  |     2|  |             PROC <progname>.SQLWARNING ( <modulename> )
  1818. ENG|0203040239  |     3|RI|             ##0203040159<lab^stmt^list>
  1819. ENG|0203040240  |     1|  |    <try catch stmt> ::=
  1820. ENG|0203040240  |     2|  |             TRY
  1821. ENG|0203040240  |     3| I|                   ##0203040201<compound>
  1822. ENG|0203040240  |     4| I|             CATCH ##0203040136<expr> OF
  1823. ENG|0203040240  |     5| I|                   ##0203040208<case^list>
  1824. ENG|0203040240  |     6|R |             END
  1825. ENG|0203040241  |     1|  |    <query stmt> ::=
  1826. ENG|0203040241  |     2|  |             QUERY <querycmd spec>
  1827. ENG|0203040241  |     3|RI|             [ ##0203040244<further^facilities> ]
  1828. ENG|0203040242  |     1|  |    <querycmd spec> ::=
  1829. ENG|0203040242  |     2|  |               [ CMD ]  ( <querycmd> )
  1830. ENG|0203040242  |     3|RI|             | EXEC[UTE] ##0203040136<expr>
  1831. ENG|0203040243  |     1|  |    <report stmt> ::=
  1832. ENG|0203040243  |     2|  |             REPORT [<result table name>]
  1833. ENG|0203040243  |     3|  |             [<report cmd spec>]
  1834. ENG|0203040243  |     4| I|             [ ##0203040244<further^facilities> ]
  1835. ENG|0203040243  |     6|  |    <report cmd spec> ::=
  1836. ENG|0203040243  |     7|  |             [ CMD ]  ( <report cmd>;... )
  1837. ENG|0203040243  |     9|  |    <report cmd> ::=
  1838. ENG|0203040243  |    10|  |               see REPORT description
  1839. ENG|0203040243  |    12|RI|    <result table name> ::= ##0203040220<name^expr>
  1840. ENG|0203040244  |     1|  |    <further facilities> ::=
  1841. ENG|0203040244  |     2|  |             [DBNAME   [=] <dbname>]
  1842. ENG|0203040244  |     3| I|             [PROGNAME [=] ##0203040136<expr> ]
  1843. ENG|0203040244  |     4|  |             [VERSION  [=] <expr>]
  1844. ENG|0203040244  |     5|  |             [MODE     [=] <expr>]
  1845. ENG|0203040244  |     6|  |             [HEADER   [=] <expr>]
  1846. ENG|0203040244  |     7| I|             [OPTION[S] ( ##0203040245<query^option> ,... )]
  1847. ENG|0203040244  |     8|RI|             [RESULT ( ##0203040246<result^spec> ,... )]
  1848. ENG|0203040245  |     1|  |    <query option> ::=
  1849. ENG|0203040245  |     2|R |             BACKGROUND | SETOFF | SETLOCAL | NOHEADLINE
  1850. ENG|0203040246  |     1|  |    <result spec> ::=
  1851. ENG|0203040246  |     2| I|             [:] ##0203040133<variable> = <erg spec>
  1852. ENG|0203040246  |     4|  |    <erg spec> ::=
  1853. ENG|0203040246  |     5|  |               SUM   ( <columnid> )
  1854. ENG|0203040246  |     6|  |             | AVG   ( <columnid> )
  1855. ENG|0203040246  |     7|  |             | COUNT ( <columnid> )
  1856. ENG|0203040246  |     8|  |             | MIN   ( <columnid> )
  1857. ENG|0203040246  |     9|  |             | MAX   ( <columnid> )
  1858. ENG|0203040246  |    10|  |             | VAL1  ( <columnid> )
  1859. ENG|0203040246  |    11|  |             | VAL2  ( <columnid> )
  1860. ENG|0203040246  |    12|  |             | VAL3  ( <columnid> )
  1861. ENG|0203040246  |    13|  |             | VAL4  ( <columnid> )
  1862. ENG|0203040246  |    15|  |    <columnid> ::=
  1863. ENG|0203040246  |    16|R |             <natural>
  1864. ENG|0203040247  |     1|  |    <edit call> ::=
  1865. ENG|0203040247  |     2| I|               EDIT ( ##0203040134<vector^slice> [, <edit option>,...] )
  1866. ENG|0203040247  |     3| I|             | EDIT ( ##0203040133<variable> [, <edit option>,...] )
  1867. ENG|0203040247  |     5|  |    <edit option> ::=
  1868. ENG|0203040247  |     6| I|               POS ( ##0203040136<expr> ,<expr>)
  1869. ENG|0203040247  |     7|  |             | SIZE (<expr>,<expr>)
  1870. ENG|0203040247  |     8|  |             | MSG = <expr>
  1871. ENG|0203040247  |     9|  |             | ERR = <expr>
  1872. ENG|0203040247  |    10|  |             | LABEL = <expr>
  1873. ENG|0203040247  |    11|  |             | MARK (<expr>,<expr>)
  1874. ENG|0203040247  |    12|  |             | HEADER = <expr>
  1875. ENG|0203040247  |    13|  |             | PROGNAME = <expr>
  1876. ENG|0203040247  |    14|  |             | MAXLINES = <expr>
  1877. ENG|0203040247  |    15|  |             | PRINT
  1878. ENG|0203040247  |    16|  |             | NOINIT
  1879. ENG|0203040247  |    17|R |             | <basic key> = <expr>
  1880. ENG|0203040248  |     1|  |    <write stmt> ::=
  1881. ENG|0203040248  |     2|  |             WRITE <write expr>,...
  1882. ENG|0203040248  |     4|  |    <write expr> ::=
  1883. ENG|0203040248  |     5| I|               ##0203040136<expr>
  1884. ENG|0203040248  |     6|  |             | HIGH
  1885. ENG|0203040248  |     7|  |             | SIZE (<expr>)
  1886. ENG|0203040248  |     8|  |             | POS (<expr>,<expr>)
  1887. ENG|0203040248  |     9|  |             | PAUSE
  1888. ENG|0203040248  |    10|  |             | CLEAR
  1889. ENG|0203040248  |    11|  |             | NL [(<natural>)]
  1890. ENG|0203040248  |    12|  |             | COL (<natural>)
  1891. ENG|0203040248  |    13|  |             | HI (<expr>,...)
  1892. ENG|0203040248  |    14|  |             | NOCLEAR
  1893. ENG|0203040248  |    15|  |             | OPEN
  1894. ENG|0203040248  |    16|  |             | CLOSE
  1895. ENG|0203040248  |    17|R |             | HOLD
  1896. ENG|0203040249  |     1|  |    <read stmt> ::=
  1897. ENG|0203040249  |     2|  |             READ  <read expr>,...
  1898. ENG|0203040249  |     4|  |    <read expr> ::=
  1899. ENG|0203040249  |     5| I|               ##0203040133<variable>
  1900. ENG|0203040249  |     6|  |             | HIGH
  1901. ENG|0203040249  |     7|  |             | DARK
  1902. ENG|0203040249  |     8| I|             | SIZE ( ##0203040136<expr> )
  1903. ENG|0203040249  |     9|  |             | POS (<expr>,<expr>)
  1904. ENG|0203040249  |    10|  |             | CLEAR
  1905. ENG|0203040249  |    11|  |             | NL [(<natural>)]
  1906. ENG|0203040249  |    12|  |             | COL (<natural>)
  1907. ENG|0203040249  |    13| I|             | PROMPT '##0203040127<any^char>'
  1908. ENG|0203040249  |    14|RI|             | OUTIN ( ##0203040133<variable> )
  1909. ENG|0203040250  |     1|  |    <open file stmt> ::=
  1910. ENG|0203040250  |     2|R |             OPEN <fileid> <filename> <open spec>
  1911. ENG|0203040251  |     1|  |    <close file stmt> ::=
  1912. ENG|0203040251  |     2|R |             CLOSE <fileid>
  1913. ENG|0203040252  |     1|  |    <write file stmt> ::=
  1914. ENG|0203040252  |     2|RI|             WRITEFILE <fileid> ##0203040253<write^file^args>
  1915. ENG|0203040253  |     1|  |    <write file args> ::=
  1916. ENG|0203040253  |     2|RI|             ##0203040136<expr> [: <expr>]  [,<write file args>]
  1917. ENG|0203040254  |     1|  |    <read file stmt> ::=
  1918. ENG|0203040254  |     2|RI|             READFILE <fileid> ##0203040255<read^file^args>
  1919. ENG|0203040255  |     1|  |    <read file args> ::=
  1920. ENG|0203040255  |     2|RI|             ##0203040133<variable> [: ##0203040136<expr>  [,<read file args>] ]
  1921. ENG|0203040256  |     1|RI|    <writetrace stmt> ::= WRITETRACE ##0203040253<write^file^args>
  1922. ENG|0203040257  |     1|  |    <exec command> ::=
  1923. ENG|0203040257  |     2| I|               EXEC [SYNC] ##0203040258<operating^system^command> RESULT variable
  1924. ENG|0203040257  |     3|R |             | EXEC ASYNC  <operating system command>
  1925. ENG|0203040258  |     1|  |    <operating system command> ::=
  1926. ENG|0203040258  |     2|  |                arbitrary command or
  1927. ENG|0203040258  |     3|R |                arbitrary program call of operating system.
  1928. ENG|0203040259  |     1|  |    <arith function> ::=
  1929. ENG|0203040259  |     2| I|               ABS ( ##0203040136<expr> )
  1930. ENG|0203040259  |     3|  |             | SQR (<expr>)
  1931. ENG|0203040259  |     4|  |             | ROUND (<expr>,<expr>)
  1932. ENG|0203040259  |     5|  |             | SQRT (<expr>)
  1933. ENG|0203040259  |     6|  |             | TRUNC (<expr>,<expr>)
  1934. ENG|0203040259  |     7|  |             | SIN (<expr>)
  1935. ENG|0203040259  |     8|  |             | COS (<expr>)
  1936. ENG|0203040259  |     9|  |             | ARCTAN (<expr>)
  1937. ENG|0203040259  |    10|  |             | EXP (<expr>)
  1938. ENG|0203040259  |    11|  |             | LN (<expr>)
  1939. ENG|0203040259  |    12| I|             | INDEX ( ##0203040134<vector^slice> ,<expr>)
  1940. ENG|0203040259  |    13|  |             | LENGTH(<expr>)
  1941. ENG|0203040259  |    14|  |             | ORD (<expr>)
  1942. ENG|0203040259  |    15| I|             | ##0203040260<index^function>
  1943. ENG|0203040259  |    16| I|             | ##0203040302<set^function>
  1944. ENG|0203040259  |    17|SI|             | ##0203040301<strpos^function>
  1945. ENG|0203040259  |    19|RI|             | ##0203040304<sign^function>
  1946. ENG|0203040260  |     1|  |    <index function> ::=
  1947. ENG|0203040260  |     2| I|               INDEX ( ##0203040134<vector^slice> , [NOT] ##0203040136<expr> )
  1948. ENG|0203040260  |     3|R |             | INDEX (<vector slice>, [NOT] NULL)
  1949. ENG|0203040301  |     1|  |    <strpos function> ::=
  1950. ENG|0203040301  |     2| I|               STRPOS ( ##0203040136<expr>, <expr> [, ##0203040137<num^expr> ] )
  1951. ENG|0203040301  |     3|  |             | SPAN   ( <expr>, <expr> [, <num expr> ] )
  1952. ENG|0203040301  |     4|R |             | BREAK  ( <expr>, <expr> [, <num expr> ] )
  1953. ENG|0203040302  |     1|  |    <set function> ::=
  1954. ENG|0203040302  |     2| I|               MIN ( ##0203040303<mixed^expr> ,...)
  1955. ENG|0203040302  |     3|  |             | MAX (<mixed expr>,...)
  1956. ENG|0203040302  |     4|R |             | AVG (<mixed expr>,...)
  1957. ENG|0203040303  |     1|  |    <mixed expr> ::=
  1958. ENG|0203040303  |     2|RI|             ##0203040136<expr> | ##0203040134<vector^slice>
  1959. ENG|0203040304  |     1|  |    <sign function> ::=
  1960. ENG|0203040304  |     2|RI|             SIGN ( ##0203040136<expr> )
  1961. ENG|0203040305  |     1|  |    <string function> ::=
  1962. ENG|0203040305  |     2| I|               TRIM ( <expr [ , ##0203040127'<any^char>' ] )
  1963. ENG|0203040305  |     3| I|             | TRIM ( ##0203040136<expr> ,'<any char>',<side>)
  1964. ENG|0203040305  |     4|  |             | PAD (<expr>[, <expr>])
  1965. ENG|0203040305  |     5|  |             | PAD (<expr>, <expr>,<side>)
  1966. ENG|0203040305  |     6|  |             | SUBSTR(<expr>,<expr> [,<expr>] )
  1967. ENG|0203040305  |     7|  |             | UPPER (<expr>)
  1968. ENG|0203040305  |     8|  |             | LOWER (<expr>)
  1969. ENG|0203040305  |     9|  |             | FORMAT (<expr>,'<char>...')
  1970. ENG|0203040305  |    10|  |             | HEX (<expr>)
  1971. ENG|0203040305  |    11|  |             | CHR (<expr>)
  1972. ENG|0203040305  |    12| I|             | CHANGE ( <expr>, <expr> [, ##0203040137<num^expr> ] )
  1973. ENG|0203040305  |    13|  |             | TOKENIZE (<expr>, <expr>)
  1974. ENG|0203040305  |    14|  |             | SEPARATE (<expr>, <expr>)
  1975. ENG|0203040305  |    16|R |    <side> ::= RIGHT/LEFT/BOTH
  1976. ENG|0203040307  |     1|  |    <date function> ::=
  1977. ENG|0203040307  |     2| I|               ##0203040309<date^arith^function>
  1978. ENG|0203040307  |     3|RI|             | ##0203040308<date^str^function>
  1979. ENG|0203040308  |     1|  |    <date str function> ::=
  1980. ENG|0203040308  |     2| I|               DATE [ ([<date mask>]  , ##0203040136<expr> [,<date mask>]) ]
  1981. ENG|0203040308  |     3|  |             | TIME [ ([<time mask>]  ,<expr> [,<time mask>])]
  1982. ENG|0203040308  |     4|  |             | ADDDATE (<expr>,<expr>)
  1983. ENG|0203040308  |     5|  |             | SUBDATE (<expr>,<expr>)
  1984. ENG|0203040308  |     6|  |             | MAKETIME (<expr>,<expr>,<expr>)
  1985. ENG|0203040308  |     7|  |             | ADDTIME (<expr>,<expr>)
  1986. ENG|0203040308  |     8|R |             | SUBTIME (<expr>,<expr>)
  1987. ENG|0203040309  |     1|  |    <date arith function> ::=
  1988. ENG|0203040309  |     2| I|               DAYOFWEEK ( ##0203040136<expr> )
  1989. ENG|0203040309  |     3|  |             | WEEKOFYEAR (<expr>)
  1990. ENG|0203040309  |     4|  |             | DAYOFYEAR (<expr>)
  1991. ENG|0203040309  |     5|  |             | DATEDIFF (<expr>,<expr>)
  1992. ENG|0203040309  |     6|R |             | TIMEDIFF (<expr>,<expr>)
  1993. ENG|0203040310  |     1|  |    <set function> ::=
  1994. ENG|0203040310  |     2|RI|             SET ( ##0203040312<set^id> )
  1995. ENG|0203040311  |     1|  |    <set stmt> ::=
  1996. ENG|0203040311  |     2|RI|             SET ( ##0203040312<set^id> , ##0203040136<expr> )
  1997. ENG|0203040312  |     1|  |    <set id> ::=
  1998. ENG|0203040312  |     2|  |               COPIES
  1999. ENG|0203040312  |     3|  |             | CODEAREA
  2000. ENG|0203040312  |     4|  |             | DATE
  2001. ENG|0203040312  |     5|  |             | DECIMALREP
  2002. ENG|0203040312  |     6|  |             | NESTING
  2003. ENG|0203040312  |     7|  |             | NULLVALUE
  2004. ENG|0203040312  |     8|  |             | LANGUAGE
  2005. ENG|0203040312  |     9|  |             | PRESENTATION
  2006. ENG|0203040312  |    10|  |             | PRETTY
  2007. ENG|0203040312  |    11|  |             | PRINTFORMAT
  2008. ENG|0203040312  |    12|  |             | PROTOCOL
  2009. ENG|0203040312  |    13|  |             | SEPARATOR
  2010. ENG|0203040312  |    14|  |             | SYSEDITOR
  2011. ENG|0203040312  |    15|  |             | TARGET_LANGS
  2012. ENG|0203040312  |    16|  |             | TIME
  2013. ENG|0203040312  |    17|S |             | VERSION
  2014. ENG|0203040312  |    19|R |             | VALUEAREA
  2015. ENG|0203040313  |     1|  |    <systime func> ::=
  2016. ENG|0203040313  |     2|R |             INITTIME | GETTIME
  2017. ENG|0203040314  |     1|  |    <dollar numeric variable> ::=
  2018. ENG|0203040314  |     2|  |               $COLNO
  2019. ENG|0203040314  |     3|  |             | $COUNT
  2020. ENG|0203040314  |     4|  |             | $CURSOR
  2021. ENG|0203040314  |     5|  |             | $EDITLINES
  2022. ENG|0203040314  |     6|  |             | $MAXLINES
  2023. ENG|0203040314  |     7|  |             | $MAXCOLS
  2024. ENG|0203040314  |     8|  |             | $MICRO
  2025. ENG|0203040314  |     9|  |             | $RC
  2026. ENG|0203040314  |    10|  |             | $ROWNO
  2027. ENG|0203040314  |    11|  |             | $SCREENCOLS
  2028. ENG|0203040314  |    12|  |             | $SCREENLNS
  2029. ENG|0203040314  |    13|  |             | $SEC
  2030. ENG|0203040314  |    14|R |             | $SYSRC
  2031. ENG|0203040315  |     1|  |    <dollar string variable> ::=
  2032. ENG|0203040315  |     2|  |               $ACTION
  2033. ENG|0203040315  |     3|  |             | $CMD
  2034. ENG|0203040315  |     4|  |             | $FUNCTION|$FUNCTION1...|$FUNCTION4
  2035. ENG|0203040315  |     5|  |             | $GROUP
  2036. ENG|0203040315  |     6|  |             | $KEY
  2037. ENG|0203040315  |     7|  |             | $OS
  2038. ENG|0203040315  |     8|  |             | $RT
  2039. ENG|0203040315  |     9|  |             | $SERVERDB
  2040. ENG|0203040315  |    10|  |             | $SYSRT
  2041. ENG|0203040315  |    11|  |             | $TERM
  2042. ENG|0203040315  |    12|  |             | $USER
  2043. ENG|0203040315  |    13|R |             | $USERMODE
  2044. ENG|0203040316  |     1|  |    <dollar boolean variable> ::=
  2045. ENG|0203040316  |     2|  |               $SQLWARN
  2046. ENG|0203040316  |     3|RI|             | $SQLWARN [( ##0203040136<expr> )]
  2047. ENG|0203040317  |     1|  |    <object header> ::=
  2048. ENG|0203040317  |     2|  |             <object type> <progname>.<modname>
  2049. ENG|0203040317  |     3| I|             OPTION/S/ ( ##0203040318<module^option> ,... )
  2050. ENG|0203040317  |     5|  |    <object type> ::=
  2051. ENG|0203040317  |     6|  |               PROC
  2052. ENG|0203040317  |     7|  |             | FUNCTION
  2053. ENG|0203040317  |     8|  |             | DBPROC
  2054. ENG|0203040317  |     9|  |             | TRIGGER
  2055. ENG|0203040317  |    10|  |             | FORM
  2056. ENG|0203040317  |    11|R |             | HELPFORM
  2057. ENG|0203040318  |     1|  |    <module option> ::=
  2058. ENG|0203040318  |     2|  |               <loop option>
  2059. ENG|0203040318  |     3|  |             | <autocommit option>
  2060. ENG|0203040318  |     4|  |             | <trace option>
  2061. ENG|0203040318  |     5|  |             | <test dbproc option>
  2062. ENG|0203040318  |     6|  |             | <lib option>
  2063. ENG|0203040318  |     7|  |             | <keyswap option>
  2064. ENG|0203040318  |     9|  |    <loop option> ::=
  2065. ENG|0203040318  |    10|  |             LOOP /=/ <natural>
  2066. ENG|0203040318  |    12|  |    <autocommit option> ::=
  2067. ENG|0203040318  |    13|  |             AUTOCOMMIT OFF
  2068. ENG|0203040318  |    15|  |    <trace option> ::=
  2069. ENG|0203040318  |    16|  |               SQLTRACE /ALL/
  2070. ENG|0203040318  |    17|S |             | MODULETRACE
  2071. ENG|0203040318  |    19|  |    <test dbproc option> ::= TEST DBPROC
  2072. ENG|0203040318  |    21|  |    <lib option> ::=
  2073. ENG|0203040318  |    22|  |             LIB [<username>.] <libname>
  2074. ENG|0203040318  |    24|  |    <keyswap option> ::=
  2075. ENG|0203040318  |    25|R |             <keyswap spec>
  2076. ENG|02030405    |     1|  |                      Keywords
  2077. ENG|02030405    |     2|  |                      --------
  2078. ENG|02030405    |     4| I|    ##0203030102$ACTION     ##0203030102$CMD        ##0203030109$COLNO      ##0203030104$COUNT      ##0203030102$CURSOR
  2079. ENG|02030405    |     5| I|    ##0203030102$EDITLINES  ##0203030102$FUNCTION   ##0203030101$GROUP      ##0203030110$ITEMS      ##0203030102$KEY
  2080. ENG|02030405    |     6| I|    ##0203030107$KEYLINES   ##0203030105$MAXLINES   ##0203030105$MAXCOLS    ##02030211$MICRO      ##0203030107$MSGLINES
  2081. ENG|02030405    |     7| I|    ##0203030108$OS         ##0203030108$PROCESSID  ##0203030103$RC         ##0203030109$COLNO      ##0203030103$RT
  2082. ENG|02030405    |     8| I|    ##0203030105$SCREENCOLS ##0203030105$SCREENLNS  ##02030211$SEC        ##0203030101$SERVERDB   ##0203030103$SQLCODE
  2083. ENG|02030405    |     9| I|    ##0203030103$SQLERRMC   ##0203030103$SQLERRPOS  ##0203030106$SQLWARN    ##0203030110$SYSRC      ##0203030110$SYSRT
  2084. ENG|02030405    |    10| I|    ##0203030108$TERM       ##0203030101$USER       ##0203030101$USERMODE
  2085. ENG|02030405    |    12| I|    ##0203030207ABS         ##050408ACCEPT      ##0203030402ADDDATE     ##0203030404ADDTIME     ##0203011004ALL
  2086. ENG|02030405    |    13| I|    ##0203011003ALPHA       ##0203011001AND         ##0203011004ANY         ##0203030203ARCTAN      ##0203030201AVG
  2087. ENG|02030405    |    15| I|    ##02030404BEGIN       ##0203011002BETWEEN     ##0203030301BLANK       ##0203030312BREAK
  2088. ENG|02030405    |    17|SI|    ##02030106CALL        ##02030104CASE        ##02030116CATCH       ##0203030307CHANGE      ##0203030308CHR
  2089. ENG|02030405    |    19| I|    ##05040404CHECK       ##02030202CLEAR       ##0203020601CLOSE       ##02030202CMDKEY      ##02030202COL
  2090. ENG|02030405    |    20| I|    ##0203020406CONNECT     ##050411CONTROL     ##0203030203COS         ##050607CPAGE
  2091. ENG|02030405    |    22| I|    ##02030203DARK        ##0203030401DATE        ##0203030402DATEDIFF    ##0203030403DAYOFWEEK   ##0203030403DAYOFYEAR
  2092. ENG|02030405    |    23| I|    ##0211DBPROC      ##0203011005DELETING    ##020302040202DESCRIBE    ##02030401DIV         ##02030112DO
  2093. ENG|02030405    |    24| I|    ##050408DOWN        ##050408DOWNKEY     ##02030112DOWNTO
  2094. ENG|02030405    |    26| I|    ##0203011004EACH        ##02030207EDIT        ##02030103ELSE        ##02030404END         ##050408ENDKEY
  2095. ENG|02030405    |    27| I|    ##0502ENDLAYOUT   ##110301ENDMODULE   ##050408ENTER       ##0203011003EOF         ##0502ERROR
  2096. ENG|02030405    |    28| I|    ##050409EXCEPT      ##02030212EXEC        ##0203020402EXECUTE     ##0203030204EXP
  2097. ENG|02030405    |    30| I|    ##0203020401FETCH       ##050404FIELD       ##0203011005FIRSTCALL   ##0203011003FIXED       ##02030112FOR
  2098. ENG|02030405    |    31| I|    ##0502FORM        ##0203030304FORMAT      ##050603FORMPOS     ##020701FUNCTION    ##050408F1^..^F12
  2099. ENG|02030405    |    33| I|    ##02030211GETIME      ##02030209GTSORT
  2100. ENG|02030405    |    35|SI|    ##050408HELP        ##05040403HELPFORM    ##050408HELPKEY     ##0203030309HEX         ##02030202HI
  2101. ENG|02030405    |    37| I|    ##02030202HIGH
  2102. ENG|02030405    |    39| I|    ##02030103IF          ##050409IGNORE      ##050403IN          ##0203030305INDEX       ##05040402INIT
  2103. ENG|02030405    |    40| I|    ##02030211INITTIME    ##021102INOUT       ##0203011005INSERTING   ##0203020403INTO        ##02030110IS
  2104. ENG|02030405    |    42| I|    ##02030207KEYSWAP
  2105. ENG|02030405    |    44| I|    ##0203011005LASTCALL    ##0502LAYOUT      ##050408LEFT        ##050408LEFTKEY
  2106. ENG|02030405    |    45| I|    ##0203030303LENGTH      ##0203011002LIKE        ##050607LINEFEED    ##050607LINESPACE   ##0203030204LN
  2107. ENG|02030405    |    46| I|    ##050402LOW         ##0203030310LOWER       ##02030209LTSORT
  2108. ENG|02030405    |    48| I|    ##0203030405MAKETIME    ##0203030201MAX         ##0203030205MDS         ##0502MESSAGE     ##0203030201MIN
  2109. ENG|02030405    |    49| I|    ##02030401MOD         ##0203011003MODIFIED
  2110. ENG|02030405    |    51| I|    ##050607NEWPAGE     ##050905NEXTFIELD   ##050906NEXTGROUP   ##02030202NL          ##050606NOINIT
  2111. ENG|02030405    |    52|SI|    ##0203011001NOT         ##0203011003NULL        ##0203011003NUMERIC
  2112. ENG|02030405    |    55| I|    ##02030104OF          ##0203011004ONE         ##0203020601OPEN        ##020305OPTION      ##020305OPTIONS
  2113. ENG|02030405    |    56| I|    ##0203011001OR          ##0203030308ORD         ##02030104OTHERWISE   ##050403OUT         ##02030203OUTIN
  2114. ENG|02030405    |    58| I|    ##0203030314PAD         ##050405PAGE        ##02030106PARM        ##02030106PARMS       ##02030202PAUSE
  2115. ENG|02030405    |    59| I|    ##050408PF1^..^PF12 ##0203030205PI          ##050406PICK        ##02030202POS         ##020302040202PREPARE
  2116. ENG|02030405    |    60| I|    ##050607PRINT       ##02030106PROC        ##02030203PROMPT      ##050406PUT
  2117. ENG|02030405    |    62| I|    ##0203020502QUERY
  2118. ENG|02030405    |    64| I|    ##02030203READ        ##0203020602READFILE    ##0203020406RELEASE     ##02030101REPEAT      ##02030205REPORT
  2119. ENG|02030405    |    65| I|    ##02030105RETURN      ##050416RETURNONLAST##050408RIGHT       ##050408RIGHTKEY    ##0203030202ROUND
  2120. ENG|02030405    |    67| I|    ##050603SCREENPOS   ##050603SCREENSIZE  ##0203030315SEPARATE    ##02030210SET         ##0203030208SIGN
  2121. ENG|02030405    |    68| I|    ##0203030203SIN         ##02030202SIZE        ##02030109SKIP        ##050408SK1^..^SK9  ##0203011004SOME
  2122. ENG|02030405    |    69| I|    ##0203030313SPAN        ##02030204SQL         ##0203030206SQR         ##0203030206SQRT        ##02030111STOP
  2123. ENG|02030405    |    70| I|    ##0203030306STRPOS      ##0203030402SUBDATE     ##0203030302SUBSTR      ##0203030404SUBTIME     ##02030108SWITCH
  2124. ENG|02030405    |    71|SI|    ##02030114SWITCHCALL
  2125. ENG|02030405    |    73| I|    ##02030103THEN        ##0203030401TIME        ##0203030404TIMEDIFF    ##02030112TO          ##0203030315TOKENIZE
  2126. ENG|02030405    |    74| I|    ##0211TRIGGER     ##0203030303TRIM        ##0203030202TRUNC       ##02030116TRY
  2127. ENG|02030405    |    76| I|    ##02030101UNTIL       ##050408UP          ##0203011005UPDATING    ##050408UPKEY       ##0203030310UPPER
  2128. ENG|02030405    |    78|RI|    ##0203030403WEEKOFYEAR  ##050409WHEN        ##02030102WHILE       ##02030202WRITE       ##0203020603WRITEFILE
  2129. ENG|020305      |     1|  |    Some  specifications  which  are listed in the following may be made in
  2130. ENG|020305      |     2|  |    the OPTIONS statement (directly after the module header).
  2131. ENG|020305      |     4|  |    LOOP <number>  delimits the number of iterations for  FOR,  WHILE,  and
  2132. ENG|020305      |     5|  |         REPEAT  loops to the specified number. If this number is exceeded,
  2133. ENG|020305      |     6|  |         program execution is  cancelled  and  the  message  'endless  loop
  2134. ENG|020305      |     7|  |         assumed' is output.
  2135. ENG|020305      |     9|  |    AUTOCOMMIT OFF   has the effect that in this routine no implicit COMMIT
  2136. ENG|020305      |    10|  |         WORK is performed before user input (READ, FORM  call).  Moreover,
  2137. ENG|020305      |    11|  |         the error 700 ( Command inactivity timeout ) is passed and must be
  2138. ENG|020305      |    12|  |         intercepted by the program.
  2139. ENG|020305      |    14|  |    MODULETRACE   has  the  effect that all subroutine calls made since the
  2140. ENG|020305      |    15|  |         start of this routine are recorded in a file.  The  name  of  this
  2141. ENG|020305      |    16|S |         file can be defined via the workbench command SET (protocol).
  2142. ENG|020305      |    19|  |    SQLTRACE   has  the  effect that all SQL calls performed in the routine
  2143. ENG|020305      |    20|  |         are recorded in a file.
  2144. ENG|020305      |    22|  |    SQLTRACE ALL  has the effect that all subsequent SQL calls are recorded
  2145. ENG|020305      |    23|  |         in a file.
  2146. ENG|020305      |    25|  |    LIB /<user name>./ <library name>   has  the  effect  that  after  this
  2147. ENG|020305      |    26|  |         routine has been called user-defined SQL-PL functions are searched
  2148. ENG|020305      |    27|  |         in  the  specified  library. The default library is <user>.STDLIB.
  2149. ENG|020305      |    28|  |         This setting remains valid, until a new declaration is made or the
  2150. ENG|020305      |    29|  |         routine is left.
  2151. ENG|020305      |    31| I|    TEST DBPROC has the effect that all ##02030115CALL^DBPROC statements contained in
  2152. ENG|020305      |    32|  |    this routine are translated for a special test mode. As  a  result,  at
  2153. ENG|020305      |    33|  |    runtime  the  actual  call  of the DB procedure will be simulated, thus
  2154. ENG|020305      |    34| I|    providing  the  standard  test   facilities   (   ##0209Debugger,   SQLTRACE,
  2155. ENG|020305      |    35|S |    MODULETRACE ).
  2156. ENG|020305      |    37|  |    SUBPROC has the effect that any statement not allowed in a DB procedure
  2157. ENG|020305      |    38|  |      is marked as an error.
  2158. ENG|020305      |    40| I|    ##050410KEYSWAP^Option.
  2159. ENG|020305      |    42|  |    Examples :
  2160. ENG|020305      |    44|  |
  2161. ENG|020305      |    45| E|      PROC customer.start OPTIONS ( LOOP 50, AUTOCOMMIT OFF );
  2162. ENG|020305      |    46| E|      PROC customer.start OPTIONS ( LIB customerfct, SQLTRACE, MODULETRACE );
  2163. ENG|020305      |    47|  |
  2164. ENG|020305      |    49|RI|                                                          ##0203040318->^Syntax
  2165. ENG|0207        |     1|  |    SQL-PL Functions
  2166. ENG|0207        |     3|  |    SQL-PL  functions  help  to  develop  large applications. Functionality
  2167. ENG|0207        |     4|  |    required in the entire application ( i.e. in various programs ) can  be
  2168. ENG|0207        |     5|  |    gathered  in a library. The functions can be called without leaving the
  2169. ENG|0207        |     6|  |    current program.
  2170. ENG|0207        |     8| M|    #01Declaring Functions
  2171. ENG|0207        |     9| M|    #02Calling Functions
  2172. ENG|0207        |    10|RM|    #03Restrictions
  2173. ENG|020701      |     1|  |    Declaring an SQL-PL Function
  2174. ENG|020701      |     3|  |    Functions are distinguished from normal SQL-PL routines by the  leading
  2175. ENG|020701      |     4|  |    keyword FUNCTION. A value can be returned to the calling environment by
  2176. ENG|020701      |     5|  |    means of the RETURN statement.
  2177. ENG|020701      |     7|  |    Examples :
  2178. ENG|020701      |     9|  |
  2179. ENG|020701      |    10| E|      FUNCTION stdlib.sum PARMS (@s1, @s2, @s3, @s4, @s5);
  2180. ENG|020701      |    11| E|      RETURN (@s1 + @s2 + @s3 + @s4 + @s5);
  2181. ENG|020701      |    13| E|      FUNCTION stdlib.list PARM (@reportname);
  2182. ENG|020701      |    14| E|      REPORT CMD ( TTITLE '':@report name'')
  2183. ENG|020701      |    15|  |
  2184. ENG|020701      |    17|RI|                                                          ##0203040107->^Syntax
  2185. ENG|020702      |     1|  |    Calling Functions
  2186. ENG|020702      |     3|  |    An  SQL-PL  function  call  is  preceded  by  the percent (%) sign. The
  2187. ENG|020702      |     4| I|    function is searched in the library currently set ( ##020305Options and
  2188. ENG|020702      |     5|  |    Debugging Aids ).
  2189. ENG|020702      |     7|  |    Function calls can be used in expressions, but they may also  occur  as
  2190. ENG|020702      |     8|  |    statements in their own right.
  2191. ENG|020702      |    10|  |    Examples :
  2192. ENG|020702      |    12|  |
  2193. ENG|020702      |    13| E|      sum := %sum (a,b,c,d,e);
  2194. ENG|020702      |    14| E|      %list ('customers');
  2195. ENG|020702      |    15|  |
  2196. ENG|020702      |    17|S |    When  used  in expressions, a value must be returned in the function by
  2197. ENG|020702      |    19|  |    means of the RETURN statement.
  2198. ENG|020702      |    21|RI|                                                          ##0203040141->^Syntax
  2199. ENG|020703      |     1|  |    Restrictions
  2200. ENG|020703      |     3|  |    SQL-PL functions must not contain CALL and  SWITCH  statements;  SQL-PL
  2201. ENG|020703      |     4|  |    functions may be called.
  2202. ENG|020703      |     6|R |    Global variables are not allowed.
  2203. ENG|0208        |     1|  |    Restrictions
  2204. ENG|0208        |     3|  |    - 512   different  g l o b a l  variables.
  2205. ENG|0208        |     4|  |    - 255   components per vector.
  2206. ENG|0208        |     5|  |    - 12276 byte variable values.
  2207. ENG|0208        |     6|  |    - 63    modules per program accessing globals variables
  2208. ENG|0208        |     7|  |    - 255   output and input fields per form.
  2209. ENG|0208        |     8|  |    - 255   SQL variables per SQL command.
  2210. ENG|0208        |     9|  |    - Any number of programs per user.
  2211. ENG|0208        |    10|  |    - 255   formal parameters per routine.
  2212. ENG|0208        |    11|  |    - 20    arguments for form call option ATTR.
  2213. ENG|0208        |    12|  |    - 20    variable arguments for form call option INPUT.
  2214. ENG|0208        |    13|R |    - 255   field number arguments for form call option INPUT.
  2215. ENG|0209        |     1|  |                      The Debugger
  2216. ENG|0209        |     2|  |                      ------------
  2217. ENG|0209        |     4| M|                      #00Procedure
  2218. ENG|0209        |     5| M|                      #01Displaying^Variables
  2219. ENG|0209        |     6| M|                      #02Modifying^Variables
  2220. ENG|0209        |     7| M|                      #03Setting^Breakpoints
  2221. ENG|0209        |     8| M|                      #04Removing^Breakpoints
  2222. ENG|0209        |     9| M|                      #06Displaying^Breakpoints
  2223. ENG|0209        |    10| M|                      #05Displaying^System^Variables
  2224. ENG|0209        |    11|RM|                      #06Other^Commands
  2225. ENG|020900      |     1|  |    The   SQL-PL   debugging  aids  ( debugger )  shall  help  the  program
  2226. ENG|020900      |     2|  |    developper to test the SQL-PL applications.
  2227. ENG|020900      |     4|  |    Therefore the following procedure is required for the debugger:
  2228. ENG|020900      |     5| I|    Entering ##1106DOPT^ON into the command line of the workbench or  the  editor
  2229. ENG|020900      |     6|  |    enables the debug option. The modules to be processed with the debugger
  2230. ENG|020900      |     7| I|    must be retranslated with ##110205STORE.
  2231. ENG|020900      |     9| I|    Entering ##1106DOPT^OFF disables the debug option.
  2232. ENG|020900      |    11|  |    The  program  is  executed  'in  the usual way', until the first module
  2233. ENG|020900      |    12|  |    translated with debug option is called. Then  SQL-PL  branches  to  the
  2234. ENG|020900      |    13|  |    debugger.  The  SQL-PL  module  is  displayed  in the lower part of the
  2235. ENG|020900      |    14|  |    screen. The current statement is displayed brightly in the middle  line
  2236. ENG|020900      |    15|  |    of the edit form. The UP and DOWN keys can be used for scrolling in the
  2237. ENG|020900      |    16|S |    edit form.
  2238. ENG|020900      |    19|  |    The  debugger  commands described below can be specified in the command
  2239. ENG|020900      |    20|  |    line. Displays, if any, are made to the upper part of the screen.
  2240. ENG|020900      |    23| I|    The debugger allows variable contents  to  be  ##020901displayed  or  ##020902modified;
  2241. ENG|020900      |    24| I|    breakpoints to be ##020903defined, ##020904removed, or ##020906displayed.
  2242. ENG|020900      |    26| I|    The  developper  may  have  the  ##020905System^Variables and the ##020906Call^Sequence
  2243. ENG|020900      |    27|R |    displayed.
  2244. ENG|020901      |     1|  |    The value of individual variables, vector components, and vector slices
  2245. ENG|020901      |     2|  |    of the current program can be displayed.
  2246. ENG|020901      |     4|  |    V <varname>
  2247. ENG|020901      |     5|  |    V <varname> ( <index> )
  2248. ENG|020901      |     6|  |    V <varname> ( <lower index> .. <upper index> )
  2249. ENG|020901      |     8|  |    Examples :
  2250. ENG|020901      |    10|  |      V counter
  2251. ENG|020901      |    11|  |      V list(1..10)
  2252. ENG|020901      |    12|R |      V @customerno(5)
  2253. ENG|020902      |     1|  |    The value of individual variables, vector components, and vector slices
  2254. ENG|020902      |     2|  |    of the current program can be modified.
  2255. ENG|020902      |     4|  |    A number or a character string can be specified here. Character strings
  2256. ENG|020902      |     5|  |    are to be specified without single quotes. They  are  accepted  without
  2257. ENG|020902      |     6|  |    any changes.
  2258. ENG|020902      |     8|  |    If  no  value  is  specified after the variable name, the NULL value is
  2259. ENG|020902      |     9|  |    assigned to this variable.
  2260. ENG|020902      |    11|  |    A <varname> /<value>/
  2261. ENG|020902      |    12|  |    A <varname> ( <index> ) /<value>/
  2262. ENG|020902      |    13|  |    A <varname> ( <lower index> .. <upper index> ) /<value>/
  2263. ENG|020902      |    15|  |    Example :
  2264. ENG|020902      |    17|S |      A counter 10
  2265. ENG|020902      |    19|  |      A @customerno(2) C1234
  2266. ENG|020902      |    20|R |      A list(1..10)
  2267. ENG|020903      |     1|  |    The B function can be used for defining breakpoints in  routines  which
  2268. ENG|020903      |     2|  |    are capable of being debugged.
  2269. ENG|020903      |     4|  |    B <program>/<module>/<line number>
  2270. ENG|020903      |     5|  |    B <line number>
  2271. ENG|020903      |     7|  |    Program execution is interrupted before performing the statement in the
  2272. ENG|020903      |     8|  |    editor line <line number>. If no module is specified, the breakpoint is
  2273. ENG|020903      |     9|  |    inserted into the corresponding line of the current module.
  2274. ENG|020903      |    11|  |    BV <varname>
  2275. ENG|020903      |    12|  |    BV <varname> ( <index> )
  2276. ENG|020903      |    14|  |    Program  execution  is  interrupted  when  the  value  of the specified
  2277. ENG|020903      |    15|S |    variables was changed.
  2278. ENG|020903      |    19|  |    Examples :
  2279. ENG|020903      |    21|  |      B customer/start/0005
  2280. ENG|020903      |    22|  |      B 5
  2281. ENG|020903      |    23|  |      BV counter
  2282. ENG|020903      |    24|R |      BV @customerno(2)
  2283. ENG|020904      |     1|  |    The R function can be used for deactivating the specified breakpoint.
  2284. ENG|020904      |     3|  |    R <program>/<module>/<line number>
  2285. ENG|020904      |     4|  |    R <line number>
  2286. ENG|020904      |     6|  |    RV <varname>
  2287. ENG|020904      |     7|  |    RV <varname> ( <index> )
  2288. ENG|020904      |     9|  |    Examples :
  2289. ENG|020904      |    11|  |      R customer/start/0005
  2290. ENG|020904      |    12|  |      R 5
  2291. ENG|020904      |    13|  |      RV counter
  2292. ENG|020904      |    14|R |      RV @customerno(2)
  2293. ENG|020905      |     1|  |    $        displays the dollar variables :
  2294. ENG|020905      |     2|  |             $USER, $GROUP, $DBNAME, $FILERC, $RC, $COUNT,
  2295. ENG|020905      |     3|  |             $CURSOR, $EDITLINES, $SEC, $MICRO, $ROWNO, $COLNO,
  2296. ENG|020905      |     4|  |             $SCREENLNS, $SCREENCOLS, $MAXLINES, $MAXCOLS,
  2297. ENG|020905      |     5|  |             $MSGLINES, $KEYLINES, $CMD, $KEY
  2298. ENG|020905      |     7|R |    $<name>  displays the value of the specified system variables.
  2299. ENG|020906      |     1|  |    L                     displays a list of all breakpoints
  2300. ENG|020906      |     2|  |                          defined for statements.
  2301. ENG|020906      |     4|  |    LV                    displays a list of all breakpoints
  2302. ENG|020906      |     5|  |                          defined for variables.
  2303. ENG|020906      |     7|  |    T                     displays the sequence of the called modules.
  2304. ENG|020906      |     9|  |    G                     continues program execution up to the next
  2305. ENG|020906      |    10|  |                          breakpoint or up to the end of program.
  2306. ENG|020906      |    12|  |    H                     has the effect that the program is terminated
  2307. ENG|020906      |    13|  |                          at once.
  2308. ENG|020906      |    15|  |    S                     enables or disables the single step mode.
  2309. ENG|020906      |    17|S |    X                     displays the values of the parameters passed.
  2310. ENG|020906      |    19|  |    ?  or HELP key       branches to the HELP mode.
  2311. ENG|020906      |    20|R |    RESET key             clears the upper part of the screen.
  2312. ENG|0211        |     1|  |                      DB Procedures
  2313. ENG|0211        |     2|  |                      -------------
  2314. ENG|0211        |     4| M|                      #01Restrictions
  2315. ENG|0211        |     5| M|                      #02Parameter Declarations
  2316. ENG|0211        |     6| M|                      #05Trigger Parameter Declarations
  2317. ENG|0211        |     7| M|                      #03Restricted Statements
  2318. ENG|0211        |     8| M|                      #04Call
  2319. ENG|0211        |     9| I|                      ##1107Administration of DB procedures
  2320. ENG|0211        |    10|RI|                      ##1108Administration of trigger procedures
  2321. ENG|021101      |     1|  |        Restrictions in DB Procedures
  2322. ENG|021101      |     3|  |    If an SQL-PL routine shall be declared a DB  procedure,  the  following
  2323. ENG|021101      |     4|  |    restrictions apply in addition :
  2324. ENG|021101      |     6| I|    -  the ##021102parameters of the procedure must be declared.
  2325. ENG|021101      |     8|  |    -  the  size  of  a procedure is restricted to a quarter of the maximum
  2326. ENG|021101      |     9|  |       size of a normal SQL-PL routine.
  2327. ENG|021101      |    11|  |    -  all modules called directly or indirectly must  be  available,  they
  2328. ENG|021101      |    12|  |       are subject to the same restrictions.
  2329. ENG|021101      |    14| I|    -  not all ##021103SQL-PL statements are permitted
  2330. ENG|021101      |    16|R |    -  the compiler options DEBUG and SQLSYNTAX are ignored.
  2331. ENG|021102      |     1|  |        Parameter Declaration in DB Procedures
  2332. ENG|021102      |     3|  |    DB  procedures can also be called out of precompiler programs. As their
  2333. ENG|021102      |     4|  |    programming languages are subject to a type concept other than  SQL-PL,
  2334. ENG|021102      |     5|  |    it  is  necessary  to  declare  the  parameters  of  the main procedure
  2335. ENG|021102      |     6|  |    according to mode and data type.
  2336. ENG|021102      |     8|  |    Mode is
  2337. ENG|021102      |    10|  |    -  IN (input parameter)
  2338. ENG|021102      |    12|  |    -  OUT (output parameter)
  2339. ENG|021102      |    14|  |    -  INOUT (input/output parameter)
  2340. ENG|021102      |    16|  |    The type is equivalent to the SQL data types of ADABAS :
  2341. ENG|021102      |    17|S |    FIXED, FLOAT, CHAR (BYTE/DBYTE), TIME, DATE, TIMESTAMP.
  2342. ENG|021102      |    19|  |    A parameter of type LONG cannot be declared. NOT NULL, default  values,
  2343. ENG|021102      |    20|  |    and constraints are not supported either.
  2344. ENG|021102      |    22|  |    These  declarations  are  only  important  for  the parameter transfer;
  2345. ENG|021102      |    23|  |    within the DB procedure the parameter variables can assume any type.
  2346. ENG|021102      |    25|  |    Example :
  2347. ENG|021102      |    27|  |          DBPROC hotel.reservation (
  2348. ENG|021102      |    28|  |           IN  @customername CHAR(40),
  2349. ENG|021102      |    29|  |           IN  @day          DATE,
  2350. ENG|021102      |    30|  |           OUT @hotel        CHAR(20),
  2351. ENG|021102      |    31|  |           OUT @costs        FIXED(6,2) );
  2352. ENG|021102      |    34|RI|                                                          ##0203040110->^Syntax
  2353. ENG|021103      |     1|  |    In DB procedures it is not permitted
  2354. ENG|021103      |     4|  |    to make output to the screen, the printer, or an operating system file :
  2355. ENG|021103      |     5|  |    WRITE, READ
  2356. ENG|021103      |     6|  |    CALL FORM, EDIT, REPORT, QUERY
  2357. ENG|021103      |     7|  |    WRITEFILE, READFILE, OPEN, CLOSE
  2358. ENG|021103      |     8|  |    option MODULETRACE, SQLTRACE
  2359. ENG|021103      |    10|  |    to change the current program
  2360. ENG|021103      |    11|  |    SWITCH, SWITCHCALL
  2361. ENG|021103      |    13|  |    to use the extended SQL interface :
  2362. ENG|021103      |    14|  |    dynamic SQL
  2363. ENG|021103      |    15|  |    multi-DB accessibility
  2364. ENG|021103      |    17|S |    to perform DB procedures :
  2365. ENG|021103      |    19|  |    CALL DBPROC
  2366. ENG|021103      |    20|  |    SQL ( DBPROCEDURE ... )
  2367. ENG|021103      |    21|  |    Calling the corresponding SQL-PL routine, however, is possible via  the
  2368. ENG|021103      |    22|  |    CALL PROC statement.
  2369. ENG|021103      |    24|  |    to conclude a transaction :
  2370. ENG|021103      |    25|  |    SQL ( COMMIT ); SQL ( ROLLBACK )
  2371. ENG|021103      |    26|R |    Subtransactions are permitted.
  2372. ENG|021104      |     1|  |        Calling DB Procedures
  2373. ENG|021104      |     3|  |    Calling from SQL-PL :
  2374. ENG|021104      |     5| I|    ##02030115CALL^DBPROC Statement
  2375. ENG|021104      |     8|  |    Calling from precompiler programs :
  2376. ENG|021104      |    10|  |    EXEC SQL ( DBPROCEDURE owner.appl.module ( :var1, :var2, ... ) )
  2377. ENG|021104      |    12|R |    For details see the precompiler documentation.
  2378. ENG|021105      |     1|  |        Trigger parameter declarations
  2379. ENG|021105      |     3|  |    Parameters  of  a  trigger  have  to  be  declared  like  those of a DB
  2380. ENG|021105      |     4| I|    procedure according to ##021102mode and ##021102data^type. The parameter  names  cannot
  2381. ENG|021105      |     5|  |    be  chosen  at  random, but have to match the column names of the table
  2382. ENG|021105      |     6|  |    for which the trigger is to be defined. Parameters may be  additionally
  2383. ENG|021105      |     7|  |    qualified  by  the  prefixes  "NEW." and "OLD." to access new ( INSERT,
  2384. ENG|021105      |     8|  |    UPDATE ) or old column values ( DELETE, UPDATE ), respectivly.
  2385. ENG|021105      |     9|  |    Beispiel :
  2386. ENG|021105      |    11|  |
  2387. ENG|021105      |    12| E|          TRIGGER catalog.change_price (
  2388. ENG|021105      |    13| E|            IN  OLD.price FIXED ( 10, 3 ),
  2389. ENG|021105      |    14| E|            IN  NEW.price FIXED ( 10, 3 ) );
  2390. ENG|021105      |    16| E|          IF NEW.price > ( OLD.price * 1.1 )
  2391. ENG|021105      |    17|SE|          THEN
  2392. ENG|021105      |    19| E|              STOP ( -999, 'Price increase of more than 10 % not allowed' );
  2393. ENG|021105      |    20|RE|    E$}
  2394.