11.1.96    <SQLDIRECT>

Description:   Execute SQL command line.  Executes an SQL command that is one line long.

Syntax:         <SQLDIRECT>sql command line </SQLDIRECT>

                                     

Arguments:    one line SQL command

See Also:       <SQLPREPARE>,<SQLEXECUTE >

Examples:      <SQLDIRECT>DECLARE C1 CURSOR FOR SELECT *  FROM Table1 WHERE data1=1000

<SQLDIRECT>FETCH NEXT C1 INTO text1, text2, text3, text4

                example 2 - a Level 1 command (e.g. Access)

                <SQLDIRECT>INSERT INTO Table1 VALUES ('DEC-31-2222', '15:58:23', 2 , 3)

example 3 - a Level 2 command (e.g. SQL Server)

                <SQLDIRECT>INSERT INTO Table1 VALUES (?, ?,?,?) USING tag1, tag2, tag3, tag4

This command is used to execute an SQL command that is one line long and forms a complete SQL syntax.  On a pushbutton, this limit is 75 characters.  If using a keymacro file, the line limit to 1000 characters. 

For longer than the 75 or 1000 characters limit in a single SQL command line, use <SQLPREPARE> and <SQLEXECUTE> or a WebAccess script. 

<SQLDIRECT> will interact with the related script Action commands SQLPREPARE, SQLDIRECT and SQLEXECUTE allowing a script to initialize or open an SQL session and user keymacro commands to enter data.

WebAccess supports both Level 1 and Level 2 SQL statement.  SQL is an acronym for Structured Query Language.  Please refer to an SQL manual for complete syntax of the SQL language.

The Level 1 versus Level 2 is a significant issue. For example, the Access Database  program supports only Level 1 commands. This will not allow you to insert the value of a Tag using a keymacro.  You must use a script with the GETVAL command.

These commands are used to interact with a Database file like Access or SQL Server through an ODBC DSN. For a complex series of SQL commands, a script may be easier to implement.