Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ () — Sybase DB Library C 4.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

  1                       Version 4.0 -- 5/1/89                 dbsetopt
  ______________________________________________________________________

  NAME:  dbsetopt

  FUNCTION:
       Set a SQL Server or DB-Library option.

  SYNTAX:
       RETCODE dbsetopt(dbproc, option, param)

       DBPROCESS *dbproc;
       int       option;
       char      *param;








  dbsetopt                Version 4.0 -- 5/1/89                        2
  ______________________________________________________________________

  COMMENTS:

       o This routine sets SQL Server and DB-Library options.   Although
         SQL Server options may be set and cleared directly through SQL,
         the application should instead use dbsetopt() and dbclropt() to
         set  and  clear options.  This provides a uniform interface for
         setting both SQL Server and DB-Library options.  It also allows
         the  application  to  use  the  dbisopt() function to check the
         status of an option.
       o dbsetopt() does not immediately set the option.  The option  is
         set  the  next  time a command buffer is sent to the SQL Server
         (by invoking dbsqlexec() or dbsqlsend()).

       o For a list of each option  and  its  default  status,  see  the
         manual page for options.




  3                       Version 4.0 -- 5/1/89                 dbsetopt
  ______________________________________________________________________

  PARAMETERS:
       dbproc -  A pointer to the DBPROCESS structure that provides  the
           connection for a particular front-end/SQL Server process.  It
           contains all the information that DB-Library uses  to  manage
           communications and data between the front end and SQL Server.
           If dbproc is NULL, the option will  be  set  for  all  active
           DBPROCESS structures.
       option -  The option that is to be turned on.   See  the  options
           manual page for the list of options.
       param -  Certain  options  take  parameters.   For  example,  the
           DBOFFSET  option  takes  as  its  parameter the construct for
           which offsets are to be returned:

                dbsetopt(dbproc, DBOFFSET, "compute")

           The DBBUFFER option takes as its parameter the number of rows



  dbsetopt                Version 4.0 -- 5/1/89                        4
  ______________________________________________________________________
           to be buffered:

                dbsetopt(dbproc, DBBUFFER, "500")

           param must always be a character string enclosed  in  quotes,
           even in the case of a numeric value, as in the DBBUFFER exam-
           ple.

           If  an  invalid  parameter  is  specified  for  one  of   the
           SQL Server  options,  this will be discovered the next time a
           command buffer is sent to the SQL Server.  The dbsqlexec() or
           dbsqlsend()  call  will  fail, and DB-Library will invoke the
           user-installed message handler.  If an invalid  parameter  is
           specified  for  one  of  the  DB-Library options (DBBUFFER or
           DBTEXTLIMIT), the dbsetopt() call itself will fail.
           If the option takes no parameters, param must be NULL.




  5                       Version 4.0 -- 5/1/89                 dbsetopt
  ______________________________________________________________________

  RETURNS:
       SUCCEED or FAIL.

       As mentioned above, dbsetopt() will fail if param is invalid  for
       one  of  the DB-Library options.  However, an invalid param for a
       SQL Server option will not cause dbsetopt() to fail, because such
       a  parameter  does  not get validated until the command buffer is
       sent to the SQL Server.

  SEE ALSO:
       dbclropt, dbisopt, options







Typewritten Software • bear@typewritten.org • Edmonds, WA 98026