v2026.6.4
All Bundles
Bundle ODBC database access layer. Connection manages database sessions; Statement and ParameterStatement execute SQL queries; ResultSet iterates over rows and extracts typed column values. Compile with -lib odbc.

ParameterStatement

ODBC parametrized statement that supports SQL variables

Operations

Close #

Closes the statement

method : public : Close() ~ Nil

GetLastError #

Gets the last error message from the statement.

method : public : GetLastError() ~ String

Return

TypeDescription
Stringerror message string, or empty if no error

Select #

Executes a SQL select statement

method : public : Select() ~ ResultSet

Return

TypeDescription
ResultSetresult set

Example

conn := Database.ODBC.Connection->New("mydsn", "user", "pass");
stmt := conn->CreateParameterStatement("SELECT name FROM users WHERE age > ?");
stmt->SetInt(1, 25);
rs := stmt->Select(); # execute prepared select
while(rs->Next()) { rs->GetVarchar("name")->PrintLine(); };
rs->Close();
conn->Close();

SetBigInt #

Sets a big integer type to NULL

method : public : SetBigInt(pos:Int) ~ Bool

Parameters

NameTypeDescription
posIntparameter position

Return

TypeDescription
Booltrue if set, false otherwise

SetBigInt #

Sets a big integer type

method : public : SetBigInt(pos:Int, value:Int) ~ Bool

Parameters

NameTypeDescription
posIntparameter position
valueIntbig integer value

Return

TypeDescription
Booltrue if set, false otherwise

SetBit #

Sets a bit type to NULL

method : public : SetBit(pos:Int) ~ Bool

Parameters

NameTypeDescription
posIntparameter position

Return

TypeDescription
Booltrue if set, false otherwise

SetBit #

Sets a bit type

method : public : SetBit(pos:Int, value:Bool) ~ Bool

Parameters

NameTypeDescription
posIntparameter position
valueBoolbit value

Return

TypeDescription
Booltrue if set, false otherwise

SetBlob #

Sets a blob type to NULL

method : public : SetBlob(pos:Int) ~ Bool

Parameters

NameTypeDescription
posIntparameter position

Return

TypeDescription
Booltrue if set, false otherwise

SetBlob #

Sets a blob type

method : public : SetBlob(pos:Int, buffer:Byte[]) ~ Bool

Parameters

NameTypeDescription
posIntparameter position
bufferBytebyte buffer

Return

TypeDescription
Booltrue if set, false otherwise

SetBytes #

Sets a stream of bytes

method : public : SetBytes(pos:Int, buffer:Byte[], length:Int) ~ Bool

Parameters

NameTypeDescription
posIntparameter position
bufferBytebyte buffer
lengthIntnumber of bytes to write

Return

TypeDescription
Booltrue if set, false otherwise

SetDate #

Sets a date type to NULL

method : public : SetDate(pos:Int) ~ Bool

Parameters

NameTypeDescription
posIntparameter position

Return

TypeDescription
Booltrue if set, false otherwise

SetDate #

Sets a date type

method : public : SetDate(pos:Int, value:Date) ~ Bool

Parameters

NameTypeDescription
posIntparameter position
valueDatedate value

Return

TypeDescription
Booltrue if set, false otherwise

SetDouble #

Sets a double type to NULL

method : public : SetDouble(pos:Int) ~ Bool

Parameters

NameTypeDescription
posIntparameter position

Return

TypeDescription
Booltrue if set, false otherwise

SetDouble #

Sets a double type

method : public : SetDouble(pos:Int, value:Float) ~ Bool

Parameters

NameTypeDescription
posIntparameter position
valueFloatdouble value

Return

TypeDescription
Booltrue if set, false otherwise

SetInt #

Sets a integer type to NULL

method : public : SetInt(pos:Int) ~ Bool

Parameters

NameTypeDescription
posIntparameter position

Return

TypeDescription
Booltrue if set, false otherwise

SetInt #

Sets a integer type

method : public : SetInt(pos:Int, value:Int) ~ Bool

Parameters

NameTypeDescription
posIntparameter position
valueIntinteger value to set

Return

TypeDescription
Booltrue if set, false otherwise

SetReal #

Sets a real type to NULL

method : public : SetReal(pos:Int) ~ Bool

Parameters

NameTypeDescription
posIntparameter position

Return

TypeDescription
Booltrue if set, false otherwise

SetReal #

Sets a real type

method : public : SetReal(pos:Int, value:Float) ~ Bool

Parameters

NameTypeDescription
posIntparameter position
valueFloatreal value

Return

TypeDescription
Booltrue if set, false otherwise

SetSmallInt #

Sets a small integer type to NULL

method : public : SetSmallInt(pos:Int) ~ Bool

Parameters

NameTypeDescription
posIntparameter position

Return

TypeDescription
Booltrue if set, false otherwise

SetSmallInt #

Sets a small integer type

method : public : SetSmallInt(pos:Int, value:Int) ~ Bool

Parameters

NameTypeDescription
posIntparameter position
valueIntsmall integer value

Return

TypeDescription
Booltrue if set, false otherwise

SetTimestamp #

Sets a timestamp type to NULL

method : public : SetTimestamp(pos:Int) ~ Bool

Parameters

NameTypeDescription
posIntparameter position

Return

TypeDescription
Booltrue if set, false otherwise

SetTimestamp #

Sets a timestamp type

method : public : SetTimestamp(pos:Int, value:Timestamp) ~ Bool

Parameters

NameTypeDescription
posIntparameter position
valueTimestamptimestamp value

Return

TypeDescription
Booltrue if set, false otherwise

SetVarchar #

Sets varchar type to NULL

method : public : SetVarchar(pos:Int) ~ Bool

Parameters

NameTypeDescription
posIntparameter position

Return

TypeDescription
Booltrue if set, false otherwise

SetVarchar #

Sets varchar type

method : public : SetVarchar(pos:Int, value:String) ~ Bool

Parameters

NameTypeDescription
posIntparameter position
valueStringstring value

Return

TypeDescription
Booltrue if set, false otherwise

Example

conn := Database.ODBC.Connection->New("mydsn", "user", "pass");
stmt := conn->CreateParameterStatement("INSERT INTO users(name) VALUES(?)");
stmt->SetVarchar(1, "Bob"); # bind string to first parameter
stmt->Update();
conn->Close();

Update #

Executes a SQL update statement. Statement is closed after calling.

method : public : Update() ~ Int

Return

TypeDescription
Intresult code

Example

conn := Database.ODBC.Connection->New("mydsn", "user", "pass");
stmt := conn->CreateParameterStatement("UPDATE users SET age=? WHERE name=?");
stmt->SetInt(1, 31);
stmt->SetVarchar(2, "Alice");
rc := stmt->Update(); # execute and close statement
"rows={$rc}"->PrintLine();
conn->Close();