Open topic with navigation

TIBCO BusinessEvents® Enterprise Edition 6.3.1

# Database Cursor Functions

Database cursor functions are useful when you want to process few records at a time in a large result set of queries. They help you to get database records, insert database records, and delete database records.

The following database functions are available in the catalog functions under RDBMS:

- `createQuery()`
- `getNextPage()`
- `getPreviousPage()`
- `getNextPageFromOffset()`
- `getPreviousPageFromOffset()`
- `closeQuery()`

## Example of Database Cursor Functions

    debugOut("Database Cursor Demo Starts");
    Database.setCurrentConnection("/SharedResources/HR_DB_Conn.sharedjdbc");
    String cursorName=Database.createQuery("/SharedResources/HR_DB_Conn.sharedjdbc", "EmpCursor", "/Concepts/HR/EMPLOYEES", "select * from employees", 10, null);
    debugOut("Opened Cursor: " + cursorName);
    try{
    Concept[] empCepts=Database.getNextPage(cursorName, 10);
    debugOut("Database.getNextPage() fetched " + empCepts@length + " rows");
     while(empCepts !=null && empCepts@length > 0){
    empCepts=Database.getNextPage(cursorName, 10);
    debugOut(" Database.getNextPage() fetched " + empCepts@length + " rows");
    for(int i; i < empCepts@length ; i=i+1){
          debugOut(" "+empCepts[i]);
          }
       }
    debugOut("@ end");
    } finally {
       if(cursorName !=null){
       Database.closeQuery(cursorName);
       }
    }

Subtopics

Did you find this helpful?

YesNo
Great!
Thanks for taking the time to give us some feedback.
Sorry about that

Why wasn't this helpful? (check all that apply)

Could not find what I was looking for
Instructions confusing or unclear
Instructions did not work

Want to tell us more?

Please select at least one option or provide details about the issue!!

Error occurred while submitting feedback.

Error2 occurred while submitting feedback.

TIBCO BusinessEvents® Enterprise Edition

Copyright © 2004-2024. Cloud Software Group, Inc. All Rights Reserved.