execute

The execute method executes a T-SQL statement or stored procedure in Adaptive Server Enterprise.

Syntax

execute aseServerName userName password  sqlxOptions sql

Parameters

Example 1

This example checks the version number for Adaptive Server Enterprise.

execute johndoe-sun sa password "tablename=ws" "select @@version"

This example invokes the Web method directly. Adaptive Server Enterprise Web Services returns an XML schema, a DTD, and a result set containing the result of the executed statement.

NoteDue to a limitation with JDBC, print statements are not captured when stored procedures are executed through Adaptive Server Enterprise Web Services. Other limitations concerning the use of SQL queries with JDBC also apply to Adaptive Server Enterprise Web Services.

Example 2

This example computes a left join on tables in the pubs2 database.

execute johndoe-sun sa password "tablename=ws" 
"select title, price, au_fname, au_lname from (titles
left join titleauthor on titles.title_id =
titleauthor.title_id ) left join authors on
titleauthor.au_id = authors.au_id and titles.price >
$15.00”

NoteDue to a limitation with JDBC, print statements are not captured when stored procedures are executed through Adaptive Server Enterprise Web Services. Other limitations concerning the use of SQL queries with JDBC also apply to Adaptive Server Enterprise Web Services.