User Guide > Scripting > Script Objects > Project Object
Was this helpful?
Project Object
During a process, you can use the Project object to access process session and step information. Each Project object is indexed by the session or step name.
Properties
To access the properties of a step, the call to the Project object must come after the step is complete. You can access the properties of a process session at any point during the process. The following table shows the available properties for the Project object. Each property has read and write access.
Property
Data Type
Description
Property Type
Server
String
Server name for the specified process session.
Session
UserId
String
Logon name for the server used by a process session.
Session
Password
String
Password for the server used by a process session. When a session password is retrieved using the Password property, the returned password is encrypted. This allows the password to be assigned to a different session without revealing the password.
Session
Database
String
Name of the database used in a process session with a DBMS.
Session
Status
String
Status message for process step.
Step
ReturnCode
Integer
The ReturnCode represents the success or failure of the execution of the script. Successful execution of the script within the script step returns 0. Execution with a compile error, runtime error, user abort, or similar will result in the step ending with an error code that represents the failure.
Step
ErrorCount
Long
Number of errors logged for Transformation step.
Step
OutputRecordCount
Long
Number of records written for Transformation step.
Step
RejectRecordCount
Long
Number of records rejected for Transformation step.
Step
User-defined
Variant
User-defined property.
Session or step
Errors
The following errors may occur when attempting to access the project object.
Exception
Description
ERR_INDEX
Index for variable is not a valid session or step name. This can happen when:
The session or step name is incorrect
You are attempting to access a step before the step has been executed
ERR_PROPFAIL
Invalid property references. This can happen when:
The property name is incorrect
You are attempting to access the incorrect property type (for example, trying to read the server property for a step)
Examples
Logging Step Information
'This example logs the return code and status message for a step called Create Tables:
LogMessage("Info","Return code: " & Project("Create Tables").ReturnCode)
LogMessage("Info","Status: " & Project("Create Tables").Status)
User-Defined Property
'This example stores a value in a user-defined property called myProp:
Project("Create Tables").myProp = 123
Logging SQL Session
'This example shows how to log information about the SQL session:
Dim crlf
crlf = chr(13) & chr(10)
LogMessage("Info","Server: " & Project("test_1").Server & crlf & "Database: " & Project("test_1").Database & crlf & "User ID: " & Project("test_1").UserID & crlf & "Password: " & Project("test_1").Password)
Testing ReturnCode Value
'The following example shows how to test the value of ReturnCode:
Project("Archive File").ReturnCode == 0
Last modified date: 12/03/2024