% Demonstrates how OUTER JOIN can be used from Prova sql_select 

:-eval(consult("utils.prova")).

:- eval(outer_join()).

location(database,uniprot,"jdbc:mysql://localhost/uniprot","guest","guestdb").

outer_join() :-
	dbopen(uniprot,DB),
	println(["===========================outer_join==========================="]),
	issue_query(DB).

issue_query(DB) :-
	println(["----------------------------------------------------------------"]),
	% select t.name,t.type,s.id2 from term t left join synonym s on t.id=s.id1 limit 10
	println(["The first 10 term with or without synonym ID"]),
	sql_select(DB,'term t left join synonym s on t.id=s.id1',['t.name',N],['t.type',T],['s.id2',ID2],[options,'limit 10']),
	println([N,T,ID2],"->").
