SQLite

Alfred Newman via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Oct 19 09:01:37 PDT 2016


Hello,

I am trying to handle a SQLite3 table with D. During my 
researchs, I discovered the lib 
https://dlang.org/phobos/etc_c_sqlite3.html.

However, for any reason, there is no code snippets or sample 
codes available there. So, I am stucked.

I have the following sample structure table:
    sql = "INSERT INTO COMPANY (ID,NAME,AGE,ADDRESS,SALARY) "  \
          "VALUES (1, 'Paul', 32, 'California', 20000.00 ); " \
          "INSERT INTO COMPANY (ID,NAME,AGE,ADDRESS,SALARY) "  \
          "VALUES (2, 'Allen', 25, 'Texas', 15000.00 ); "     \
          "INSERT INTO COMPANY (ID,NAME,AGE,ADDRESS,SALARY)" \
          "VALUES (3, 'Teddy', 23, 'Norway', 20000.00 );" \
          "INSERT INTO COMPANY (ID,NAME,AGE,ADDRESS,SALARY)" \
          "VALUES (4, 'Mark', 25, 'Rich-Mond ', 65000.00 );";

Can you pls provide a code snippet or some hints to the following 
job:
- Create a table with the layout above
- Iterate through the records given a basic SELECT WHERE Query

Thanks in advance, AN


More information about the Digitalmars-d-learn mailing list