alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

HSQLDB example source code file (lastval.sql)

This example HSQLDB source code file (lastval.sql) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - HSQLDB tags/keywords

by, create, create, desc, from, insert, insert, int, into, into, order, select, table, table

The HSQLDB lastval.sql source code

/*
 * $Id: lastval.sql 196 2007-06-07 23:24:52Z unsaved $
 *
 * 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

Other HSQLDB examples (source code examples)

Here is a short list of links related to this HSQLDB lastval.sql source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.