Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Limit Clause SQL for ORACLE not working

jaipersr
7 - Meteor

Hi all,

I am trying to do something simple. I am using an input tool to connect to an sql database. The tool works just fine. However, when I add a limit clause to the end of my SQL to restrict the number of records being pulled in the sql errors. Am I doing something wrong here? I also tried the Fetch syntax but that does not seem to work either. Any help would be appreciated.

5 REPLIES 5
BrandonB
Alteryx
Alteryx

Can you try using the limit option in the configuration window rather that in your query? 

 

limit.png

 

jaipersr
7 - Meteor

I completely missed that. Thank you for reminding me of its existence. But I still think its weird how the limit clause does not work in the input tool. Is this a known error that I just have to accept?

BrandonB
Alteryx
Alteryx

Syntax for Oracle is a bit different, so you wouldn't be using the traditional LIMIT. 

 

You can use 

 

select * 
from sometable
where rownum <= 10

 

or 

 

 

SELECT * 
FROM   sometable
ORDER BY name
OFFSET 20 ROWS FETCH NEXT 10 ROWS ONLY

 

Just to clarify, this is because Oracle doesn't use LIMIT

jaipersr
7 - Meteor

The FETCH/OFFSET syntax did not work for me.

BrandonB
Alteryx
Alteryx

Does the rownum work for you? This is effectively limiting the number of rows by whatever value follows. 

Polls
We’re dying to get your help in determining what the new profile picture frame should be this Halloween. Cast your vote and help us haunt the Community with the best spooky character.
Don’t ghost us—pick your favorite now!
Labels