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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.