Custom Actions: SQLSelect & SQLUpdate

 


SQLSelect

Performs the select statement and assigns values to the questions from the listed fieldnames.

SQLSelect

Spec: SQLSelect [beforepagecomposed,|whenpagereceived,][selectonlyifquestionempty,]question[=field],[question[=field]]

Executes before page composed (beforepagecomposed) or after page submitted (whenpagereceived); default is whenpagereceived. field can be the name of a variable in the table, or can be a number to indicate the Nth value.

Question text contains the SQL statement itself. Question Piping can be used.

If selectonlyifquestionempty is present, the first question name will be checked to see if it is already filled and if so the query won't be performed at all.

Examples:
SELECT * FROM mytable WHERE EMPLOYEE_ID_NUMBER='[/employee_id]'
SQLSelect employee_name=EMPLOYEE_FULL_NAME,employee_birthdate=EMPLOYEE_BIRTH_DATE

SELECT MYSEQUENCE.NEXTVAL from DUAL
SQLSelect sequencenumber=1


If no records are selected, destination fields set to ""


SQLUpdate

Performs a SQL statement of type INSERT, UPDATE or DELETE

SQLUpdate

Spec: SQLSelect sql_statement

sql_statement can be an INSERT, UPDATE or DELETE type statement. Question piping can be used , specially [/authenticateduserid], [/spotname], [/pollname] as shown in examples below:

SQLUpdate UPDATE mytable SET time_stamp=sysdate WHERE userid='[/authenticateduserid]' AND spotname='[/spotname]' AND pollname='[/pollname]'

SQLUpdate INSERT INTO mytable ( userid, spotname, pollname, time_stamp ) VALUES ( [/authenticateduserid], [/spotname], [/pollname], null );