Open topic with navigation

TIBCO BusinessEvents® Enterprise Edition 6.3.1

# closeQuery()

You must close an open database cursor for an SQL query by using the `Database.closeQuery()` function.

If you do not close the cursor, it results in database level exception as an open cursor is a limited resource at database level. Even if there is no exception, you must close all open cursors.

## Syntax

    void closeQuery(String cursorName);

## Parameters

Parameter | Type | Description
--- | --- | ---
`cursorName` | `String` | The name of the cursor to be closed.

## Example

    Database.setCurrentConnection("/SharedResources/Oracle.sharedjdbc");
    String jdbcURI="/SharedResources/HR_DB_Conn.sharedjdbc";
    String cursorName="EmpCursor";
    String resultTypeURI="/Concepts/HR/EMPLOYEES";
    String sql="select * from employees";
    int pageSize=10 ;
    Object requestObj=null;
    String cursorName=Database.createQuery(jdbcURI,cursorName,resultTypeURI,sql,pageSize,requestObj);
    System.debugOut(" Opened Cursor: " + cursorName);
    Database.closeQuery(cursorName);

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.