Step 5: code your application to use the user object – PB Docs 125

Step 5: code your application to use the user object

What you have done so far

In the previous steps, you defined the GIVE_RAISE remote
stored procedure as an external function for the u_trans_database standard
class user object. You then specified u_trans_database as
the default global variable type for SQLCA.
These steps give your PowerBuilder application access to the properties
and functions encapsulated in the user object.

What you do now

You now need to write code that uses the user object to perform
the necessary processing.

In your application script, you can use PowerScript dot notation
to call the stored procedure functions you defined for the user
object, just as you do when using SQLCA for
all other PowerBuilder objects. The dot notation syntax is:

For example, you can call the GIVE_RAISE stored
procedure with code similar to the following:

proc.png To code your application to use the user object:

  1. Open the object or control for which you
    want to write a script.

  2. Select the event for which you want to write the
    script.

    For instructions on using the Script view,
    see the PowerBuilder Users Guide.

  3. Write code that uses the user object to do the
    necessary processing for your application.

    Here is a simple code example that connects to an Oracle database,
    calls the GIVE_RAISE stored procedure
    to calculate the raise, displays a message box with the new salary,
    and disconnects from the database:

  4. Compile the script to save your changes.

note.png Using error checking

An actual script would include error checking after the CONNECT statement, DISCONNECT statement,
and call to the GIVE_RAISE procedure.
For details, see “Error handling after
a SQL statement”
.


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x