execute

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

Syntax

execute aseServerName userName password  sqlxOptions sql

Parameters

Examples

Example 1 Checks the version number for Adaptive Server Enterprise.

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

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

NoteYou must provide the userName and password parameters to invoke the execute method. Adaptive Server verifies it can execute the specified SQL statement.

Example 2 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”