PostgreSQL function returning TABLE

115 views
Skip to first unread message

Ildar Ov

unread,
Apr 14, 2015, 1:36:34 PM4/14/15
to jooq...@googlegroups.com
Hi Lukas!
I have a postgresql function 

CREATE or replace FUNCTION chasdb.getAll(_chr_name_intervals text, _min_ovelap real, _min_coverage real, _bio_domain text, _state text, _aed_category text)
  RETURNS TABLE(chrom text, mn int, mx int, category text, overlap bigint, coverage bigint, overlap_coverage bigint) AS $$
BEGIN 
    RETURN QUERY EXECUTE 
'SELECT ....
'
I used JOOQ 3.5

 
Result<GetallRecord> result2 = createDSLContext().
selectFrom(Routines.getall("", 0.0F, 0.0F, "experiment", "active", "copynumber/gain" )).fetch();

Those code generated by JOOQ 
select 
  "chasdb"."getall"."chrom", 
  "chasdb"."getall"."mn", 
  "chasdb"."getall"."mx", 
  "chasdb"."getall"."category", 
  "chasdb"."getall"."overlap", 
  "chasdb"."getall"."coverage", 
  "chasdb"."getall"."overlap_coverage"
from "chasdb"."getall"(
  '', 
  0.0, 
  0.0, 
  'experiment', 
  'active', 
  'copynumber/gain')

And I got an exception 
  ERROR: invalid reference to FROM-clause entry for table "getall"
  Hint: There is an entry for table "getall", but it cannot be referenced from this part of the query.
  Position: 8 
Probably issue with schema name?

How I could get 
 select *
from "chasdb"."getall"(
  '', 
  0.0, 
  0.0, 
  'experiment', 
  'active', 
  'copynumber/gain')

?


Thanks in advance

Ildar Ov

unread,
Apr 15, 2015, 5:18:56 AM4/15/15
to jooq...@googlegroups.com
The same with 
Result<Record> result2 = createDSLContext().
select().from(GETALL.call("('chr5', 12017264, 17602802),('chr16', 45099457,46383335)",

Lukas Eder

unread,
Apr 15, 2015, 5:43:48 AM4/15/15
to jooq...@googlegroups.com
It appears that this has been fixed in 3.5.1:

What jOOQ version are you using?

--
You received this message because you are subscribed to the Google Groups "jOOQ User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jooq-user+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages