Execute

Description

Executes a SQL command.

Applies to

PSCommandClass objects

Syntax

commandobject.Execute( )

Argument

Description

commandobject

A variable that contains a reference to an instance of PSCommandClass

Returns

PSCursorClass object

Usage

At runtime, Execute creates a new ResultSet object using the SQL statement stored with the PSCommandClass object.

Examples

Example 1

The following example performs a database query by executing the SQL statement associated with a command object:

PSConnectionClass myconnect;
PSCommandClass mycommand;
myConnect = psServer.CreateConnection(pageContext, 
	"com.sybase.jdbc2.jdbc.SybDriver",
	"jdbc:sybase:Tds:localhost:2638", "dba", "sql",
	true);
mycommand = myconnect.CreateCommand("SELECT * FROM
		products");
mycommand.Execute();