Erm, dynamic code??? :R1 is the result-param of the stored proc.
Exactly, if it was a script parameter the only sense for it would be to create the procedure with "dynamic" code. Means exchanging the parameter through a code piece before executing the command on the database. If i'm correct SQL only supports ( for Zeos SQL Parser usefull) parameters in DML not in DDL statements, so checking for params should treat them not as a parameter but as a part of the ( DDL) statement ( and skip the ':').
So parameters can be used even in scripts where such DDL statements are part of.
If you have SQL-Script using Set Term you should set dtSetTerm. If you are implementing new Term-Types you should add it.
I also know this, but would'nt it be "better" to add support for blocks ( begin .. end)? Then it would be possible to skip code delimiters inside those blocks and one wouldn't have to change the delimiter at least in database "languages" where this is possible. For expamle In Sybase ASA it is possible to use the same code delimiter inside and outside of blocks. To separate the commands you have to parse the block begin (begin, then) and end ( end, endif) statements.
The following correct part of a Sybase ASA script is just one statement and ends also with a ';' as well as the commands between 'then' and 'end if':
if CheckProcedure('CheckIndex')=1 then
create function
FCT.CheckIndex(in tbln varchar(128),in indn varchar(128))
returns integer
begin
declare res integer;
if exists(select 1 from sys.sysindex si join sys.systable st on st.table_id=si.table_id where table_name=tbln and index_name=indn) then
set res=0
else
set res=1
end if
;
return(res)
end;
grant execute on FCT.CheckIndex to FCT;
end if;
I hope i could make my point understandable. I only wanted to discuss the actual behaviour of parameter and command parsing.
Im also willing to make these changes, but i don't have to much knowledge of other DB's outside of Sybase ASA, so i wanted to share my opinion about these two "problems" with others in order to improve the value of the ZEOS Library. It was surely not meant as a support request.