Changeset 75fa94be4e985c93bb38f0cefbd198b5e087e454
- Timestamp:
- 01/20/07 18:41:00
(2 years ago)
- Author:
- Christopher Jung <bktheg@web.de>
- git-committer:
- Christopher Jung <bktheg@web.de> 1169314860 +0100
- git-parent:
[264cd5ad5eb9ddb5a94decc2a3793260ae474918]
- git-author:
- Christopher Jung <bktheg@web.de> 1169314860 +0100
- Message:
SQL-Stored Function getIntelliShipID() eingebaut
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| rb6cd4d6 |
r75fa94b |
|
| 110 | 110 | ALTER TABLE ships_baubar CHANGE costs costs VARCHAR( 100 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,' |
|---|
| 111 | 111 | ]]></update> |
|---|
| | 112 | <update type="structure" datum="2007-01-20"><![CDATA[ |
|---|
| | 113 | DELIMITER // |
|---|
| | 114 | CREATE FUNCTION newIntelliShipID(minid INT) RETURNS INT |
|---|
| | 115 | READS SQL DATA |
|---|
| | 116 | BEGIN |
|---|
| | 117 | DECLARE done,sid,shouldId INT DEFAULT 0; |
|---|
| | 118 | DECLARE cur1 CURSOR FOR SELECT DISTINCT abs(id) iid FROM ships WHERE abs(id)>=minid ORDER BY iid; |
|---|
| | 119 | DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET done = 1; |
|---|
| | 120 | |
|---|
| | 121 | OPEN cur1; |
|---|
| | 122 | set shouldId = minid; |
|---|
| | 123 | REPEAT |
|---|
| | 124 | FETCH cur1 INTO sid; |
|---|
| | 125 | IF NOT done THEN |
|---|
| | 126 | IF sid <> shouldId THEN |
|---|
| | 127 | CLOSE cur1; |
|---|
| | 128 | RETURN shouldId; |
|---|
| | 129 | END IF; |
|---|
| | 130 | set shouldId = shouldId+1; |
|---|
| | 131 | END IF; |
|---|
| | 132 | UNTIL done END REPEAT; |
|---|
| | 133 | |
|---|
| | 134 | CLOSE cur1; |
|---|
| | 135 | RETURN shouldId; |
|---|
| | 136 | END; |
|---|
| | 137 | // |
|---|
| | 138 | ]]></update> |
|---|
| 112 | 139 | </updates> |
|---|