Oracle TABLE clause for table function calls
In Oracle, a "table" function may be called with a "TABLE" clause in the FROM, like:
SELECT * FROM TABLE (strings)
-- or even
SELECT * FROM TABLE (strings())
With PostgreSQL, a rewrite is needed:
-- remove TABLE() call
-- parenthensis must be present
SELECT * FROM strings();
Source: https://livesql.oracle.com/apex/livesql/file/tutorial_GSOTSK8FWLYZOG5CJJ9KPX7RX.html
At this time, transqlate
fails on parsing:
Type SQL snippet and terminate with ^D
SELECT * FROM TABLE (strings);
14:40:35 DEBUG Parsing SQL. source=-
enter: parseSnippet
┊ enter: parseStatement
┊ ┊ enter: parseExpression precedence=0
┊ ┊ ┊ enter: parseSelect
┊ ┊ ┊ ┊ consume: Keyword "SELECT"
┊ ┊ ┊ ┊ enter: parseItems
┊ ┊ ┊ ┊ ┊ enter: parseExpression precedence=0
┊ ┊ ┊ ┊ ┊ ┊ enter: parseLeaf
┊ ┊ ┊ ┊ ┊ ┊ ┊ consume: Punctuation "*"
┊ ┊ ┊ ┊ enter: parseFrom
┊ ┊ ┊ ┊ ┊ consume: Keyword "FROM"
┊ ┊ ┊ ┊ ┊ enter: parseFromList
┊ ┊ ┊ ┊ ┊ ┊ enter: parseTableExpr
┊ ┊ ┊ ┊ ┊ ┊ ┊ enter: parseExpression precedence=0
┊ ┊ ┊ ┊ ┊ ┊ ┊ ┊ error: unexpected: Keyword "TABLE"
select: from: unexpected Keyword: TABLE at +1:15 -
SELECT * FROM TABLE (strings);
exit status 1
Edited by Florent Jardin