home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.3 (Developer) / NeXT_Developer-3.3.iso / usr / sybase / doc / dbsetnull.man < prev    next >
Encoding:
Text File  |  1993-04-22  |  4.0 KB  |  111 lines

  1.  
  2.   1                       Version 4.0 -- 5/1/89                dbsetnull
  3.   ______________________________________________________________________
  4.  
  5.   NAME:  dbsetnull
  6.  
  7.   FUNCTION:
  8.        Define substitution values to be used when binding null values.
  9.  
  10.   SYNTAX:
  11.        RETCODE dbsetnull(dbproc, bindtype, bindlen, bindval)
  12.  
  13.        DBPROCESS *dbproc;
  14.        int       bindtype;
  15.        int       bindlen;
  16.        BYTE      *bindval;
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.   dbsetnull               Version 4.0 -- 5/1/89                        2
  25.   ______________________________________________________________________
  26.  
  27.   COMMENTS:
  28.  
  29.        o The dbbind() and dbaltbind() routines bind result column values
  30.          to  program variables.  After the application calls them, calls
  31.          to dbnextrow() and dbgetrow() automatically copy result  values
  32.          into  the  variables  to  which  they are bound.  If SQL Server
  33.          returns a null value for one of the result columns,  DB-Library
  34.          automatically  places  a substitute value into the result vari-
  35.          able.
  36.        o Each DBPROCESS has a list of substitute values for each of  the
  37.          binding types.  The default substitution values are:
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.   3                       Version 4.0 -- 5/1/89                dbsetnull
  47.   ______________________________________________________________________
  48.               Binding Type      Null Substitution Value
  49.  
  50.               TINYBIND          0
  51.               SMALLBIND         0
  52.               INTBIND           0
  53.               CHARBIND          empty string (padded with blanks)
  54.               STRINGBIND        empty string (padded with blanks, null-terminated)
  55.               NTBSTRINGBIND     empty string (null-terminated)
  56.               VARYCHARBIND      empty string
  57.               BINARYBIND        empty array (padded with zeros)
  58.               VARYBINBIND       empty array
  59.               DATETIMEBIND      8 bytes of zeros
  60.               MONEYBIND         $0.00
  61.               FLT8BIND          0.0
  62.        o dbsetnull() lets you provide your own null substitution values.
  63.          When you call dbsetnull() to change a particular null substitu-
  64.          tion value,  the  new  value  will  remain  in  force  for  the
  65.  
  66.  
  67.  
  68.   dbsetnull               Version 4.0 -- 5/1/89                        4
  69.   ______________________________________________________________________
  70.          specified DBPROCESS until you change it with  another  call  to
  71.          dbsetnull().
  72.  
  73.        o The dbconvert() routine also uses the current null substitution
  74.          values when it needs to set a destination variable to null.
  75.  
  76.   PARAMETERS:
  77.        dbproc -  A pointer to the DBPROCESS structure that provides  the
  78.            connection for a particular front-end/SQL Server process.  It
  79.            contains all the information that DB-Library uses  to  manage
  80.            communications and data between the front end and SQL Server.
  81.        bindtype -  The type of variable binding to which the  substitute
  82.            value will apply.  (See the manual page for dbbind() for more
  83.            information about the different bindtypes.)
  84.        bindlen -  The length in bytes of the substitute  value  you  are
  85.            supplying.   DB-Library  ignores it in all cases except CHAR-
  86.            BIND and BINARYBIND.  All the other types  are  either  fixed
  87.            length  or  have  a special terminator or embedded byte-count
  88.  
  89.  
  90.   5                       Version 4.0 -- 5/1/89                dbsetnull
  91.   ______________________________________________________________________
  92.            that provides the length of the data.
  93.        bindval -  A generic BYTE pointer to the value you want to use as
  94.            a  null  substitution value.  dbsetnull() makes a copy of the
  95.            value, so you can free this pointer at any  time  after  this
  96.            call.
  97.  
  98.   RETURNS:
  99.        SUCCEED or FAIL. dbsetnull() returns FAIL if you give it an  unk-
  100.        nown  bindtype.   It will also fail if the specified DBPROCESS is
  101.        dead.
  102.  
  103.   SEE ALSO:
  104.        dbaltbind, dbbind, dbconvert, types
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.