pg.ddx.io pgsql-odbc@postgresql.org mailing list archive
help / color / mirror / Atom feedCreating a database via ODBC
3+ messages / 1 participants
[nested] [flat]
* Creating a database via ODBC
@ 2004-02-27 14:06 Arne Gl?ser <glaeser@cs.tu-berlin.de>
2004-02-29 10:27 ` Re: Creating a database via ODBC Arne Gl?ser <glaeser@cs.tu-berlin.de>
2004-02-29 10:33 ` Re: Creating a database via ODBC Arne Gl?ser <glaeser@cs.tu-berlin.de>
0 siblings, 2 replies; 3+ messages in thread
From: glaeser@cs.tu-berlin.de @ 2004-02-27 14:06 UTC (permalink / raw)
To: pgsql-odbc
Does anyone know how to create a database(of any type) with ODBC API in C++?
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Creating a database via ODBC
2004-02-27 14:06 Creating a database via ODBC Arne Gl?ser <glaeser@cs.tu-berlin.de>
@ 2004-02-29 10:27 ` Arne Gl?ser <glaeser@cs.tu-berlin.de>
1 sibling, 0 replies; 3+ messages in thread
From: glaeser@cs.tu-berlin.de @ 2004-02-29 10:27 UTC (permalink / raw)
To: pgsql-odbc
glaeser@cs.tu-berlin.de (Arne Gl?ser) wrote in message news:<9b2c2076.0402270606.1a108dad@posting.google.com>...
> Does anyone know how to create a database(of any type) with ODBC API in C++?
There's no ODBC call that will create a database.
If this is crucial, you can see if your database supports some sort of
"create Database" statement. If so, you can connect to an existing
database, then execute a database-specific call using SQLExecDirect.
But knowing the first database to connect to and the syntax of the
statement is completely up to you. For example, MS SQL has such a
command. From my SQL documentation, I get
Syntax
CREATE DATABASE database_name
[ ON
[ < filespec > [ ,...n ] ]
[ , < filegroup > [ ,...n ] ]
]
[ LOG ON { < filespec > [ ,...n ] } ]
[ COLLATE collation_name ]
[ FOR LOAD | FOR ATTACH ]
< filespec > ::=
[ PRIMARY ]
( [ NAME = logical_file_name , ]
FILENAME = 'os_file_name'
[ , SIZE = size ]
[ , MAXSIZE = { max_size | UNLIMITED } ]
[ , FILEGROWTH = growth_increment ] ) [ ,...n ]
< filegroup > ::=
FILEGROUP filegroup_name < filespec > [ ,...n ]
MS Access does not, nor does Oracle (to my knowledge.)
In PostGresql, the documentation says
CREATE DATABASE name
[ [ WITH ] [ OWNER [=] dbowner ]
[ LOCATION [=] 'dbpath' ]
[ TEMPLATE [=] template ]
[ ENCODING [=] encoding ] ]
Ed Brown
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Creating a database via ODBC
2004-02-27 14:06 Creating a database via ODBC Arne Gl?ser <glaeser@cs.tu-berlin.de>
@ 2004-02-29 10:33 ` Arne Gl?ser <glaeser@cs.tu-berlin.de>
1 sibling, 0 replies; 3+ messages in thread
From: glaeser@cs.tu-berlin.de @ 2004-02-29 10:33 UTC (permalink / raw)
To: pgsql-odbc
Thanks for your knowledge Ed. I worried about that. So if I need an
existing database anway I'll take the way to just copy an original
empty database.
Arne Gläser
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2004-02-29 10:33 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-02-27 14:06 Creating a database via ODBC Arne Gl?ser <glaeser@cs.tu-berlin.de>
2004-02-29 10:27 ` Arne Gl?ser <glaeser@cs.tu-berlin.de>
2004-02-29 10:33 ` Arne Gl?ser <glaeser@cs.tu-berlin.de>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox