How create database, tables,indices...

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

How create database, tables,indices...

Andy-3
I am beginner in Sqlite programming. I already open and read tables.
I compiled sqlite3.c (8 MB) amalgamation file do DLL and call functions
from FreePascal.
Which function are for crating new database, tables, indices, columns, fill
tables.
I see
#define SQLITE_CREATE_INDEX          1   /* Index Name      Table Name
 */
#define SQLITE_CREATE_TABLE          2   /* Table Name      NULL
 */
but how function I must call?
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: How create database, tables,indices...

Andy-3
I see: http://zetcode.com/db/sqlitec/
New database is simply open not existing file in path?
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: How create database, tables,indices...

Simon Slavin-3
In reply to this post by Andy-3
On 7 Jan 2020, at 2:11pm, Andy <[hidden email]> wrote:

> Which function are for crating new database, tables, indices, columns, fill tables.

You do this with SQL commands, just like the commands you use to read data out of the database.

<https://www.w3schools.com/sql/sql_create_table.asp>

On 7 Jan 2020, at 2:23pm, Andy <[hidden email]> wrote:

> New database is simply open not existing file in path?

Your path is for files you execute.  You do not execute a database file.  So if the database is not in your current directory you must specify the directory it is in.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: How create database, tables,indices...

David Raymond
In reply to this post by Andy-3
To create a new database you just open the file name you want, and if it doesn't exist it will be created.

The actual new file creation is slightly delayed until it has to write something to the disk. There are a couple of options that can only be set at file creation time like page size, text encoding, file format, etc. So if you wanted any non-default settings for those you would set those first thing after opening it and before doing anything else, so that they are set _before_ the actual file itself is created.


-----Original Message-----
From: sqlite-users <[hidden email]> On Behalf Of Andy
Sent: Tuesday, January 7, 2020 9:23 AM
To: SQLite mailing list <[hidden email]>
Subject: Re: [sqlite] How create database, tables,indices...

I see: http://zetcode.com/db/sqlitec/
New database is simply open not existing file in path?
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users