Executes a SQL command.
PSCommandClass objects
commandobject.Execute( )
Argument |
Description |
---|---|
commandobject |
A variable that contains a reference to an instance of PSCommandClass |
PSCursorClass object
At runtime, Execute has the following behavior:
Application server |
Runtime behavior |
---|---|
ASP |
Creates a new RecordSet object using the SQL statement stored with the PSCommandClass object |
JSP |
Creates a new ResultSet object using the SQL statement stored with the PSCommandClass object |
The following example performs a database query by executing the SQL statement associated with a command object:
mycommand = myconnect.CreateCommand("SELECT * FROM products");
mycommand.Execute();
To use the same example in a JSP target, you must declare “mycommand” as a variable of type PSCommandClass before instantiating it and calling any methods on it.