Build method: RecordDefn class
Syntax
Build()
Description
This method validates and saves a record definition, drops the view if it exists, and then runs the DDL to create or recreate the view in the database.
Parameters
None.
Returns
A Boolean value representing the following statuses.
| Numeric Value | Constant Value | Description |
|---|---|---|
|
0 |
%MDA_Success |
The record definition is built successfully. |
|
1 |
%MDA_Failed |
The record definition is not built. |
|
4 |
%MDA_Unsupported |
|
|
12 |
%MDA_InvalidDefn |
The SQL text is invalid. |
|
14 |
%MDA_NoWriteAccess |
The user does not have write permissions for the record. |
Example
Local RecordDefn &myNewRecord = CreateRecordDefn();
&myNewRecord.Name = "MYRECORD_VW";
&myNewRecord.Description = "My new record";
&myNewRecord.SQL = "SELECT DISTINCT(PROCESS_INSTANCE) FROM PS_MESSAGE_LOG WHERE MESSAGE_NBR = 1018";
Local RecordFieldDefn &recField = &myNewRecord.AddField("MYNEWFIELD");
If All(&recField) Then
&recField.Key = True;
End-If;
&retVal = &myNewRecord.Save();
/* do error checking … */
&retVal = &myNewRecord.Build();
/* do error checking … */
Related Topics