Guest User

Untitled

a guest
May 22nd, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. local fb = require 'fbclient.class'
  2. local at = fb.attach('localhost:/var/lib/firebird/2.1/data/firedjango.fdb', 'SYSDBA', 'masterkey')
  3. local InsertSql = "INSERT INTO BOOKS_AUTHOR (ID, FIRST_NAME, LAST_NAME, EMAIL) VALUES (null, 'Jack', 'Sparrow', 'Jack@example.com')";
  4. at:exec_immediate(InsertSql);
  5. local sql = 'SELECT a.ID, a.FIRST_NAME,a.LAST_NAME,a.EMAIL FROM BOOKS_AUTHOR a where a.FIRST_NAME=?'
  6. for st, id, firstname,lastname,email in at:exec(sql,'Jack') do
  7. print(id, firstname,lastname,email)
  8. end
  9. at:close()
Add Comment
Please, Sign In to add comment