Update Documentation - SQLite Chapter
@@ -69,27 +69,29 @@ The next code create a SQLite database, add new records then display the data.
.. code-block:: ring
+ load "sqlitelib.ring"
+
oSQLite = sqlite_init()
sqlite_open(oSQLite,"mytest.db")
- sql = "CREATE TABLE COMPANY(" +
- "ID INT PRIMARY KEY NOT NULL," +
- "NAME TEXT NOT NULL," +
- "AGE INT NOT NULL," +
- "ADDRESS CHAR(50)," +
- "SALARY REAL );"
-
+ sql = "
+ CREATE TABLE COMPANY (
+ ID INT PRIMARY KEY NOT NULL,
+ NAME TEXT NOT NULL,
+ AGE INT NOT NULL,
+ ADDRESS CHAR(50),
+ SALARY REAL );
+ "
sqlite_execute(oSQLite,sql)
- sql = "INSERT INTO COMPANY (ID,NAME,AGE,ADDRESS,SALARY) " +
- "VALUES (1, 'Mahmoud', 29, 'Jeddah', 20000.00 ); " +
- "INSERT INTO COMPANY (ID,NAME,AGE,ADDRESS,SALARY) " +
- "VALUES (2, 'Ahmed', 27, 'Jeddah', 15000.00 ); " +
- "INSERT INTO COMPANY (ID,NAME,AGE,ADDRESS,SALARY)" +
- "VALUES (3, 'Mohammed', 31, 'Egypt', 20000.00 );" +
- "INSERT INTO COMPANY (ID,NAME,AGE,ADDRESS,SALARY)" +
- "VALUES (4, 'Ibrahim', 24, 'Egypt ', 65000.00 );"
+ sql = "
+ INSERT INTO COMPANY (ID,NAME,AGE,ADDRESS,SALARY)
+ VALUES (1, 'Mahmoud' , 29, 'Jeddah', 20000.00 ),
+ (2, 'Ahmed' , 27, 'Jeddah', 15000.00 ),
+ (3, 'Mohammed', 31, 'Egypt' , 20000.00 ),
+ (4, 'Ibrahim' , 24, 'Egypt ', 65000.00 );
+ "
sqlite_execute(oSQLite,sql)
