Syntax for strings in ij commands
Derby Tools and Utilities Guide
55
An identifier can optionally use an at sign (
@
) followed by a connectionName. Spaces on
either side of the
@
sign are optional. If you specify a connectionName, you can refer to
databases on different connections. This capability enables you to perform tasks such
as copying data from one database to another. For an example of copying data between
databases, see
. For other examples, see
,
, and
These identifiers exist within the scope of
ij
only and are distinct from any identifiers
used in SQL commands, except in the case of the
command specifies a cursor name to use in creating a result set.
ij
does not recognize or permit delimited identifiers in
ij
commands. They can be used
in SQL commands.
Example
These are valid ij identifiers:
foo1
exampleIdentifier12345
another_one
myId@connection0
id2 @ connection1
Syntax for strings in ij commands
Syntax
'Text'
Description
Some
ij
commands require strings.
ij
strings are represented by the same literal
format as SQL strings and are delimited by single quotation marks. To include a single
quotation mark in a string, you must use two single quotation marks, as shown in
the examples below.
ij
places no limitation on the lengths of strings, and will treat
embedded new lines in the string as characters in the string.
Some
ij
commands execute SQL commands specified as strings. Therefore, you must
double any single quotation marks within such strings, as shown in the second example
below.
The cases of letters within a string are preserved.
Example
This is a string in ij And this is its value
'Mary''s umbrella' Mary's umbrella
'hello world' hello world
--returns Joe's
execute 'VALUES ''Joe''''s''';
ij errors
ij might issue messages to inform the user of errors during processing of statements.
ERROR SQLState
When the underlying JDBC driver returns an SQLException,
ij
displays the
SQLException message with the prefix "ERROR SQLState". If the SQLException has no
SQLState associated with it, the prefix "ERROR (no SQLState)" is used.