Tag Archives: Single DML multiple PDBs

Update Multiple PDBs in a Single DML Statement

Update Multiple PDBs in a Single DML Statement of Application container

With DML Query you can also update the multiple PDBs if having same tables and columns or same database.

Example:
Set the country_name column to the value USA in the sh.sales table.
This table exists in two separate PDBs, with container IDs of 7 and 8.
Both PDBs are in the application container named sales_ac. You can connect to the application root as an administrator, and make the update as follows:

CONNECT sales_admin@sales_ac
Password: *******
UPDATE CONTAINERS(sh.sales) sal
SET sal.country_name = 'USA'
WHERE sal.CON_ID IN (7,8);

Example:
Update the column value city_name to DELHI of a table customers present in sales schema of two PDB having con id 7 and 8 in One DML statements.

UPDATE CONTAINERS(sales.customers) ctab
SET ctab.city_name='DELHI'
WHERE ctab.CON_ID IN(7,8) AND
CUSTOMER_ID=3425;

Advertisements