Declare



DECLARE sets a variable to the value of an expression. The variable can then be used, with its @ prefix, in the statements that follow it in the same script.

round-pushpin Declares a number and uses it in a WHERE clause.
DECLARE @Language = 2
SELECT Text FROM WordList:Word WHERE LanguageId = @Language

round-pushpin Declares the result of an expression.
DECLARE @Pattern = 'Cat' + '%'
SELECT Text FROM WordList:Word WHERE Text LIKE @Pattern

round-pushpin Uses a variable in the field list.
DECLARE @Greeting = 'Hello'
SELECT @Greeting + ' ' + Text as Message FROM WordList:Word WHERE Id = 1

Client parameters

Parameters passed by an application through the client API are used the same way, for example WHERE Name = @Name. See Client.




API :: Client
Using the NTDLS.Katzebase.Api client library from .NET.
Home
The home page
SQL :: Attach Schema
Copies a detached schema (namespace) into the database.
SQL :: Detach Schema
Removes a schema (namespace) from the database and moves its files to a folder.
SQL :: DocumentID
Removed: The DocumentID() function is no longer available.
SQL :: DocumentUID
Removed: The DocumentUID() function is no longer available.
SQL :: Expressions
Literals, operators, comments and variables in KBSQL.
SQL :: Insert
Insert creates new documents in a schema.
SQL :: Keywords
A breakdown of all of the statements and keywords supported by the query processor.
SQL :: ReadUncommitted
Reads without waiting for other transactions' locks.