Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local fb = require 'fbclient.class'
- local at = fb.attach('localhost:/var/lib/firebird/2.1/data/firedjango.fdb', 'SYSDBA', 'masterkey')
- local InsertSql = "INSERT INTO BOOKS_AUTHOR (ID, FIRST_NAME, LAST_NAME, EMAIL) VALUES (null, 'Jack', 'Sparrow', 'Jack@example.com')";
- at:exec_immediate(InsertSql);
- local sql = 'SELECT a.ID, a.FIRST_NAME,a.LAST_NAME,a.EMAIL FROM BOOKS_AUTHOR a where a.FIRST_NAME=?'
- for st, id, firstname,lastname,email in at:exec(sql,'Jack') do
- print(id, firstname,lastname,email)
- end
- at:close()
Add Comment
Please, Sign In to add comment