Generating Select, Insert, Update and Delete Queries in Kuika

Learn how to create Select, Insert, Update and Delete queries in Kuika.

In an application you developed with Kuika, you can create Select, Insert, Update, and Delete Queries as special actions and use the actions you create on the screens.

This training content consists of the following topics.

  1. Creating a Select Query

  2. Creating an Insert Query

  3. Creating an Update Query

  4. Creating a Delete Query

To create a query in Kuika, first, open the datasources window.

1. Creating a Select Query:

Hover over the Actions sub-tab in the left menu on the Datasources screen. Click on the “+” icon next to the tab.

Create a new action by clicking the New Custom Action button in the menu that opens.

Name your action on the screen that comes up and click the NEXT button.

A SQL Editor will welcome you on the screen that opens. Write the corresponding Select query in SQL Editor.

As an example scenario, let's list the user roles data in the KUserRole table from the Kuika system tables.

You can perform the listing operation using a select query. You can use the query below to list the user roles.

You can create a Select query in Kuika quickly and easily without writing any query expression.

Click the Tables sub-tab in the left menu of the SQL editor screen to quickly and easily create a SQL query. Hover over the KUserRole table. Click on the three dots icon that appears.

Click Add Select Query in the drop-down menu.

After clicking Add Select Query, the Select query will be automatically added to the SQL editor.

You can test the query via the Play button in the upper right corner, and create the special action by clicking the CREATE button.

2. Creating Insert Query:

Hover over the Actions sub-tab in the left menu on the Datasources screen. Click on the “+” icon next to the tab.

Create a new action by clicking the New Custom Action button in the menu that opens.

Name your action on the screen that comes up and click the NEXT button.

A SQL Editor will welcome you on the screen that opens. Write the corresponding Insert query in SQL Editor.

In an example scenario, let's add a new user role from the Kuika system tables to the KUserRole table via Insert query.

You can perform the insertion operation using an insert query. You can use the query below to add a user role.

INSERT INTO KUserRole ( Id, CreatedAt, CreatedUser_Id, IsDeleted, KRole_Id, KUser_Id )
    VALUES ( @Id, @CreatedAt, @CreatedUser_Id, @IsDeleted, @KRole_Id, @KUser_Id );
    END

In Kuika, you can create an Insert query quickly and easily without writing any query expression.

Click the Tables sub-tab in the left menu of the SQL editor screen to quickly and easily create a SQL query. Hover over the KUserRole table. Click on the three dots icon that appears.

Click Add Update Query in the drop-down menu.

The Add Update Query query updates the relevant record if there is a record in the data table that meets the condition, and adds a new record if there is no record.

The Insert query will be automatically added to the SQL editor via the Add Update Query item.

You can create the custom action by clicking the CREATE button in the upper right corner.

3. Creating Update Query:

Hover over the Actions sub-tab in the left menu on the Datasources screen. Click on the “+” icon next to the tab.

Create a new action by clicking the New Custom Action button in the menu that opens.

Name your action on the screen that comes up and click the NEXT button.

A SQL Editor will welcome you on the screen that opens. Write the corresponding Update query in SQL Editor.

KUserRole table from the Kuika system tables through the Update query. You can perform the update process using the update query. You can use the query below for the update process.

UPDATE KUserRole
  SET CreatedAt = @CreatedAt, CreatedUser_Id = @CreatedUser_Id, 
  IsDeleted = @IsDeleted, KRole_Id = @KRole_Id, KUser_Id = @KUser_Id WHERE Id = @Id

You can create the Update query in Kuika quickly and easily without writing any query expression.

Tables sub-tab in the left menu of the SQL editor screen to quickly and easily create a SQL query. Hover over the KUserRole table. Click on the three dots icon that appears.

Click Add Update Query in the drop-down menu.

The Add Update Query query updates the relevant record if there is a record in the data table that meets the condition, and adds a new record if there is no record.

Update query will be automatically added to the SQL editor via the Add Update Query item.

You can create the custom action by clicking the CREATE button in the upper right corner.

4. Creating a Delete Query:

Hover over the Actions sub-tab in the left menu on the Datasources screen. Click on the + icon next to the tab.

Create a new action by clicking the New Custom Action button in the menu that opens.

Name your action on the screen that comes up and click the NEXT button.

A SQL Editor will welcome you on the screen that opens. Write the corresponding Delete query in SQL Editor.

KUserRole table from the Kuika system tables through the Delete query.

You can perform the deletion using the delete query. You can use the query below for deletion.

DELETE FROM KUserRole WHERE Id = @Id

You can create the Delete query in Kuika quickly and easily without writing any query expression.

Tables sub-tab in the left menu of the SQL editor screen to quickly and easily create a SQL query. Hover over the KUserRole table. Click on the three dots icon that appears.

Click Add Delete Query in the drop-down menu.

Delete query will be automatically added to the SQL editor via the Add Delete Query item. You can create the custom action by clicking the CREATE button in the upper right corner.

Last updated