Mamta Satoor wrote:
Hi,

I could be understanding this wrong but section "Overview of
Derby-style table functions" in Developer's Guide has following
example
CREATE FUNCTION externalEmployees
()
RETURNS TABLE
(
  employeeId    INT,
  lastName      VARCHAR( 50 ),
  firstName     VARCHAR( 50 ),
  birthday      DATE
)
LANGUAGE JAVA
PARAMETER STYLE DERBY_JDBC_RESULT_SET
NO SQL
EXTERNAL NAME 'com.acme.hrSchema.EmployeeTable.read'

Notice that the example above says NO SQL. Later in the same section,
when we have an example of the implementation of
'com.acme.hrSchema.EmployeeTable.read, it shows the usage of
PreparedStatement to execute a SQL query. I think we need to fix the
CREATE FUNCTION example to say "READS SQL DATA".

thanks,
Mamta
Hi Mamta,

Thanks for digging into the user documentation on table functions. I agree that it would be less confusing if the example said "READS SQL DATA" rather than "NO SQL". I think that would be a better model for people writing this kind of table function. The meaning of those terms is ambiguous to me and I am not finding much guidance in the SQL standard--at least not in part 2, section 11.50 <SQL-invoked routine> or in part 13, section 9.8 <SQL-invoked routine>. It is unclear to me whether that clause is supposed to refer just to SQL issued against the current connection or whether it also refers to SQL issued against connections opened to foreign databases. Derby is able to enforce the clause in the first case but in the second case there is not much that Derby can do.

Thanks,
-Rick

Reply via email to