DML Statements

ExpandedToggleIcon        INSERT

Skyvia supports INSERT statements. You don't need to specify values for all table fields in the INSERT statement, you can omit fields that are not required by the target cloud source. The RETURNING clause in INSERT statements is supported. INSERT ... SELECT statement is NOT supported.

The following example creates a new Salesforce Contact:

INSERT INTO Contact 
  (FirstName, LastName, Phone, Email) 
VALUES
  (
   'John',
   'Smith',
   '(650) 450-8820',
   '[email protected]'
  )

 

ExpandedToggleIcon        UPDATE

Skyvia supports creating UPDATE statements with complex WHERE clauses with numerous conditions united with logical operators. It supports various comparison operators for conditions. The FROM clause in the UPDATE statements is not supported.

UPDATE statements can update more than one record in Skyvia. Specifying Id values in the WHERE clause is not required, though adding them improves the performance of UPDATE statements.

The following example increases all prices in a specific Salesforce Pricebook2 by 5%

UPDATE PricebookEntry SET unitprice = round(unitprice * 1.05, 2) WHERE pricebook2id = '01sA000000026tGIAQ'

 

ExpandedToggleIcon        DELETE

Skyvia supports creating DELETE statements with complex WHERE clauses with numerous conditions united with logical operators. It supports various comparison operators for conditions.

DELETE statements can delete more than one record in Skyvia. Specifying Id values in the WHERE clause is not required, though adding them improves the performance of DELETE statements.

The following example deletes all Salesforce contacts not assigned to accounts.

DELETE FROM Contact WHERE AccountID IS NULL

The following example deletes several Salesforce accounts with specified Ids:

DELETE FROM "Account" where "Id" in ('001A000001HSpZUIA1', '001A000001HSpZoIAL', '001A000001HSpdTIAT')