Sybase allows row limitation in a query by using the TOP clause with an optional START AT. Snowflake does not support this syntax but it can be transformed as shown below to achieve the same functionality.
In Sybase, a table can be defined by selecting multiple rows and defining a name to store the data retrieved. Snowflake does not support this behavior but can be emulated by doing a CREATE TABLE AS.
Snowflake allows calling a stored procedure(when the procedure meets certain limitations) or a table value function in a FROM clause, but RESULTSETS and windowing cannot be used as parameters.
SELECT*FROMTABLE(MyProcedure(!!!RESOLVE EWI!!!/*** SSC-EWI-SY0004 - UNSUPPORTED SYNTAX TABLE FUNCTION CAN'T RECEIVE A QUERY AS PARAMETER ***/!!!TABLE(SELECT*FROM TABLE1)));SELECT*FROMTABLE(MyProcedure(1,'test'));SELECT*FROMTABLE(MyProcedure(!!!RESOLVE EWI!!!/*** SSC-EWI-SY0004 - UNSUPPORTED SYNTAX TABLE FUNCTION CAN'T RECEIVE A QUERY AS PARAMETER ***/!!!TABLE(SELECT*FROM TABLE1)!!!RESOLVE EWI!!!/*** SSC-EWI-SY0005 - UNSUPPORTED SYNTAX TABLE FUNCTION CAN'T BE USED WITH OVER EXPRESSION ***/!!!OVER(PARTITIONBY Col1 ORDERBY Col2 DESC)));SELECT*FROMTABLE(MyProcedure(!!!RESOLVE EWI!!!/*** SSC-EWI-SY0004 - UNSUPPORTED SYNTAX TABLE FUNCTION CAN'T RECEIVE A QUERY AS PARAMETER ***/!!!TABLE(SELECT*FROM AnotherTable)));
-- Openstring from fileSELECT*FROM!!!RESOLVE EWI!!!/*** SSC-EWI-SY0006 - OPEN STRING IS NOT SUPPORTED IN SNOWFLAKE ***/!!!
OPENSTRING (FILE'/path/to/file.txt')WITH(Col1 INT, Col2 VARCHAR(20))AS OS;-- Openstring from valueSELECT*FROM!!!RESOLVE EWI!!!/*** SSC-EWI-SY0006 - OPEN STRING IS NOT SUPPORTED IN SNOWFLAKE ***/!!!
OPENSTRING (VALUE'1,test')WITH(Col1 INT, Col2 VARCHAR(20))AS OS;-- Openstring with optionsSELECT*FROM!!!RESOLVE EWI!!!/*** SSC-EWI-SY0006 - OPEN STRING IS NOT SUPPORTED IN SNOWFLAKE ***/!!!
OPENSTRING (FILE'/path/to/file.csv')WITH(Col1 INT, Col2 VARCHAR(20))OPTION(DELIMITEDBY',' QUOTE '"')AS OS;
In Sybase, during execution, the DML statement specified in the dml-derived table is executed first, and the rows affected by that DML materialize into a temporary table whose columns are described by the REFERENCING clause. The temporary table represents the result set of dml-derived-table. Snowflake does not support this behavior.
In Sybase the CONTAINS clause following a table name to filter the table and return only those rows matching the full text query specified with contains-query. Every matching row of the table is returned together with a score column that can be referred to using score-correlation-name. Snowflake does not support this behavior.