User Tools

Site Tools


reference:statement

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
reference:statement [2007/01/23 15:58] – external edit 127.0.0.1reference:statement [2023/06/20 13:51] (current) – external edit 127.0.0.1
Line 130: Line 130:
 ===== Methods (setting parameters) ===== ===== Methods (setting parameters) =====
  
-==== bool Set(''type'') ====+==== bool Set(int ''pos'', ''type'') ====
  
 There is a whole collection of these Set methods, one for each type supported by IBPP. You should read the article on [[conversions|type conversions]] to discover what type in your C++ code is compatible with what SQL type. There is a whole collection of these Set methods, one for each type supported by IBPP. You should read the article on [[conversions|type conversions]] to discover what type in your C++ code is compatible with what SQL type.
 +
 +''pos'' is the integer position, counted from 1, of the parameter to set.
  
 ''type'' can be any of: bool, std::string, int16_t, int32_t, int64_t, float, double, [[Timestamp]], [[Date]], [[Time]], [[DBKey]], [[Blob]], [[Array]]. ''type'' can be any of: bool, std::string, int16_t, int32_t, int64_t, float, double, [[Timestamp]], [[Date]], [[Time]], [[DBKey]], [[Blob]], [[Array]].
Line 144: Line 146:
 </code> </code>
  
-You might wonder why IBPP will agree to set any parameter to SQL NULL (through ''SetNull()'') even though the column eventually corresponding to an input parameter is defined NOT NULL?  Well, because of triggers.  A trigger might be ready to accept a NULL for a NOT NULL column, turning it to some NON NULL value before the actuel INSERT or UPDATE (for instance) happens.  //Note that this is a new, more correct behaviour, starting with version 2.5 or IBPP.//+You might wonder why IBPP will agree to set any parameter to SQL NULL (through ''SetNull()'') even though the column eventually corresponding to an input parameter is defined NOT NULL?  Well, because of triggers.  A trigger might be ready to accept a NULL for a NOT NULL column, turning it to some NON NULL value before the actuel INSERT or UPDATE (for instance) happens.  //Note that this is a new, more correct behaviour, starting with IBPP version 2.5.//
  
 ==== SDT ParameterType(int) ==== ==== SDT ParameterType(int) ====
reference/statement.1169567924.txt.gz · Last modified: 2023/06/20 09:21 (external edit)