%SQL.Manager.API
hidden class %SQL.Manager.API extends %Library.RegisteredObject
This is a system class that allows control of the Cache SQL environment.Used by SQL Manager.
Method Inventory
- AddUser()
- AltUser()
- AlterViewsOwner()
- CheckFileReadOnly()
- CheckIdentifier()
- CheckPriv()
- CheckResource()
- CheckRoutine()
- ChkChr()
- ChkClassName()
- ChkIndices()
- ConnExists()
- CreateLinkProc()
- CreateLinkProcJ()
- CreateLinkTable()
- CreateRole()
- DropTable()
- DropUser()
- EscapeURL()
- FindClassName()
- GetCachedQueryInfo()
- GetDatatype()
- GetDatatypeJ()
- GetDays()
- GetDrives()
- GetPassword()
- GetPort()
- GetQueryHistory()
- GetSchemaInfoClose()
- GetSchemaInfoExecute()
- GetSchemaInfoFetch()
- GetServerPlatForm()
- GrantRole()
- HasGrPriv()
- HasPriv()
- HasRvPriv()
- IsDTSupported()
- IsNumeric()
- IsQueryDuplicate()
- NamespaceSecurityEnabled()
- OpenClassDefinition()
- PurgeAllQueries()
- PurgeAllQueriesAllNS()
- PurgeQueriesForTable()
- PurgeQuery()
- RebuildIndices()
- RevokeRole()
- SQLLogin()
- SaveNamespacePriv()
- SaveObjPriv()
- SaveQuery()
- SaveQueryHistory()
- SaveSysPriv()
- SetServerInitCode()
- StatementFreezePlan()
- SupportDelimitedIdentifiers()
- TableInfoClose()
- TableInfoExecute()
- TableInfoFetch()
- TestDSN()
- TestDecodeDSN()
- TestDecodeJDBC()
- TestJDBC()
- TestJDBCGatewayConnection()
- TestSQLGatewayConnection()
- UpdateQueryHistory()
- ValidUser()
Methods
Properties - Array of properties to modify.
Properties("Enabled") - 0=Disabled, 1=Enabled Properties("ExpirationDate") - Expiration date of account 0=no expiration Properties("FullName") - Full name of the user Properties("InvalidLoginAttempts") - Number of invalid login attempts since last success Properties("InvalidLoginDateTime") - $h value of last invalid login attemp Properties("InvalidLoginDevice") - Last device for invalid login attempt Properties("InvalidLoginStatus") - Last error status for an invalid login attempt Properties("InvalidLoginService") - Last service used for an invalid login attempt Properties("LegacyPassword") - Legacy password for Cache Direct Properties("LoginDateTime") - $h value for last valid login attempt Properties("LoginDevice") - Last valid login device Properties("LoginService") - Last valid login service Properties("NameSpace") - Default Namespace for terminal login Properties("Password") - Cache Authentication password Properties("Roles")- Comma-separated List format of roles Roles are in the format:
"Role1,Role2"
For example:
s Properties("Roles")="%Developer,%Operator"
Properties("Namespace") - Namespace of the user for terminal access
Properties("Routine") - Routine the user runs for terminal access. Routine="" means programmer mode.
If a specific property is not passed in the properties array, the value is not modified.
Returns true or false.
Check each property name. If the property name is a reserved word,
then set appropriate delimited identifier around it.
The propertylist will be updated and returned.
Parameters:
Create a new table from TableLink Wizard based on external datasource Parameters: dsn - Datasource connection name tname - external table name ^ new table name (user can modify) p1 = the "New Cache table name" from the wizard, without schema qualifier p2 = the "New class name" from the wizard with schema qualifier. cols - for each field delimited by @ p1 = column name from the external table p2 = new column caption, defaulted to the column name p3 = iType, data type of the column, from query p4 = iMaxLen, column size p5 = iPrecision p3-p5 are from query "%GTWCatalog:SQLFields": Fields(field).iType = ResultSet.Get("DATATYPE") Fields(field).iMaxLen = Val(ResultSet.Get("COLUMN_SIZE")) Fields(field).iPrecision = ResultSet.Get("DECIMAL_DIGITS") p6 = new column name, defaulted to column name p10 = ResultSet.Get("DATATYPE_NAME")
Create a Role in the Security database.
Parameters:
Name - Name of the role to create
Description - Description of the role
Resources - List format of resource/permission pairs to assign to the role
Resources are in the format:
ResourceName:Permission,ResourceName:Permission
For example:
s Resources="MyResource:RW,MyResource1:RWU"
s Resources="" would create a role with no resources.
Permision values are as follows:
"R"
"W"
"U"
Parameters: droptype - "TABLE" for table, "VIEW" for view, "PROCEDURE" for stored procedure tablename - name of the table to delete (required) SQLCODE - Passed by reference. Returns SQLCODE contains 0 (success) or number < 0 (error) %msg - Passed by reference. If SQLCODE<0, contains error message.
Parameters: user - user or role name to be dropped droptype - "USER" or "ROLE" SQLCODE - Passed by reference. Returns SQLCODE contains 0 (success) or number < 0 (error) %msg - Passed by reference. If SQLCODE<0, contains error message.
Prepare query text to be passed to Show Plan page
Returns a string containing the query text for the cached query. Returns the create and last prepare times by reference.
Source indicates that there is source for the routine and QueryType indicates whether it is a ODBC query or a Dynamic query.
NOTE: LastPrepareTime is obsolete and will not be set
Return a Caché datatype based on an ODBC datatype Parameters: name - Character or integer ODBC type precision - ODBC precision scale - ODBC scale parms - array, passed by reference, which will be filled with parameters
Return Days Before Purge value. Use value set for this namespace if it exists, else use server setting.
Returns a string containing all the available drives.
Return client configuration default port for Show Plan
Get the next query text searching backwards or forwards depending on direction given and the base point is the current index location. Parameters: max - The maximum number of queries to save. currentIndex - ByRef Indicating the current index in the history list direction - search direction (Previous = 1, Next = -1) atend - at the top = -1, at the bottom = 1, in the middle = 0 QueryText - ByRef The query text passed in. If it is null then user is deleting it. gsUsername - User SQL Login name msNamespace - Namespace it is connected (currently not in use)
Returns a string containing the server name, current directory and the platform (VMSDSM, WIN, UNIX, VMS, or DSM).
Parameters: Username - the login name Privs - a list of privileges in the form of 1 or 0 seperated by commas
Parameters: Username - the login name Privs - a list of privileges in the form of 1 or 0 seperated by commas Admin flag - 0 or 1 for GRANT system privileges.
Parameters: Username - the login name Privs - a list of privileges in the form of 1 or 0 seperated by commas
Store QueryHistory upon exiting from SQL Manager. Duplicates are skipped. Then clean up. User can define how many they want to save. The latest used queries up to that number are saved. Parameters: glbIndex - The global index for this SQLMgr session. If it is not greater than 1 then set it and return.
Check if this query is already saved. Don't save duplicates.
The caller is responsible for closing the returned object.
Parameters: acts - actions to grant. * for all actions a for Alter s for Select i for Insert u for Update d for Delete r for References or any combination type - "1" for table, "3" for view, "9" for procedure objs - name of the table or view users - comma delimited list of users g - 0/1 for WITH GRANT OPTION revoke - 1 if revoke (-1 otherwise) SQLCODE - Passed by reference. Returns SQLCODE contains 0 (success) or number < 0 (error) %msg - Passed by reference. If SQLCODE<0, contains error message. GrantedBy - Who the privilege was granted by. If revoke, revoke from user it was granted by fields - optional, $List of field names to grant or revoke the privs on the objs
This method saves a query on the server for ShowPlan to grab.
Insert new record (query history) to the top and push the rest of records down one. If total index reaches maximum then delete the last record Parameters: max - The maximum number of queries to save. QueryText - ByRef If it is not null when passed in, then save it. currentIndex - ByRef Indicating the current index in history list - the query textbox is sitting in QueryText - ByRef The query text passed in. If it is null then user is deleting it. gsUsername - User SQL Login name msNamespace - Namespace it is connected (currently not in use)
This method rearrange the index numbers for the query history and is being called when user clicked the Execute query button or Show plan button.
Queries
Inherited Members
Inherited Methods
- %AddToSaveSet()
- %ClassIsLatestVersion()
- %ClassName()
- %ConstructClone()
- %DispatchClassMethod()
- %DispatchGetModified()
- %DispatchGetProperty()
- %DispatchMethod()
- %DispatchSetModified()
- %DispatchSetMultidimProperty()
- %DispatchSetProperty()
- %Extends()
- %GetParameter()
- %IsA()
- %IsModified()
- %New()
- %NormalizeObject()
- %ObjectModified()
- %OriginalNamespace()
- %PackageName()
- %RemoveFromSaveSet()
- %SerializeObject()
- %SetModified()
- %ValidateObject()