The execute method executes a Transact-SQL statement or stored procedure in Adaptive Server Enterprise.
execute aseServerName userName password sqlxOptions sql
aseServerName
SOAP string indicating the name of the Adaptive Server Enterprise server in the interfaces file or LDAP server.
At each invocation of the execute method, ASE Web Services uses the value of aseServerName in the same way that ase_server_name is used to start or stop the ASE Web Services Engine. See “Starting and stopping the ASE Web Services Engine” for details.
userName
SOAP string indicating the user ID needed to log in to the Adaptive Server Enterprise.
password
SOAP string indicating the password needed to log in to the Adaptive Server Enterprise.
sqlxOptions
SOAP string indicating one or more option parameters. These parameters specify characteristics of the SQLX result set. The following are valid option parameters:
general
binary={hex | base64}
columnstyle={element | attribute}
entitize={yes | no | cond}
format={yes | no}
header={yes | no}
multipleentitize={yes | no}
multipleresults={all | data}
ncr={non_ascii | no}
nullstyle={attribute | omit}
prefix=“value”
root={yes | no}
rowname=“value”
schemaloc=“value”
statement={yes | no}
tablename=“value”
targetns=“value”
xsidecl={yes | no}
You must provide a value for value. For more information on SQLX functions and options, see XML Services in Adaptive Server Enterprise.
sql
SOAP string indicating the SQL statement or stored procedure to be executed on Adaptive Server Enterprise. The size of the SOAP string specified in the sql parameter is limited by the value of the com.sybase.ase.ws.maxpostsize property setting in the ws.properties file. For a description of this and other properties, see Appendix B, “Configuration Properties.”
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.
You 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”