Guest User

Untitled

a guest
May 27th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. :module Database.HDBC Database.HDBC.PostgreSQL
  2. :load relational.hs
  3. let dept = Relation "dept"
  4. let emp = Relation "emp"
  5. let teste = (π ["empno", "ename", "dname"] (emp ⋈ dept))
  6. conn <- connectPostgreSQL "host=localhost dbname=teste"
  7. printTuples conn teste
  8.  
  9. [[SqlRational (7902 % 1),SqlByteString "FORD",SqlByteString "RESEARCH"],[SqlRational (7654 % 1),SqlByteString "MARTIN",SqlByteString "SALES"],[SqlRational (7521 % 1),SqlByteString "WARD",SqlByteString "SALES"],[SqlRational (7839 % 1),SqlByteString "KING",SqlByteString "ACCOUNTING"],[SqlRational (7876 % 1),SqlByteString "ADAMS",SqlByteString "RESEARCH"],[SqlRational (7782 % 1),SqlByteString "CLARK",SqlByteString "ACCOUNTING"],[SqlRational (7900 % 1),SqlByteString "JAMES",SqlByteString "SALES"],[SqlRational (7698 % 1),SqlByteString "BLAKE",SqlByteString "SALES"],[SqlRational (7566 % 1),SqlByteString "JONES",SqlByteString "RESEARCH"],[SqlRational (7499 % 1),SqlByteString "ALLEN",SqlByteString "SALES"],[SqlRational (7788 % 1),SqlByteString "SCOTT",SqlByteString "RESEARCH"],[SqlRational (7934 % 1),SqlByteString "MILLER",SqlByteString "ACCOUNTING"],[SqlRational (7369 % 1),SqlByteString "SMITH",SqlByteString "RESEARCH"],[SqlRational (7844 % 1),SqlByteString "TURNER",SqlByteString "SALES"]]
Add Comment
Please, Sign In to add comment