-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question - Calling Oracle Stored Procedures Example #74
Comments
See https://www.jiubao.org/rust-oracle/oracle/sql_type/struct.RefCursor.html. let sql = "begin StoredProcedureName(:cursor); end;";
let mut stmt = conn.statement(sql).build()?;
stmt.execute(&[&None::<RefCursor>])?; // bind :cursor as RefCursor and execute the statement.
let mut cursor: RefCursor = stmt.bind_value(1)?; // get :cursor as RefCursor. |
How to specify an argument for this procedure? I have a procedure As far as I know we should describe return value like this:
How to get |
Solved. May be it will help someone: Procedure returns rows with let mut containers: Vec<CloudContainer> = vec![];
let sql = "BEGIN :out := CLOUD_STORAGE_META.get_s3_containers(:identity); END;";
let mut stmt = cnn.statement(sql).build()?;
stmt.execute(&[&OracleType::RefCursor, &identity]).unwrap();
let mut ref_cursor: RefCursor = stmt.bind_value(1)?;
let rows = ref_cursor.query_as::<(u32, String)>()?;
for row_result in rows {
let (storage_id, container_name) = row_result.expect("unable to decode result");
let container = CloudContainer {
storage_id,
container_name,
};
containers.push(container);
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to call Oracle stored procedures returning sys_refcursor as out parameter from oracle0.5.7?
The text was updated successfully, but these errors were encountered: