guillaume wrote:

>   Statement st;
>   ResultSet rs;
>   st = cx.createStatement(); // cx is a Connection object
>   rs = st.executeQuery("DECLARE CUR_PGM SCROLL CURSOR FOR
>     SELECT * FROM MY_TABLE FOR READ ONLY");
>
> java.sql.SQLException: No ResultSet was produced
>  at
sun.jdbc.odbc.JdbcOdbcStatement.executeQuery(JdbcOdbcStatement.java:138)

Use st.execute("DEC...");

> By the way, most of my statements are too long to fit a single line
> (i know there is no limit for line length, but readability is important)
> and i'm obliged to split them in 2 or 3 lines. Is there a better way
> to do it than (some continuation character?):
> executeQuery("STATEMENT PART 1" +
>   "STATEMENT PART 2" +
>   "STATEMENT PART 3");

You can define a String variable, like this:
String szQuery = "statement part1 " +
            "part2 " +
            ...
rs = st.execute(szQuery);

Hope this helps.

Jianhong

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to