1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
|
.\" msqlSelectDB - Select a database
.\" Copyright (c) 1996 Martin Schulze <joey@office.individual.net>
.\"
.\" 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 program 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 General Public License for more details.
.\"
.\" You should have received a copy of the GNU General Public License
.\" along with this program; if not, write to the Free Software
.\" Foundation, Inc.,59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
.\"
.\" This manual page is written especially for Debian GNU/Linux.
.\"
.TH msqlSelectDB 3 "4 Aug 1996" "Mini SQL" "mSQL Programmer's Manual"
.SH NAME
msqlSelectDB \- Select a database
.SH SYNOPSYS
.nf
.B #include <msql.h>
.sp
.BI "msqlSelectDB(int " sock ", char *" dbName );
.fi
.SH DESCRIPTION
Prior to submitting any queries, a database must be selected.
.B msqlSelectDB()
instructs the engine which database is to be accessed.
.B msqlSelectDB()
is called with the socket descriptor returned by
.BR msqlConnect (3)
and the name of the desired database.
.B msqlSelectDB()
may be called multiple times during a programs execution. Each time
it is called, the server will use the specified database for future
accesses. By calling
.B msqlSelectDB() multiple times, a program can switch between
different databases during its execution.
.SH "RETURN VALUE"
On success 0 is returned. If an error occurs, a value of \-1 is
returned and the variable
.I msqlErrmsg
contains an appropriate text message. This variable is defined in
.IR <msql.h> .
.SH "SEE ALSO"
.BR msqlConnect (3),
.BR msqld (8),
.BR msql (5).
|