Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- :module Database.HDBC Database.HDBC.PostgreSQL
- :load relational.hs
- let dept = Relation "dept"
- let emp = Relation "emp"
- let teste = (π ["empno", "ename", "dname"] (emp ⋈ dept))
- conn <- connectPostgreSQL "host=localhost dbname=teste"
- printTuples conn teste
- [[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