File: lastval.sql

package info (click to toggle)
hsqldb1.8.0 1.8.0.10%2Bdfsg-10
  • links: PTS
  • area: main
  • in suites: buster
  • size: 13,432 kB
  • sloc: java: 75,802; xml: 11,392; sql: 1,556; sh: 847; makefile: 57
file content (42 lines) | stat: -rw-r--r-- 892 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
 * $Id: lastval.sql,v 1.1 2007/08/09 03:28:36 unsaved Exp $
 *
 * Tests auto-variable ?
 */

CREATE TABLE t (i INT);

* if (*? != 0)
    \p ? variable not capturing CREATE TABLE return value
* end if

INSERT INTO t values (21);
* if (*? != 1)
    \p ? variable not capturing INSERT return value
* end if

INSERT INTO t values (10);
* if (*? != 1)
    \p ? variable not capturing INSERT return value
* end if

INSERT INTO t values (43);
* if (*? != 1)
    \p ? variable not capturing INSERT return value
* end if

SELECT * FROM t ORDER BY i DESC;
* if (*? != 10)
    \p ? variable not capturing last fetched value
* end if

\p echo some stuff
\p to verify that ? variable value is preserved
* list

* if (*? != 10)
    \p ? value not retained after special commands
* end if
* if (*{?} != 10)
    \p ? value not dereferenced with {} usage
* end if