On 9/14/05, Mark Wyszomierski <[EMAIL PROTECTED]> wrote:
> Hi everyone,
>  Two quick questions:
>  1) Is there anything special the supplied sqlite3.exe does to create a
> database file. I want to programatically create a database file at runtime,
> so can I just create an empty xxx.db file, and go ahead with create table
> statements to populate it? The documentation says to create a sqlite
> database you should use the supplied app (sqlite3.exe). Is just doing that
> myself ok?
See http://www.sqlite.org/capi3ref.html#sqlite3_open
If you're not using C API directly, look up the docs for your wrapper,
but in general db file should be created for you when you call
"open()" method of your wrapper with filename that doesn't exist yet.

>  2) While creating tables, I've been specifying the data type after the
> field name:
>   create table test(field_1 integer, field_2 text);
>  The only advantage of this is that the database could possible store the
> data in a more compact form, correct? If that's not a concern, leaving it
> all as text would not make a difference?
Data type affinity is used at runtime too (comparison for example).
See http://www.sqlite.org/datatype3.html for more details.


-- 
Nemanja Corlija <[EMAIL PROTECTED]>

Reply via email to