47 users using DBSP now!
home -> documentation -> environment guide -> Modifying information: The QRYEXEC tag


Until this moment, we have only been retrieving information from the database. But now is time to make some modifications to the data according to our requirements. This is done with the QRYEXEC tag.

The QRYEXEC tag

The QRYEXEC tag is used to insert, update or delete records. It could be used also for executing stored procedures that modify any database information.

You should use the QRYEXEC tag when the SQL sentence does not return a result set. Otherwise, if you are interested in using some information returned after the execution of the query, you must use the DATASET tag instead.

QRYEXEC Tag modes

There are two possible modes using the QRYEXEC tag:

Mode A: Immediate execution

<#QRYEXEC ALIAS="DEMO" QUERYID="12"/>

This query is executed immediately after being interpreted.


Mode B: Response execution

<#QRYEXEC ALIAS=DEMO" QUERYID="12" DOC="page2.dbsp"/>

In this case, the QRYEXEC tag is substituted by an URL. When this URL became requested, the assigned query will be executed and the defined document will be sent as the response. You could use this mode, in an HTML anchor or in the action property of a form. Check both modes in the examples section.

Related topics

Examples

Example 1. A simple insert and delete.

This example shows you how to insert and delete records from a table.

Source code
Test example



Example 2. Inserting multiple records.

This example shows you how to insert multiple records into a table.

Source code
Test example

Previous | Next