|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Firebird Stored Procedures suspend;
I don't know exactly what suspend do?
I was reading that even if suspend is called in for select statement, for..select continuous to the end, till the last record. This is my example: SQL> select * from worker!! ID Name Salary OID oc ============ ============== ======== ==== 1 Mike 500 1 teacher 2 Mike 1500 1 teacher 3 Mike 800 2 teacher 4 Mike 1800 1 teacher 5 Mike 500 1 teacher 6 Mike 800 1 teacher My procedure: create procedure sum returns(v integer) as declare variable i integer; begin i = 0; for select salary from worker into :v do begin i = i + v; suspend; end v = i; suspend; end!! The procedure returns: SQL> execute procedure sum!! V ============ 500 So my question is that is suspend like in C or C++ return statement. Documents say that even if suspend is called in for ..select statement that this for .. select continuous to the end of for. But I'am guessing from my example that suspend exit's from for..select statement and returns the value to output parameter (v integer) and then the procedure exits. |
|
#2
|
||||
|
||||
|
Don't know C or C++, but seethis for SUSPEND in Firebird stored procs
__________________
My blog Tutorials about OSS databases, DBMonster ... Contribute to OSS Development, fill bug reports! Developer Shed eSupport Commented my.ini/my.cnf (ADD YOUR OWN CONFIG TRICK) An introduction to database normalization Natural or Surrogate key Custom ordering for your results Correlated and uncorrelated subqueries Don't turn your outer joins into inner joins Random data (with a bias) |
![]() |
| Viewing: Dev Shed Forums > Databases > Firebird SQL Development > Firebird Stored Procedures suspend; |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|