Creates an abstract plan.
create plan query plan [into group_name] [and set @new_id]
create plan "select * from titles where price > $20" " (t_scan titles)"
declare @id int create plan "select au_fname, au_lname from authors where au_id = '724-08-9931' " " (i_scan au_id_ix authors)" into dev_plans and set @id select @id
create plan saves the abstract plan in the group specified with into. If no group name is specified, the plan is saved in the currently active plan group.
Queries and abstract plans specified with create plan are not checked for valid SQL syntax, and plans are not checked for valid abstract plan syntax. Also, the plan is not checked for compatibility with the SQL text. You should immediately check all plans created with create plan for correctness by running the query specified in the create plan statement.
If another query plan in the group has the same SQL text, replace mode must be enabled with set plan replace on. Otherwise, the create plan command fails.
You must declare @new_id before using it in the and set clause.
The abstract plan group you specify with into must already exist.
The SAP ASE server ignores any literal parameterization you specify when creating an abstract plan if you enable server-wide literal parameterization using the sp_configure "enable literal autoparam", 1 system procedure.
Performance and Tuning Guide: Optimizer and Abstract Plans.
sp_add_qpgroup, sp_configure “enable literal autoparam”, sp_find_qplan, sp_help_qplan, sp_set_qplan in Reference Manual: Procedures
ANSI SQL – Compliance level: Transact-SQL extension.
No permission is required to use create plan.