Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6476887
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:52:50+00:00 2026-05-25T06:52:50+00:00

In order to query the database meta data in Sybase ASE, I found this

  • 0

In order to query the database meta data in Sybase ASE, I found this relevant answer (not the accepted one), to be ideal:

From a Sybase Database, how I can get table description ( field names and types)?

Unfortunately, I can’t seem to find any documentation, how I’m supposed to call sp_help from JDBC. According to the documentation, sp_help returns several cursors / result sets. The first one contains information about the table itself, the second one about the columns, etc. When I do this:

PreparedStatement stmt = getConnection().prepareStatement("sp_help 't_language'");
ResultSet rs = stmt.executeQuery();

while (rs.next()) {
    System.out.println(rs.getObject(1));
    // ...
}

I only get the results from the first cursor. How to access the other ones?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T06:52:51+00:00Added an answer on May 25, 2026 at 6:52 am

    When you have multiple result sets you need to use the execute() method rather than executeQuery().
    Here’s an example:

    CallableStatement cstmt;
    ResultSet rs;
    int i;
    String s;
    ...
    cstmt.execute();                        // Call the stored procedure       1 
    rs = cstmt.getResultSet();              // Get the first result set        2 
    while (rs.next()) {                     // Position the cursor             3 
     i = rs.getInt(1);                      // Retrieve current result set value
     System.out.println("Value from first result set = " + i);  
                                            // Print the value
    }
    cstmt.getMoreResults();                 // Point to the second result set  4a 
                                            // and close the first result set
    rs = cstmt.getResultSet();              // Get the second result set       4b 
    while (rs.next()) {                     // Position the cursor             4c 
     s = rs.getString(1);                   // Retrieve current result set value
     System.out.println("Value from second result set = " + s); 
                                            // Print the value
    }
    rs.close();                             // Close the result set
    cstmt.close();                          // Close the statement 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this query $query_return = database::query(SELECT * FROM tw ORDER BY time DESC);
I have to query a database of thousands of entries and order this by
I am using the following query to display database rows in an alphabetical order:
Take this query: SELECT * FROM MyTable WHERE MyColumn = 'SomeValue' ORDER BY SomeFakeQualifier.MyColumn
I'm running this query on a MYSql database: select * from wp_postmeta where meta_key
I have this database query SELECT * FROM (`metadata` im) INNER JOIN `content` ic
I need to used dynamic order query in mysql and i have successfully achieved
order by in query is taking to much time in MySQL. SHOW PROFILES shows
How to set conditional logic in SQL query in order to shuffle the precedence?
I'm doing an INSERT INTO query in order to initialize a new table. The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.