1 Selector in Sql-Table

In this example, an object is created with a Sql-Table, the content of which shows the albums of the system. The Sql-Table allows you to select records and press a button to perform a process with the selected records.

Object with the set of system albums.

Sql-Table in the form. It is important the Memo of the Sql-Table, because the value will contain the reference to be able to obtain the data selected in the program.

Access Layout/SQL table tab by means of the Box settings option of Celldata box.

Parameterization of the Sql-Table, Main box: The selection field is marked with the value 'Multiple'.

Sentence used:

    <from table='album'>
        <join table='artist' type='left'>
            <on>album.artistid = artist.artistid</on>
        <join table='album_images' type='left'>
            <on>album.albumid = album_images.albumid</on>

The output fields are added, coinciding with the fields used in the statement.

Creation of the 'DROP'('Baja') button with the program that updates the status of the selected albums.

Sentence XSQL-Script used: It is observed that the program contains the Memo of the Sql-Table 'BOX_ALBUM' to obtain the selected values.


        <!-- v_table with the set of rows selected in the form -->
        <set name='v_process_album'>
            <http.request.sqltable.getSelected code='BOX_ALBUM' />
        <!-- For each registration the state is updated -->
            <in prefix='v_'>
                <v_process_album />

                <update table='album'>
                    <column name='state'>B</column>
                        album.albumid = <v_albumid/>





By selecting the records and pressing the 'DROP'('Baja') button the program updates the selected records state.