Module implements stack. In SQL*Plus. Blah! But we need it, so ...
Module name is sqlsn-stack
so in "applications" written using SQLSN the substitution variables starting with m_sqlsn_stack
or g_sqlsn_stack
should not be used.
Initialize using
@&&sqlsn_require sqlsn-stack
or
@&&sqls_require_from_path "<path>/sqlsn-stack"
Globals defined by stack module
Variable contains value of the head of the stack <stack_name>
.
Level of the stack <stack_name>
as "unary" number ;).
Previous level of the stack <stack_name>
as "unary" number ;).
Command scripts provided by the stack
module.
Creates stack <stack_name>
--create stack stack1
@&&stack_create stack1
Pushes value <value>
on stack <stack_name>
--push literal on stack
@&&stack_push stack1 1
@&&stack_push stack1 "test"
--push value of substitution variable on stack
@&&stack_push stack1 &&variable
--push value of substitution variable on stack, which name is stored in variable
@&&stack_push &&stack_name &&variable
Pops value from the head of the stack <stack_name>
into variable <variable>
--pop stack into variable
@&&stack_pop stack1 variable
--pop stack into variable which name is stored in substitution variable
@&&stack_pop stack1 &&variable_name
--pop stack, which name is stored in variable, into variable which name is stored in substitution variable
@&&stack_pop &&stack_name &&variable_name
bump!