Home > database > Comrades, what use cases for example, a what circumstances use for 2???
Comrades, what use cases for example, a what circumstances use for 2???
Time:10-10
CodePudding user response:
For x in (select cols The from XXXXX x Inner join yyyyyyy y on x.i d=y.x id Inner join ZZZZZ z on x.i d=z.x id Where x.n ame in (select the name from aaaa where age & gt; 1000 and FFF & gt; 30000 or (CD & gt; 1000 and tt!=1000)) And the exists (select * from BBBB b where x.i dx=1000 and b.i d=7.0.x.x xid) The and... The and... ) Loop //todo End loop
If change to this, looked at the loop body is more relaxed some
Cursor cur is Select the cols The from XXXXX x Inner join yyyyyyy y on x.i d=y.x id Inner join ZZZZZ z on x.i d=z.x id Where x.n ame in (select the name from aaaa where age & gt; 1000 and FFF & gt; 30000 or (CD & gt; 1000 and tt!=1000)) And the exists (select * from BBBB b where x.i dx=1000 and b.i d=7.0.x.x xid) The and... The and... ;
The open cur;
For rec in cur loop //todo end loop;
The close cur;
CodePudding user response:
The same, only is a display definition cursor, another implicit definition,