with CommonText;
with Spatial_Data;
with Ada.Calendar.Formatting;
with Ada.Strings.Wide_Unbounded;
with Ada.Strings.Wide_Wide_Unbounded;
with Ada.Strings.UTF_Encoding;

package AdaBase.Results is

   package CT   renames CommonText;
   package AC   renames Ada.Calendar;
   package ACF  renames Ada.Calendar.Formatting;
   package SUW  renames Ada.Strings.Wide_Unbounded;
   package SUWW renames Ada.Strings.Wide_Wide_Unbounded;
   package SUTF renames Ada.Strings.UTF_Encoding;
   package SPAT  renames Spatial_Data;

   subtype Textual   is CT.Text;
   subtype Textwide  is SUW.Unbounded_Wide_String;
   subtype Textsuper is SUWW.Unbounded_Wide_Wide_String;
   subtype Text_UTF8 is SUTF.UTF_8_String;

   -------------------------------------------
   --  Supported Field Types (Standardized) --
   -------------------------------------------

   type Bit1   is mod 2 ** 1;
   type NByte1 is mod 2 ** 8;
   type NByte2 is mod 2 ** 16;
   type NByte3 is mod 2 ** 24;
   type NByte4 is mod 2 ** 32;
   type NByte8 is mod 2 ** 64;
   type Byte8  is range -2 ** 63 .. 2 ** 63 - 1;
   type Byte4  is range -2 ** 31 .. 2 ** 31 - 1;
   type Byte3  is range -2 ** 23 .. 2 ** 23 - 1;
   type Byte2  is range -2 ** 15 .. 2 ** 15 - 1;
   type Byte1  is range -2 **  7 .. 2 **  7 - 1;
   type Real9  is digits 9;
   type Real18 is digits 18;

   subtype NByte0 is Boolean;

   type Enumtype is record enumeration : Textual; end record;
   type Settype is array (Positive range <>) of Enumtype;
   type Chain   is array (Positive range <>) of NByte1;
   type Bits    is array (Natural range <>)  of Bit1;

   type NByte0_Access   is access all NByte0;
   type NByte1_Access   is access all NByte1;
   type NByte2_Access   is access all NByte2;
   type NByte3_Access   is access all NByte3;
   type NByte4_Access   is access all NByte4;
   type NByte8_Access   is access all NByte8;
   type Byte1_Access    is access all Byte1;
   type Byte2_Access    is access all Byte2;
   type Byte3_Access    is access all Byte3;
   type Byte4_Access    is access all Byte4;
   type Byte8_Access    is access all Byte8;
   type Real9_Access    is access all Real9;
   type Real18_Access   is access all Real18;
   type Str1_Access     is access all Textual;
   type Str2_Access     is access all Textwide;
   type Str4_Access     is access all Textsuper;
   type Time_Access     is access all AC.Time;
   type Chain_Access    is access all Chain;
   type Enum_Access     is access all Enumtype;
   type Settype_Access  is access all Settype;
   type Geometry_Access is access all SPAT.Geometry;
   type Bits_Access     is access all Bits;
   type S_UTF8_Access   is access all Text_UTF8;

end AdaBase.Results;

This page documents 88 overloaded assign functions, four for each standard data type. These functions bind to the markers of a previously prepared statement.

The first 22 functions reference the marker by its numeric index starting from 1 and bind the marker to a variable matching the data type of the marker. The next 22 functions do the same thing except they reference the marker by its name, which requires the use of named parameters instead of question marks. The values of the variables involved in these 44 functions are not evaluated until the execute command is issued.

The next 22 functions reference the marker by its numeric index and define its value with a constant of the same data type of the marker. The final 22 functions are similar, but reference the marker by their names.

Boolean function
AdaBase.Statement.Base.[STMT].assign (index : Positive; vaxx : AR.NByte0_Access)

Boolean function
AdaBase.Statement.Base.[STMT].assign (index : Positive; vaxx : AR.NByte1_Access)

Boolean function
AdaBase.Statement.Base.[STMT].assign (index : Positive; vaxx : AR.NByte2_Access)

Boolean function
AdaBase.Statement.Base.[STMT].assign (index : Positive; vaxx : AR.NByte3_Access)

Boolean function
AdaBase.Statement.Base.[STMT].assign (index : Positive; vaxx : AR.NByte4_Access)

Boolean function
AdaBase.Statement.Base.[STMT].assign (index : Positive; vaxx : AR.NByte8_Access)

Boolean function
AdaBase.Statement.Base.[STMT].assign (index : Positive; vaxx : AR.Byte1_Access)

Boolean function
AdaBase.Statement.Base.[STMT].assign (index : Positive; vaxx : AR.Byte2_Access)

Boolean function
AdaBase.Statement.Base.[STMT].assign (index : Positive; vaxx : AR.Byte3_Access)

Boolean function
AdaBase.Statement.Base.[STMT].assign (index : Positive; vaxx : AR.Byte4_Access)

Boolean function
AdaBase.Statement.Base.[STMT].assign (index : Positive; vaxx : AR.Byte8_Access)

Boolean function
AdaBase.Statement.Base.[STMT].assign (index : Positive; vaxx : AR.Real9_Access)

Boolean function
AdaBase.Statement.Base.[STMT].assign (index : Positive; vaxx : AR.Real18_Access)

Boolean function
AdaBase.Statement.Base.[STMT].assign (index : Positive; vaxx : AR.Str1_Access)

Boolean function
AdaBase.Statement.Base.[STMT].assign (index : Positive; vaxx : AR.Str2_Access)

Boolean function
AdaBase.Statement.Base.[STMT].assign (index : Positive; vaxx : AR.Str4_Access)

Boolean function
AdaBase.Statement.Base.[STMT].assign (index : Positive; vaxx : AR.Time_Access)

Boolean function
AdaBase.Statement.Base.[STMT].assign (index : Positive; vaxx : AR.Chain_Access)

Boolean function
AdaBase.Statement.Base.[STMT].assign (index : Positive; vaxx : AR.Enum_Access)

Boolean function
AdaBase.Statement.Base.[STMT].assign (index : Positive; vaxx : AR.Settype_Access)

Boolean function
AdaBase.Statement.Base.[STMT].assign (index : Positive; vaxx : AR.Bits_Access)

Boolean function
AdaBase.Statement.Base.[STMT].assign (index : Positive; vaxx : AR.S_UTF8_Access)

Prior to issuing the execute command of the statement object, the values of the markers must be defined. One method is to pass access to a variable of the same type as the marker. The first 22 of the 88 overloaded bind functions accept an index starting with 1 that matches the column number of the result row. The vaxx argument accepts a pointer to one of the 22 native data type. If the access type assigned to vaxx is set to null, the driver will attempt to set the parameter to NULL, e.g. insert NULL into a record's field rather than a value.

Once a variable is assigned, the user can change the values of the variables before each prepared statement execution; no further assignments are necessary past the first time. Depending on the scope of the bound variables, the Unchecked_Access attribute may be required over the safer Access to avoid a "non-local pointer cannot point to local object" error.

Boolean function
AdaBase.Statement.Base.[STMT].assign (moniker : String; vaxx : AR.NByte0_Access)

Boolean function
AdaBase.Statement.Base.[STMT].assign (moniker : String; vaxx : AR.NByte1_Access)

Boolean function
AdaBase.Statement.Base.[STMT].assign (moniker : String; vaxx : AR.NByte2_Access)

Boolean function
AdaBase.Statement.Base.[STMT].assign (moniker : String; vaxx : AR.NByte3_Access)

Boolean function
AdaBase.Statement.Base.[STMT].assign (moniker : String; vaxx : AR.NByte4_Access)

Boolean function
AdaBase.Statement.Base.[STMT].assign (moniker : String; vaxx : AR.NByte8_Access)

Boolean function
AdaBase.Statement.Base.[STMT].assign (moniker : String; vaxx : AR.Byte1_Access)

Boolean function
AdaBase.Statement.Base.[STMT].assign (moniker : String; vaxx : AR.Byte2_Access)

Boolean function
AdaBase.Statement.Base.[STMT].assign (moniker : String; vaxx : AR.Byte3_Access)

Boolean function
AdaBase.Statement.Base.[STMT].assign (moniker : String; vaxx : AR.Byte4_Access)

Boolean function
AdaBase.Statement.Base.[STMT].assign (moniker : String; vaxx : AR.Byte8_Access)

Boolean function
AdaBase.Statement.Base.[STMT].assign (moniker : String; vaxx : AR.Real9_Access)

Boolean function
AdaBase.Statement.Base.[STMT].assign (moniker : String; vaxx : AR.Real18_Access)

Boolean function
AdaBase.Statement.Base.[STMT].assign (moniker : String; vaxx : AR.Str1_Access)

Boolean function
AdaBase.Statement.Base.[STMT].assign (moniker : String; vaxx : AR.Str2_Access)

Boolean function
AdaBase.Statement.Base.[STMT].assign (moniker : String; vaxx : AR.Str4_Access)

Boolean function
AdaBase.Statement.Base.[STMT].assign (moniker : String; vaxx : AR.Time_Access)

Boolean function
AdaBase.Statement.Base.[STMT].assign (moniker : String; vaxx : AR.Chain_Access)

Boolean function
AdaBase.Statement.Base.[STMT].assign (moniker : String; vaxx : AR.Enum_Access)

Boolean function
AdaBase.Statement.Base.[STMT].assign (moniker : String; vaxx : AR.Settype_Access)

Boolean function
AdaBase.Statement.Base.[STMT].assign (moniker : String; vaxx : AR.Bits_Access)

Boolean function
AdaBase.Statement.Base.[STMT].assign (moniker : String; vaxx : AR.S_UTF8_Access)

The next set of 22 functions are similar, but rather than referring to the marker position with a numeric index, it accepts a String which must match of the name of the parameter defined in the original SQL string. For example, if the SQL given to the prepare function is "SELECT ALL * FROM fruits WHERE color = :color", the name of the marker is "color". It can be referred to by an index of 1 or its moniker "color".

Boolean function
AdaBase.Statement.Base.[STMT].assign (index : Positive; vaxx : AR.NByte0)

Boolean function
AdaBase.Statement.Base.[STMT].assign (index : Positive; vaxx : AR.NByte1)

Boolean function
AdaBase.Statement.Base.[STMT].assign (index : Positive; vaxx : AR.NByte2)

Boolean function
AdaBase.Statement.Base.[STMT].assign (index : Positive; vaxx : AR.NByte3)

Boolean function
AdaBase.Statement.Base.[STMT].assign (index : Positive; vaxx : AR.NByte4)

Boolean function
AdaBase.Statement.Base.[STMT].assign (index : Positive; vaxx : AR.NByte8)

Boolean function
AdaBase.Statement.Base.[STMT].assign (index : Positive; vaxx : AR.Byte1)

Boolean function
AdaBase.Statement.Base.[STMT].assign (index : Positive; vaxx : AR.Byte2)

Boolean function
AdaBase.Statement.Base.[STMT].assign (index : Positive; vaxx : AR.Byte3)

Boolean function
AdaBase.Statement.Base.[STMT].assign (index : Positive; vaxx : AR.Byte4)

Boolean function
AdaBase.Statement.Base.[STMT].assign (index : Positive; vaxx : AR.Byte8)

Boolean function
AdaBase.Statement.Base.[STMT].assign (index : Positive; vaxx : AR.Real9)

Boolean function
AdaBase.Statement.Base.[STMT].assign (index : Positive; vaxx : AR.Real18)

Boolean function
AdaBase.Statement.Base.[STMT].assign (index : Positive; vaxx : AR.Textual)

Boolean function
AdaBase.Statement.Base.[STMT].assign (index : Positive; vaxx : AR.Textwide)

Boolean function
AdaBase.Statement.Base.[STMT].assign (index : Positive; vaxx : AR.Textsuper)

Boolean function
AdaBase.Statement.Base.[STMT].assign (index : Positive; vaxx : CAL.Time)

Boolean function
AdaBase.Statement.Base.[STMT].assign (index : Positive; vaxx : AR.Chain)

Boolean function
AdaBase.Statement.Base.[STMT].assign (index : Positive; vaxx : AR.Enum)

Boolean function
AdaBase.Statement.Base.[STMT].assign (index : Positive; vaxx : AR.Settype)

Boolean function
AdaBase.Statement.Base.[STMT].assign (index : Positive; vaxx : AR.Bits)

Boolean function
AdaBase.Statement.Base.[STMT].assign (index : Positive; vaxx : AR.Text_UTF8)

These 22 functions assign values immediately to markers referenced by their numeric index.

Boolean function
AdaBase.Statement.Base.[STMT].assign (moniker : String; vaxx : AR.NByte0)

Boolean function
AdaBase.Statement.Base.[STMT].assign (moniker : String; vaxx : AR.NByte1)

Boolean function
AdaBase.Statement.Base.[STMT].assign (moniker : String; vaxx : AR.NByte2)

Boolean function
AdaBase.Statement.Base.[STMT].assign (moniker : String; vaxx : AR.NByte3)

Boolean function
AdaBase.Statement.Base.[STMT].assign (moniker : String; vaxx : AR.NByte4)

Boolean function
AdaBase.Statement.Base.[STMT].assign (moniker : String; vaxx : AR.NByte8)

Boolean function
AdaBase.Statement.Base.[STMT].assign (moniker : String; vaxx : AR.Byte1)

Boolean function
AdaBase.Statement.Base.[STMT].assign (moniker : String; vaxx : AR.Byte2)

Boolean function
AdaBase.Statement.Base.[STMT].assign (moniker : String; vaxx : AR.Byte3)

Boolean function
AdaBase.Statement.Base.[STMT].assign (moniker : String; vaxx : AR.Byte4)

Boolean function
AdaBase.Statement.Base.[STMT].assign (moniker : String; vaxx : AR.Byte8)

Boolean function
AdaBase.Statement.Base.[STMT].assign (moniker : String; vaxx : AR.Real9)

Boolean function
AdaBase.Statement.Base.[STMT].assign (moniker : String; vaxx : AR.Real18)

Boolean function
AdaBase.Statement.Base.[STMT].assign (moniker : String; vaxx : AR.Textual)

Boolean function
AdaBase.Statement.Base.[STMT].assign (moniker : String; vaxx : AR.Textwide)

Boolean function
AdaBase.Statement.Base.[STMT].assign (moniker : String; vaxx : AR.Textsuper)

Boolean function
AdaBase.Statement.Base.[STMT].assign (moniker : String; vaxx : CAL.Time)

Boolean function
AdaBase.Statement.Base.[STMT].assign (moniker : String; vaxx : AR.Chain)

Boolean function
AdaBase.Statement.Base.[STMT].assign (moniker : String; vaxx : AR.Enum)

Boolean function
AdaBase.Statement.Base.[STMT].assign (moniker : String; vaxx : AR.Settype)

Boolean function
AdaBase.Statement.Base.[STMT].assign (moniker : String; vaxx : AR.Bits)

Boolean function
AdaBase.Statement.Base.[STMT].assign (moniker : String; vaxx : AR.S_UTF8_Access)

These 22 functions assign values immediately to markers referenced by their names.


See prepare select and stmt iterate (x2) for a usage examples.


[STMT] is "MySQL.MySQL_statement", "PostgreSQL.PostgreSQL_statement", or "SQLite.SQLite_statement"

See Also