| declaration | 
function sql_execute2(i_query, def_fd, verbose, html, width, txtvar)
    define i_query	text,			#the sql statemet(s)
	   def_fd,				#output stream
	   flags,				#various behavioural flags
	   width	integer,		#text width
	   vars		byte			#hash containing variables
	   txtvar	text			#where to store the output
 | 
| notes | 
def_fd is any valid stream open for writing, or 0to
signify that the default output should go to txtvar. On exit the
stream is left open.flags is any combination of the following:
constants are defined inK_html produces a simple but effective html outputK_verbose flags that status information should be displayedK_isbatch signals that interactive expansions (picklists
and prompts) should not be allowedK_errorcont has the same effect as whenever error
continueK_dml flags that DML/DDL statements are allowedK_noconf specifies that no confirmation should be asked to the
user before executing DML/DDL statementsK_preserve specifies that variables and sql resources should
be preserved across invocations. Use sql_release
to release resources at the end of the session csqll.4ghWhen K_preserve has been used, it is important not to dispose
of the vars byte variable before having called
sql_release: any such action will ultimately result in
a SQL resources and memory leakWhen using K_preserve and executing multiple scripts at the same
time (eg when invoking 4gwMenus - the 4glWorks ISQL Menus surrogate - scripts
while within the SQSL interpreter viewer) it is important to realize that
scripts might affect each others connections:
altough named connections are private to each script, the default connection is
not, and it is possible for a script to close a database on the default connection
that another script expects to be the current database. This has furthermore
implications on the second script prepared statements. In order to avoid
conflicts, it is best that invocations using the K_preserve flag
(eg the SQSL interpreter viewer) switch to a named connection before proceeding
with anything else. By the same token, it is suggested that invocations not using
the K_preserve flag (eg 4gwMenus) switch to the default connection,
and for good measure, reopen the desired databasethe behaviour of the expansion facility (and in particular the ability to
use pick lists) depends on the user interface in use. See
sql_explode for more information |