The execute method executes a T-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, Adaptive Server Enterprise Web Services uses the value of aseServerName in the following way:
Adaptive Server Enterprise
Web Services searches for an entry containing the value of aseServerName on
an LDAP server pointed to by the libtcl.cfg file.
Adaptive Server Enterprise Web Services locates the libtcl.cfg file
using the com.sybase.ase.ws.libtcl
entry
in the ws.properties file.
If no entry is found on an LDAP server, Adaptive Server Enterprise Web Services looks for an entry in the interfaces file for Adaptive Server Enterprise.
On Windows systems, this file is named sql.ini.
Adaptive Server Enterprise Web Services locates the interfaces file using
the com.sybase.ase.ws.interfaces
entry
in the ws.properties file.
If no entry is found in the interfaces file for Adaptive Server Enterprise, execution fails for the execute method.
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:
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 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.
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.
Due 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.
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”
Due 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.