Skip to main content
JR Moore
Participating Frequently
Dec 17, 2021 11:41 AM UTC

SQL ODBC TO UNIVERSE LIMIT ROWS

Can someone tell me the proper syntax for SQL statement to Universe. I have a large file that I need to fetch 10000 rows at a time from Universe that will update a remote AZURE DB daily. I don't have control over the AZURE site as EDA seems like a much better solution to keep the remote data current.

I have tried:

SELECT TOP 10000 * FROM FILE;
SELECT * FROM FILE LIMIT 10000;
SELECT * FROM FILE FETCH FIRST 10000;
SELECT * FROM FILE WHERE ROWNUM < 10000;

Thanks JR Moore


------------------------------
JR Moore
IT Special Projects
Rocket Forum Shared Account
Hillsboro US
------------------------------

    21 replies

    Participating Frequently
    Jan 28, 2024 11:51 PM UTC
    Gregor:

    Thanks for the reply to my question. I should have mentioned I tried SAMPLE and it works at TCL but not when calling from an outside program. It also works from the U2ODBC tester in Native SQL but not ODBC Compliant SQL. Does anybody know if there is a setting to allow Native SQL from outside Universe?

    Thanks JR Moore

    ------------------------------
    JR Moore
    IT Special Projects
    Rocket Forum Shared Account
    Hillsboro US
    ------------------------------

    Native Universe SQL can be sent via ODBC using curly braces, NATIVE keyword, with the query in double quotes. This example is for an MSSQL linked server.

    SELECT * FROM OPENQUERY(linkedserver, '{NATIVE "SELECT * FROM table ORDER BY column SAMPLE 10"}')



    ------------------------------
    Greg Clitheroe
    Rocket Forum Shared Account
    ------------------------------