![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi, At the moment I am trying to grasp PL/SQL, and I've read a few PL/SQL tutorials online - Now I've got a few questions, I really didn't understand... What I think I did grasp: Every SELECT query is stored internally in memory. A cursor is a pointer on it and you can use it to access each record of this "virtual table". 1. Is that correct? 2. When exactly do I need a cursor, and when don't I? Without a cursor, you have to use a select that returns exactly one row. But what if I put this SELECT statment into a loop and count up a variable for a variable in a WHERE condition of this statement - or what if I use a limit with a variable I count up? Wouldn't that do exactly the same? 3. What for do I need a PL/SQL table, and why does it only support one column - but on the other hand you can store a record in such a PL/SQL Table column, and so you get a full table again... 4. Where's the difference between a PL/SQL table and a cursor? thx, Bernd You should try to operate on data in sets not in row by row processing. |
#3
| |||
| |||
|
#4
| |||
| |||
|
|
Every SELECT query is stored internally in memory. A cursor is a pointer on it and you can use it to access each record of this "virtual table". 1. Is that correct? 2. When exactly do I need a cursor, and when don't I? Without a cursor, you have to use a select that returns exactly one row. But what if I put this SELECT statment into a loop and count up a variable for a variable in a WHERE condition of this statement - or what if I use a limit with a variable I count up? Wouldn't that do exactly the same? 3. What for do I need a PL/SQL table, and why does it only support one column - but on the other hand you can store a record in such a PL/SQL Table column, and so you get a full table again... 4. Where's the difference between a PL/SQL table and a cursor? |
![]() |
| Thread Tools | |
| Display Modes | |
| |