%XDBC.Gateway.ResultSet
abstract class %XDBC.Gateway.ResultSet extends %Library.RegisteredObject
FOR INTERNAL USE - do not invoke directlyProperty Inventory
- %CurrentResult
- %Message
- %OutputColumnCount
- %ROWCOUNT
- %ROWID
- %ResultColumnCount
- %SQLCODE
- %StatementType
- %StatementTypeName
Method Inventory
- %ConstructClone()
- %DispatchMethod()
- %NormalizeObject()
- %Print()
- %SerializeObject()
- %ValidateObject()
- Close()
- Get()
- GetBuffer()
- GetFetchSize()
- GetMetaData()
- GetObject()
- GetRow()
- GetRows()
- Next()
- SetFetchSize()
- WasNull()
Properties
It is the responsibility of the stored procedure author to explicitly set %ROWCOUNT.
For example:
&sql(UPDATE Person Set Name="Mo" WHERE Age > :number)
Set result.%SQLCODE=SQLCODE
Set result.%ROWCOUNT=%ROWCOUNT
%SQLCODE indicates whether or not the statement was executed successfully. If %SQLCODE is not negative (greater than or equal to zero) then the statement was successfully executed. Otherwise, the value of %SQLCODE contains the error code and the %Message property might contain more information about the error.
%StatementTypeName is the statement type name.
1 | SELECT |
2 | INSERT (also 'INSERT OR UPDATE') |
3 | UPDATE |
4 | DELETE |
5 | COMMIT |
6 | ROLLBACK |
7 | GRANT |
8 | REVOKE |
9 | CREATE TABLE |
10 | ALTER TABLE |
11 | DROP TABLE |
12 | CREATE VIEW |
13 | ALTER VIEW |
14 | DROP VIEW |
15 | CREATE INDEX |
16 | ALTER INDEX (Not supported) |
17 | DROP INDEX |
18 | CREATE ROLE |
19 | DROP ROLE |
20 | SET TRANSACTION |
21 | START TRANSACTION |
22 | %INTRANSACTION |
23 | %BEGTRANS (Alias for START TRANSACTION) |
24 | %INTRANS (Alias for %INTRANSACTION) |
25 | GET (Not supported) |
26 | SET OPTION |
27 | STATISTICS (UPDATE STATISTICS, not supported)) |
28 | %CHECKPRIV |
29 | CREATE USER |
30 | ALTER USER |
31 | DROP USER |
32 | %CHECKPRIV (SQL Admin Privilege) |
33 | GRANT (SQL Admin Privilege) |
34 | REVOKE (SQL Admin Privilege) |
35 | CREATE FUNCTION |
36 | CREATE METHOD |
37 | CREATE PROCEDURE |
38 | CREATE QUERY |
39 | DROP FUNCTION |
40 | DROP METHOD |
41 | DROP PROCEDURE |
42 | DROP QUERY |
43 | CREATE TRIGGER |
44 | DROP TRIGGER |
45 | CALL |
46 | SAVEPOINT |
47 | LOCK TABLE |
48 | UNLOCK TABLE |
49 | CREATE DATABASE |
50 | DROP DATABASE |
51 | USE DATABASE |
52 | TUNE TABLE |
53 | DECLARE |
54 | CREATE MODEL |
55 | DROP MODEL |
56 | TRAIN MODEL |
57 | ALTER MODEL |
58 | VALIDATE MODEL |
59 | SET ML CONFIGURATION |
60 | CREATE ML CONFIGURATION |
61 | ALTER ML CONFIGURATION |
62 | DROP ML CONFIGURATION |
63 | FREEZE PLANS |
64 | UNFREEZE PLANS |
65 | PURGE |
66 | BUILD INDEX |
67 | LOAD |
"" | Anything not list above |
Methods
Note that even if deep=0 when you clone a parent object in a parent child relationship or a one object of a one to many relationship then it will construct clones of all the child/many objects. This is because a child/many object can only point at a single parent and so if we did not create a clone of these then you would have a relationship with zero items in it. If you really just want to clone the object without these child/many objects then pass deep=-1 to this method.
After the clone is constructed it will call %OnConstructClone(object,deep,.cloned) on the clone if it is defined so that you can perform any additional steps e.g. taking out a lock. This works just the same way as %OnNew() does.
The object is the oref of the original object that was cloned. The cloned array is just used internally when doing a deep clone to prevent recursive loops, do not pass anything in at all for this parameter on the initial call. If you write a %OnConstructClone and from here you wish to call %ConstructClone on another object pass in the cloned array, e.g. 'Do oref.%ConstructClone(1,.cloned)' so that it can prevent recursive loops.
The location is used internally to pass the new location for stream objects.
This method is not meant to be called directly. It is called by %Save and by %GetSwizzleObject.
This method validates an object.
The %Save() method of a persistent class calls this method before filing any objects in the database. The %ValidateObject() of a referencing object can call it. You can also call it explicitly at any time.
%ValidateObject() does the following:
- If present, it will call a user-supplied %OnValidateObject() method.
- It checks if any required property values are missing.
- If the PROPERTYVALIDATION class parameter is set to ValidateOnSave, it validates each non-null property value by calling the property method IsValid on each literal property and the %ValidateObject method for each object-valued embedded object property (properties whose type extend %SerialObject).
- If checkserial is 1, it forces the checking of any embedded object properties by calling their %ValidateObject method after swizzling this property.
- If checkserial is 2, it forces the checking of any collections of serial types by iterating over those collections and calling their %ValidateObject() method after swizzling this property, in addition to the validation that occurs when checkserial is 1.
%ValidateObject() returns a %Status indicating success or error. It is up to the caller to process the error value.
%ValidateObject() does not validate object-valued reference properties (properties whose type extends %Persistent) due to the possibility of circular dependencies between objects. The %Save() method of a persistent class automatically detects and handles circular references between objects. If you require the validation of reference properties, you can override this method in a subclass or call %Save() directly.
If colname is not a valid column name, this method throws a error.
For example, suppose rset.%GetRows(10,.tenrows,.sc) is called:
- If there are more then 10 rows remaining to be fetched from the result set, tenrows=10, tenrows(1)=$lb(first row's contents), ..., tenrows(10)=$lb(tenth row's contents), and %GetRows() will return 1.
- If there are 5 rows remaining to be fetched from the result set, tenrows=5, tenrows(1)=$lb(first row's contents), ..., tenrows(5)=$lb(fifth row's contents), and %GetRows() will return 0.
- If there are 0 rows remaining to be fetched from the result set, tenrows=0 and %GetRows() will return 0.
This implementation is overridden by classes that implement the result set interface.