Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

19
LINES

< > BotCompany Repo | #2000005 // An executor for SQL statements (pseudo-code)

New Tinybrain snippet

ServerConnection serverConnection = new ServerConnection()

daten = serverConnection.doSQLQuery([[select sn_id, sn_text from tb_snippet
  join nt_live on sn_id=nt_snippetid
  where live_retired = 0
  and author_ok(live_author)
  or sql_statement_ok(sn_text) == 'definitely';]])
  
for each d in daten do
  title = "Result of #"..d.sn_id;
  if not serverConnection.hasNTTitle(title) then
    try
      result = serverConnection.doSQLQuery(d.sn_text).toJSON()
    catch e
      result = "Error: "..e
    end
    serverConnection.createNTSnippet(title, result)
  end
end

download  show line numbers   

Snippet is not live.

Travelled to 12 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #2000005
Snippet name: An executor for SQL statements (pseudo-code)
Eternal ID of this version: #2000005/1
Text MD5: b29d5771ff4230a06e5140aa98f1c611
Author: stefan
Category:
Type: New Tinybrain snippet
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2015-03-10 20:29:03
Source code size: 585 bytes / 19 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 628 / 129
Referenced in: #2000006 - An executor for SQL statements (pseudo-code, bug fixed)
#3000382 - Answer for ferdie (>> t = 1, f = 0)
#3000384 - Answer for 6uru0fsh1va (>> t-sql?)