# query

## Description

A query is a request for data or information from a database table or combination of tables.

## Input / Parameters

| No | Name    | Description                                              | Data Type | Required | Example                                    |
| -- | ------- | -------------------------------------------------------- | --------- | -------- | ------------------------------------------ |
| 1  | dataset | Name of the dataset to be read in local table.           | String    | Yes      |                                            |
| 2  | query   | A request for data or information from a database table. | String    | Yes      | <https://www.javatpoint.com/mysql-queries> |

## Output

## Callback

## Video

## Example

The user wants to update the data for table tbl\_sqllite\_customer by using the query.

### Step

1. Create the SQLiteTable in Services and fill the info such as Name and fields. Call the function "insert" for insert data into table before you update.Define the dataset, set the toObject to dt and define code and name.\
   Name: tbl\_sqllite\_customer\
   fields: code and name\
   Dataset: tbl\_sqllite\_customer\
   dt: toObject\
   code: B\
   name: abc\
   name: aaa\
   code: 1111<br>

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-be58615056d7ffcbb9d071525cb6467de541e97c%2Fquery-step-1.png?alt=media)

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-44fd93c60ecce1acf78e57395901260d95862dc5%2Fquery-step-2.png?alt=media)

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-d3129fcd9f4b29ae7a3dd6d9a8ca993baf701321%2Fquery-step-3.png?alt=media)
2. Call the function "query" for update the data and define the dataset and query.\
   dataset: tbl\_sqllite\_customer\
   query: UPDATE tbl\_sqllite\_customer SET code = 'A1' WHERE code='B'<br>

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-a45db9ac23193bf87a44ae161f911183892aa548%2Fquery-step-4.png?alt=media)
3. Call the function "loadData" and define the dataset.\
   dataset: tbl\_sqllite\_customer<br>

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-8620e1162123553d937b29507b18885665b87bf1%2Fquery-step-5.png?alt=media)

### Result

## Links

### Notes

insert

1. Call the function "insert" and define the dataset and set the function "toObject" to data & define the code and name.\
   ( We assumed you have created the SQLiteTable in Services and fill the info such as Name and fields. )\
   Dataset: tbl\_sqllite\_customer\
   dt: toObject\
   code: B\
   name: abc\
   name: aaa\
   code: 1111<br>

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-f8361ed415825dde463421205d80368f2d2e5dc8%2Fquery-step-6.png?alt=media)

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-75af7db1b1b29d38337bc5d666806212b8f5721a%2Fquery-step-7.png?alt=media)
2. Call the function "loadData" and define the dataset.\
   dataset: tbl\_sqllite\_customer<br>

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-6a1ed7bc99a85ad568387bf3d814f6574ba78209%2Fquery-step-8.png?alt=media)

updateby

1. Call the function "updateBy" and define the dataset, by, operator and value.\
   ( We assumed you have created the SQLiteTable in Services and fill the info such as Name and fields. )\
   Dataset: tbl\_sqllite\_customer\
   by: code\
   operator: =\
   value: Code AAA<br>

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-42bd6ab9202d982de7374e26da3f7bbdc932e677%2Fquery-step-9.png?alt=media)

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-ecc854c67fa4d44912ff2ed83d0cb91cab33e53f%2Fquery-step-10.png?alt=media)
2. Call the function "loadData" and define the dataset.\
   dataset: tbl\_sqllite\_customer<br>

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-382bd188fd8d862c24e12749afaa2e763037d48a%2Fquery-step-11.png?alt=media)

deleteBy

1. Call the function "deleteBy" and define the dataset, by, and value.\
   ( We assumed you have created the SQLiteTable in Services and fill the info such as Name and fields. )\
   Dataset: tbl\_sqllite\_customer\
   by: code\
   value: Code BBB<br>

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-48f593178c79bdc987dd51c452afad98657932fe%2Fquery-step-12.png?alt=media)
2. Call the function "loadData" and define the dataset.\
   dataset: tbl\_sqllite\_customer<br>

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-a450c5f766086b2084c6444c9382c15e48afb2d8%2Fquery-step-13.png?alt=media)
