Using Execute.exe

Execute.exe executes a stored procedure or Transact-SQL statement on Adaptive Server Enterprise through ASE Web Services. This sample application invokes the execute Web method.

Syntax

Execute.exe “web_service_URLaseServerName user_ID passwordSQLX_optionoutput_class countsql_statement

Parameters

Example 1

This example checks the version number for Adaptive Server Enterprise.

Execute.exe "http://johndoe-sun:8183/services/ase"
johndoe-sun sa nopasswordspecified "tablename=ws" all 1 
"select @@version"

ASE Web Services returns an XML schema, a DTD, and a result set containing the result of the executed statement.

Example 2

This example executes a stored procedure called booksales on the pubs2 database. The stored procedure returns the number of copies sold for a specified book title ID.

Execute.exe "http://johndoe-sun:8183/services/ase" 
johndoe-sun sa nopasswordspecified 
"columnstyle=attribute,format=no,rowname=wsrow,prefix=
Unnamedcol,nullstyle=attribute,header=yes" all 1 
"execute booksales MC2222"

ASE Web Services returns an XML schema, a DTD, and a result set containing the result of the executed statement.

Example 3

This example executes a SQL query on the pubs2 database. The query returns the last names and cities of residence for authors who do not live in the same city as their publisher.

Execute.exe "http://johndoe-sun:8183/services/ase" 
johndoe-sun sa nopasswordspecified 
"tablename=ws,header=yes,schemaloc='http://www-
edm/remote/svr/xmltestdir/resultset.xsd',targetns='htt
p://www-edm/remote/svr/xmltestdir/'" data 1 "select 
distinct au_lname, authors.city from publishers, 
authors where authors.city not in (select city from 
publishers where authors.city = publishers.city)"

ASE Web Services returns a result set containing the result of the executed statement.