Skip to content

useful EXCEL formula to generate SQL DDL/grant scripts

October 8, 2010

TO generate update script:

—————————
Enter the formula as below to generate the multiple statement and drag colums to generate DDL statements
=CONCATENATE($E$3,A2,”‘;”)
Where
$E$3 Excel cell –>update psoprdefn set operpswd = ‘ ‘ where oprid=’  (or similar insert statement)
A2 Excel  cell –> list table names or user name
“’;” –> is a string

To Generate role and permision and grants
———————————————-
=”grant select, update, delete, insert on ” & A1 & ” to user_role;”
=”create public synonym ” & A1 & ” for sysadm.” & A1 & “;”

Where
& A1 & Excel column  contains the table list

Advertisements

From → Oracle DBA

Leave a Comment

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

%d bloggers like this: