开发者

Execute Multiline sybase statement with java.sql.Statement

开发者 https://www.devze.com 2022-12-19 00:59 出处:网络
H开发者_Go百科ow can I both set rowcount and then execute a query in a Statement.executeQuery() function?

H开发者_Go百科ow can I both set rowcount and then execute a query in a Statement.executeQuery() function?

note I don't want to use Statement.setMaxRows() to do this


Before sybase ASE 12.5.3, you need to use "set rowcount #" and then select the entries. For higher versions you can simply use the following

--Get top 10 rows.
select top 10 * from TAB_A order by my_col asc

Check your Sybase ASE version by giving

select @@version

If your version is not 12.5.4 or above, I suggest upgrading to 12.5.4. (You will just have to install an EBF)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号