Presentation is loading. Please wait.

Presentation is loading. Please wait.

Maintain to RDBMS Interaction

Similar presentations


Presentation on theme: "Maintain to RDBMS Interaction"— Presentation transcript:

1 Maintain to RDBMS Interaction
Mark Rawls / Mark Derwin June, 2008

2 Maintain to RDBMS Interaction
When maintaining relational databases, you may want to interact with the database or environment on a more native level. Maintain gives you the ability to issue these commands, both to the environment and the database, directly. Helping developers ensure the most efficient interaction between Maintain and RDBMS servers. Today we will deal with three types of those commands: Controlling the environment, Retrieving RDBMS error codes, and issuing native commands to the database.

3 SYS_MGR commands

4 SYS_MGR commands When issuing SQL commands to the database, both error and successful messages are displayed to the screen. Maintain allows you to retrieve these error codes and branch accordingly. The first thing to do is stop the messages from being echoed to the screen. To accomplish this from inside Maintain, issue a SYS_MGR command. The syntax is: SYS_MGR.FOCSET(“EMGSRV”, ”OFF”); The FOCSET command is used to change the environment. This command turns off EMGSRV so no messages are echoed to the screen.

5 SYS_MGR commands Now that the errors aren’t being displayed, we need to retrieve them inside the Maintain application. We do this with another SYS_MGR command: SYS_MGR.DBMS_ERRORCODE; Once you have this value, you can issue the proper messages to guide your users.

6 SYS_MGR commands Lastly, issuing commands directly to SQL. Some of the things you can do with this command are Create and Drop Tables, Set connection attributes, and Insert data into a Table. The syntax for this command is: SYS_MGR.ENGINE(“enginename”, “command”);

7 Example

8 Example The example shown has a simple SQLMSS database named Summit2008 containing three fields: Field1, Field2, Field3. The form prompts the user to enter values for these fields. Pressing Include builds an SQL statement, and issues it to the interface.

9 Example

10 Looking at the code see that SYS_MGR
Looking at the code see that SYS_MGR.FOCSET command turns off messages to the screen. The SYS_MGR.ENGINE command issues the insert statement directly to the RDBMS

11 Example Lastly, display this included record and any error codes that may have been received from the interface using the SYS_MGR.dbms_errorcode command

12 Example There was no problem including this record to the database. However, if the name of a column was misspelled you may receive an SQLCODE of Instead of the error being echoed to the screen, you control what is displayed. These are just some of the ways that you can manipulate the database and environment from inside of Maintain. A complete list of commands is available online, search on SYS_MGR in Developers Studio help.


Download ppt "Maintain to RDBMS Interaction"

Similar presentations


Ads by Google