Comments (7)
It depends on DBMS (Oracle, MySQL, etc.) and the programming language.
As for ruby-oci8, cursor.exec()
sends the SQL statement in the ruby-side cursor to the database server, then the database server creates a server-side cursor implicitly when the statement is select.
from ruby-oci8.
Thanks for your reply.
So you mean ruby-oci8
do not explicitly declare a cursor when the statement is select.
From docs.oracle sql_cursor, I saw
An implicit cursor has attributes that return information about the most recently run SELECT or DML statement that is not associated with a named cursor.
But I am still confused. Implicit cursors how to return the database cursor from the DBMS to the ruby code?
Does the implicit cursors will automatically open, fetch and close?
from ruby-oci8.
So you mean ruby-oci8 do not explicitly declare a cursor when the statement is select.
Correct.
Implicit cursors how to return the database cursor from the DBMS to the ruby code?
Implicit cursors and explicit cursors are concept specific to the PL/SQL language.
Oracle database engine itself doesn't have such concept.
For example, PL/SQL explicit cursors must have names. However the database engine
doesn't know the names. I guess that the name is used only to tie the PL/SQL explicit
cursor and a reference to the cursor in the database engine. As for implicit cursor,
I guess that PL/SQL internally has a reference to the cursor in the database engine.
Does the implicit cursors will automatically open, fetch and close?
Ruby-oci8 uses Oracle Call Interface (OCI).
- The OCI function
OCIStmtPrepare2
creates a statement handle. OCIStmtExecute
sends the SQL statement and ties the statement handle and a reference to the opened cursor in the database engine.OCIStmtFetch
fetches rows.OCIStmtRelease
frees the statement handle though OCI doesn't close the cursor in the database side immediately. It is closed at the next network round trip to the database.
from ruby-oci8.
Thanks!
I will try to search more information from oracle oci.
Hope to get the key information.
from ruby-oci8.
What I wrote in #239 (comment) is not documented in the OCI manual. I checked it by network capture. I have made a prototype of Oracle network protocol decoder more than a decade ago.
The OCI manual explains how to use OCI functions, not their internal behavior.
from ruby-oci8.
So that is it.
Maybe need to deep into Oralce, then it will be clear.
There are so many things to learn. It is a cheering thing.
I closed the issue. Because the issue is related to Oracle, not ruby-oci8
.
I will be back, if I find the answer.
Thanks for your patience again.
from ruby-oci8.
https://docs.oracle.com/cd/E11882_01/server.112/e40540/sqllangu.htm#CNCPT1741
When an application issues a SQL statement, the application makes a parse call to the database to prepare the statement for execution. The parse call opens or creates a cursor, which is a handle for the session-specific private SQL area that holds a parsed SQL statement and other processing information. The cursor and private SQL area are in the PGA.
from ruby-oci8.
Related Issues (20)
- Huge memory usage starting with version 2.2.7 HOT 3
- Compiling in m1 mac HOT 5
- Possible To Force Static Build? HOT 10
- libnnz19.so: cannot open shared object file: No such file or directory HOT 4
- redhat linux install fails with error "extconf.rb:160:in `<main>': uninitialized constant CONFTEST (NameError)" HOT 2
- OCIError: ORA-04088: error during execution of trigger 'SYS.USER_LOGIN_MONITORING' HOT 11
- Install in M1 and ruby 2.5.1 HOT 7
- checking for OCIEnvCreate() in oci.h... no on Big Sur (M1 chip) HOT 3
- segmentation fault starting rails
- checking for OCIEnvCreate() in oci.h... no // M1 Monterey HOT 1
- @tiagobzr I didn't get this..Im getting the same error as cited above HOT 3
- warning: undefining the allocator of T_DATA class OraNumber HOT 1
- Question regarding a thread issue that was potentially fixed HOT 1
- extconf.rb failed when installing ruby-oci8 on M1 Mac. HOT 3
- sql_type: Number(1) is getting mapped to Boolean HOT 1
- OCIError: ORA-21500 when connecting to Oracle Database 18c Enterprise Edition HOT 2
- Query : Is ruby-oci8 gem version 2.2.12 broken on Windows (with Ruby 2.5.x)? HOT 4
- Issues during gem install with M1 running on Rosetta (Oracle instant client is not found. (RuntimeError)) HOT 5
- fails to load oci.dll on windows x64/msys2 rub 3.1.4p223 after update of msys2 HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ruby-oci8.