Interface CallTableFunction<R extends Record>

Type Parameters:
R - The record type.
All Superinterfaces:
Attachable, AttachableQueryPart, Fields, Flow.Publisher<R>, Iterable<R>, Publisher<R>, org.reactivestreams.Publisher<R>, Query, QueryPart, ResultQuery<R>, Serializable, Statement, TableLike<R>
All Known Subinterfaces:
QOM.CallTableFunction<R>

@Pro public interface CallTableFunction<R extends Record> extends ResultQuery<R>, TableLike<R>
A call to a stored table valued function, created from CallReturnsStep.returnsTable(Field...).

The call can be used in different ways:

  • As a ResultQuery: The function call is executed in a SELECT statement, e.g. SELECT * FROM f(?, ?).
  • As a TableLike: TableLike.asTable() produces the plain table valued function call f(?, ?), which can be used in the FROM clause of other queries.

Example:

Table<?> t = call(name("t"))
    .args(val(1))
    .returnsTable(field(name("ID"), INTEGER), field(name("TITLE"), VARCHAR))
    .asTable("t");

Result<?> result =
ctx.select(t.field("ID"), t.field("TITLE"))
   .from(t)
   .fetch();
Author:
Lukas Eder