Execute.exe executes a stored procedure or T-SQL statement on Adaptive Server Enterprise through Adaptive Server Enterprise Web Services. This sample application invokes the execute Web method.
Execute.exe “web_service_URL” aseServerName user_ID password “SQLX_option” output_class count “sql_statement”
web_service_URL
The location of the Web service being used.
aseServerName
SOAP string indicating the name of the Adaptive Server Enterprise server in the sql.ini file or LDAP server.
user_ID
The user ID needed to log in to the Adaptive Server Enterprise.
password
The password needed to log in to the Adaptive Server Enterprise.
SQLX option
String indicating one or more option parameters. These parameters specify characteristics of the SQLX result set. The following are valid option parameters:
binary={hex | base64}
columnstyle={element | attribute}
format={yes | no}
header={yes | no}
nullstyle={attribute | omit}
prefix=“value”
root={yes | no}
rowname=“value”
schemaloc=“value”
statement={yes | no}
tablename=“value”
targetns=“value”
You must provide values for value. For more information on SQLX functions and options, see XML Services in Adaptive Server Enterprise.
output_class
The kind of output desired. The following are valid values for this parameter:
schema - return an XML schema
dtd - return an XML DTD
data - return a result set
all - return schema, DTD, and data
count
The number of times to execute.
sql_statement
The statement to be executed on Adaptive Server Enterprise. This statement must be delimited by double quotes.
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"
Adaptive Server Enterprise Web Services returns an XML schema, a DTD, and a result set containing the result of the executed statement.
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"
Adaptive Server Enterprise Web Services returns an XML schema, a DTD, and a result set containing the result of the executed statement.
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='http://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)"
Adaptive Server Enterprise Web Services returns a result set containing the result of the executed statement.