Rev | Line | |
---|
[202] | 1 | This SQL table example requires a connection to a SQL database.
|
---|
| 2 | Modify main.cpp to connect to your specific database.
|
---|
| 3 |
|
---|
| 4 | This example program expects a table called 'simpletable' to exist in
|
---|
| 5 | the database. You can create this table by running the following SQL
|
---|
| 6 | script (modify to suit your backend, if necessary):
|
---|
| 7 |
|
---|
| 8 | drop table simpletable;
|
---|
| 9 | create table simpletable
|
---|
| 10 | (id number primary key,
|
---|
| 11 | name varchar(20),
|
---|
| 12 | address varchar(20) );
|
---|
| 13 |
|
---|
| 14 | -- optional, some sample data
|
---|
| 15 | insert into simpletable (id, name, address)
|
---|
| 16 | values (1, 'Trond', 'Oslo');
|
---|
| 17 | insert into simpletable (id, name, address)
|
---|
| 18 | values (2, 'Dave', 'Oslo');
|
---|
Note:
See
TracBrowser
for help on using the repository browser.