edit.h
/* Free ISQL - An isql for DB-Library (C) 2007 Nicholas S. Castellano
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/* $Id: edit.h,v 1.3 2007-01-20 06:32:27 castellano Exp $ */
int edit(const char *editor, const char *arg);
rtrim
static int rtrim(char *, int)
trim a string of trailing blanks
Definition: bcp.c:2323
pd
Definition: datacopy.c:62
dbretlen
int dbretlen(DBPROCESS *dbproc, int retnum)
Get size of an output parameter filled by a stored procedure.
Definition: dblib.c:4800
OBJECTINFO
Definition: datacopy.c:53
dbclose
void dbclose(DBPROCESS *dbproc)
Close a connection to the server and free associated resources.
Definition: dblib.c:1485
dbsetopt
RETCODE dbsetopt(DBPROCESS *dbproc, int option, const char *char_param, int int_param)
Set db-lib or server option.
Definition: dblib.c:4492
dbnumrets
int dbnumrets(DBPROCESS *dbproc)
Get count of output parameters filled by a stored procedure.
Definition: dblib.c:4713
dbnumcompute
int dbnumcompute(DBPROCESS *dbproc)
Get count of COMPUTE clauses for a result set.
Definition: dblib.c:4994
dbbylist
BYTE * dbbylist(DBPROCESS *dbproc, int computeid, int *size)
Get bylist for a compute row.
Definition: dblib.c:5020
dbnullbind
RETCODE dbnullbind(DBPROCESS *dbproc, int column, DBINT *indicator)
Tie a null-indicator to a regular result column.
Definition: dblib.c:2740
dbcolsource
char * dbcolsource(DBPROCESS *dbproc, int column)
Get base database column name for a result set column.
Definition: dblib.c:3144
dbexit
void dbexit()
Close server connections and free all related structures.
Definition: dblib.c:1552
bcp_init
RETCODE bcp_init(DBPROCESS *dbproc, const char *tblname, const char *hfile, const char *errfile, int direction)
Prepare for bulk copy operation on a table.
Definition: bcp.c:167
METACOMP
Definition: bsqldb.c:75
dbaltbind
RETCODE dbaltbind(DBPROCESS *dbproc, int computeid, int column, int vartype, DBINT varlen, BYTE *varaddr)
Bind a compute column to a program variable.
Definition: dblib.c:4390
DBSETLPACKET
#define DBSETLPACKET(x, y)
Set the packet size in the login packet for new connections.
Definition: sybdb.h:1278
dbaltcolid
int dbaltcolid(DBPROCESS *dbproc, int computeid, int column)
Get column ID of a compute column.
Definition: dblib.c:4305
LOGINREC
Definition: bsqlodbc.c:100
DBSETLUSER
#define DBSETLUSER(x, y)
Set the username in the login packet.
Definition: sybdb.h:1251
dbsqlsend
RETCODE dbsqlsend(DBPROCESS *dbproc)
Transmit the command buffer to the server.
Definition: dblib.c:7064
dberrhandle
EHANDLEFUNC dberrhandle(EHANDLEFUNC handler)
Set an error handler, for messages from db-lib.
Definition: dblib.c:5142
_options
Definition: bsqldb.c:86
bcp_collen
RETCODE bcp_collen(DBPROCESS *dbproc, DBINT varlen, int table_column)
Set the length of a host variable to be written to a table.
Definition: bcp.c:267
DATA
Definition: bsqldb.c:74
dbrettype
int dbrettype(DBPROCESS *dbproc, int retnum)
Get datatype of a stored procedure's return parameter.
Definition: dblib.c:6287
dbresults
RETCODE dbresults(DBPROCESS *dbproc)
Set up query results.
Definition: dblib.c:1694
dbalttype
int dbalttype(DBPROCESS *dbproc, int computeid, int column)
Get datatype for a compute column.
Definition: dblib.c:4361
bcp_control
RETCODE bcp_control(DBPROCESS *dbproc, int field, DBINT value)
Set BCP options for uploading a datafile.
Definition: bcp.c:544
dbretname
char * dbretname(DBPROCESS *dbproc, int retnum)
Get name of an output parameter filled by a stored procedure.
Definition: dblib.c:4745
dbvarylen
DBINT dbvarylen(DBPROCESS *dbproc, int column)
Determine whether a column can vary in size.
Definition: dblib.c:3218
KEY_T
Definition: bsqldb.c:80
dbretstatus
DBINT dbretstatus(DBPROCESS *dbproc)
Fetch status value returned by query or remote procedure call.
Definition: dblib.c:4695
BCP_SETL
#define BCP_SETL(x, y)
Enable (or prevent) bcp operations for connections made with a login.
Definition: sybdb.h:1264
dbcmd
RETCODE dbcmd(DBPROCESS *dbproc, const char cmdstring[])
Append SQL to the command buffer.
Definition: dblib.c:1373
dbpivot
RETCODE dbpivot(DBPROCESS *dbproc, int nkeys, int *keys, int ncols, int *cols, DBPIVOT_FUNC func, int val)
Pivot the rows, creating a new resultset.
Definition: dbpivot.c:914
dbprtype
const char * dbprtype(int token)
Print a token value's name to a buffer.
Definition: dblib.c:6468
dbbind
RETCODE dbbind(DBPROCESS *dbproc, int column, int vartype, DBINT varlen, BYTE *varaddr)
Tie a host variable to a resultset column.
Definition: dblib.c:2634
DBTDS
#define DBTDS(a)
Sybase macro, maps to the internal (lower-case) function.
Definition: sybdb.h:1228
dbsqlok
RETCODE dbsqlok(DBPROCESS *dbproc)
Wait for results of a query from the server.
Definition: dblib.c:4835
dbopen
DBPROCESS * dbopen(LOGINREC *login, const char *server)
Normally not used.
Definition: dbopen.c:36
bcp_done
DBINT bcp_done(DBPROCESS *dbproc)
Conclude the transfer of data from program variables.
Definition: bcp.c:2037
dbcoltype
int dbcoltype(DBPROCESS *dbproc, int column)
Get the datatype of a regular result set column.
Definition: dblib.c:2970
dbdatlen
DBINT dbdatlen(DBPROCESS *dbproc, int column)
Get size of current row's data in a regular result column.
Definition: dblib.c:3324
dbhasretstat
DBBOOL dbhasretstat(DBPROCESS *dbproc)
Determine if query generated a return status number.
Definition: dblib.c:4671
dbtablecolinfo
RETCODE dbtablecolinfo(DBPROCESS *dbproc, DBINT column, DBCOL *pdbcol)
describe table column attributes with a single call (Freetds-only API function modelled on dbcolinfo)
Definition: dblib.c:6485
dbcollen
DBINT dbcollen(DBPROCESS *dbproc, int column)
Get size of a regular result column.
Definition: dblib.c:3169
dbmsghandle
MHANDLEFUNC dbmsghandle(MHANDLEFUNC handler)
Set a message handler, for messages from the server.
Definition: dblib.c:5161
dbinit
RETCODE dbinit(void)
Initialize db-lib.
Definition: dblib.c:660
dbsqlexec
RETCODE dbsqlexec(DBPROCESS *dbproc)
send the SQL command to the server and wait for an answer.
Definition: dblib.c:1419
bcp_colptr
RETCODE bcp_colptr(DBPROCESS *dbproc, BYTE *colptr, int table_column)
Override bcp_bind() by pointing to a different host variable.
Definition: bcp.c:671
sybdb.h
Primary include file for db-lib applications.
tdsdump_open
int tdsdump_open(const char *filename)
Create and truncate a human readable dump file for the TDS traffic.
Definition: log.c:131
dbname
char * dbname(DBPROCESS *dbproc)
Get name of current database.
Definition: dblib.c:7028
dbfcmd
RETCODE dbfcmd(DBPROCESS *dbproc, const char *fmt,...)
printf-like way to form SQL to send to the server.
Definition: dblib.c:1334
DBCOL2
Definition: sybdb.h:374
dbnumalts
int dbnumalts(DBPROCESS *dbproc, int computeid)
Get count of columns in a compute row.
Definition: dblib.c:4961
dbuse
RETCODE dbuse(DBPROCESS *dbproc, const char *name)
Change current database.
Definition: dblib.c:1445
DBCOUNT
#define DBCOUNT(x)
Sybase macro mapping to the Microsoft (lower-case) function.
Definition: sybdb.h:748
DBROWS
#define DBROWS(x)
Sybase macro mapping to the Microsoft (lower-case) function.
Definition: sybdb.h:876
DBSETLPWD
#define DBSETLPWD(x, y)
Set the password in the login packet.
Definition: sybdb.h:1254
dbcolname
char * dbcolname(DBPROCESS *dbproc, int column)
Return name of a regular result column.
Definition: dblib.c:1872
dbaltlen
DBINT dbaltlen(DBPROCESS *dbproc, int computeid, int column)
Get size of data in compute column.
Definition: dblib.c:7158
DBSETLHOST
#define DBSETLHOST(x, y)
Set the (client) host name in the login packet.
Definition: sybdb.h:1248
_options::pivot_t
Definition: bsqldb.c:99
dbretdata
BYTE * dbretdata(DBPROCESS *dbproc, int retnum)
Get value of an output parameter filled by a stored procedure.
Definition: dblib.c:4774
bcp_sendrow
RETCODE bcp_sendrow(DBPROCESS *dbproc)
Write data in host variables to the table.
Definition: bcp.c:1381
dbloginfree
void dbloginfree(LOGINREC *login)
free the LOGINREC
Definition: dblib.c:737
DBCOL
Definition: sybdb.h:355
tds_dblib_dbprocess
Definition: dblib.h:123
dbconvert
DBINT dbconvert(DBPROCESS *dbproc, int srctype, const BYTE *src, DBINT srclen, int desttype, BYTE *dest, DBINT destlen)
cf.
Definition: dblib.c:2593
dbnumcols
int dbnumcols(DBPROCESS *dbproc)
Return number of regular columns in a result set.
Definition: dblib.c:1848
DBSETLAPP
#define DBSETLAPP(x, y)
Set the (client) application name in the login packet.
Definition: sybdb.h:1261
METADATA
Definition: bsqldb.c:73
dbdata
BYTE * dbdata(DBPROCESS *dbproc, int column)
Get address of data in a regular result column.
Definition: dblib.c:3352
_procedure
Definition: defncopy.c:120
dbstrlen
int dbstrlen(DBPROCESS *dbproc)
Get size of the command buffer, in bytes.
Definition: dblib.c:6312
bcp_batch
DBINT bcp_batch(DBPROCESS *dbproc)
Commit a set of rows to the table.
Definition: bcp.c:2010
dbfreebuf
void dbfreebuf(DBPROCESS *dbproc)
Erase the command buffer, in case DBNOAUTOFREE was set with dbsetopt().
Definition: dblib.c:6081
dbaltop
int dbaltop(DBPROCESS *dbproc, int computeid, int column)
Get aggregation operator for a compute column.
Definition: dblib.c:4465
dblogin
LOGINREC * dblogin(void)
Allocate a LOGINREC structure.
Definition: dblib.c:705
tds_willconvert
unsigned char tds_willconvert(int srctype, int desttype)
Test if a conversion is possible.
Definition: convert.c:3116