Update Method
Last updated
Last updated
Follow these steps to create and test an Update query in QueryDeck:
Select the Base Table
From the left pane, choose the base table you want to update. For this example, we'll use the customers table.
Configure the Query Method
In the left pane:
Change the Method to Update.
Update the Route Name if required.
Define Update Conditions and Values in the Request
Add the fields you want to update along with their new values.
Define conditions (e.g., filters) to specify which rows should be updated. For instance:
Set active to 0 for customers with last_name as Smith.
for example :
This request is to update the last name of mary to "xxx"
Save the Endpoint
Click on the Save button in the bottom-left corner of the side pane.
Your update query endpoint is now ready.
Copy and Test the Endpoint
Copy the endpoint URL by clicking on Request.
Open Postman:
Paste the endpoint URL into the input field.
Change the request method to PUT.
Add a Sample Request Body
Under the Body tab in Postman:
Select raw as the body type.
Paste a sample request body in JSON format. For example:
Click on the Send button in Postman.
You will receive a response indicating that the update was successful.
You have now successfully created and tested your Update
query.