There are multiple parts to my requirements, so I'll list all, but a solution to any part/s will be appreciated.
My spreadsheet looks something like this (somehow the spaces don't stay!):
A(Name) B C D
fam_write_pp fam WRITE Family1_description
fam_pic DELETE
fam_doc DELETE
fam_restrict_pp fam NONE Family2
fam_sht DELETE
From the above, I then need to create a script which uses this information, and would translate to something like this (part of it is same for all)
create,ob,pp
set,ob,l,name
fam_write_pp <-----this is value from A1
set,ob,l,owner
dbo
set,c,l,description
Family1 description <-----this is value from D1
set,c,l,pp_class
3
grant,pp,l,dm_owner,7,change_owner,change_location,execute_proc <-----this is standard, to be repeated for all
grant,pp,l,dm_world,0,execute_proc <-----this is standard, to be repeated for all
grant,pp,l,fam,6,change_owner,change_permit,change_state,change_location,execute_proc <-----the number of lines here correspond to the number of entries in column B for each Name
grant,pp,l,fam_pic,7,change_owner,change_location,execute_proc
grant,pp,l,fam_doc,7,change_owner,change_location,execute_proc
save,pp,l
create,ob,pp
set,ob,l,name
fam_restrict_pp <-----this is value from A2
set,ob,l,owner
dbo
set,c,l,description
Family2 <-----this is value from D2
set,c,l,pp_class
3
grant,pp,l,dm_owner,7,change_owner,change_location,execute_proc <-----this is standard, to be repeated for all
grant,pp,l,dm_world,0,execute_proc <-----this is standard, to be repeated for all
grant,pp,l,fam,0,execute_proc the number of lines here correspond to the number of entries in column B for each Name. In this case 2
grant,pp,l,fam_sht,7,change_owner,change_location,execute_proc
save,pp,l
Hope the pattern is apparent.
The thing to note is that based on the values in column C, the numbers associated changes and so does the rest of the line.
So for example DELETE corresponds to a number 7 and the rest of the line would be "change_owner,change_location,execute_proc "
So there is a pattern to produce the grant bits.
For each value in column A there needs to be a corresponding script as in above example and ideally i'd like this to be written to a text file.
There needs to be a single blank line between each script for value in Name (column A)
Also, the number of entries in B can vary.
Hope this makes sense!
Even if I get a solution just so I can populate the 'grant' commands, that would help.
Many Many thanks...and I hope it makes sense!
My spreadsheet looks something like this (somehow the spaces don't stay!):
A(Name) B C D
fam_write_pp fam WRITE Family1_description
fam_pic DELETE
fam_doc DELETE
fam_restrict_pp fam NONE Family2
fam_sht DELETE
From the above, I then need to create a script which uses this information, and would translate to something like this (part of it is same for all)
create,ob,pp
set,ob,l,name
fam_write_pp <-----this is value from A1
set,ob,l,owner
dbo
set,c,l,description
Family1 description <-----this is value from D1
set,c,l,pp_class
3
grant,pp,l,dm_owner,7,change_owner,change_location,execute_proc <-----this is standard, to be repeated for all
grant,pp,l,dm_world,0,execute_proc <-----this is standard, to be repeated for all
grant,pp,l,fam,6,change_owner,change_permit,change_state,change_location,execute_proc <-----the number of lines here correspond to the number of entries in column B for each Name
grant,pp,l,fam_pic,7,change_owner,change_location,execute_proc
grant,pp,l,fam_doc,7,change_owner,change_location,execute_proc
save,pp,l
create,ob,pp
set,ob,l,name
fam_restrict_pp <-----this is value from A2
set,ob,l,owner
dbo
set,c,l,description
Family2 <-----this is value from D2
set,c,l,pp_class
3
grant,pp,l,dm_owner,7,change_owner,change_location,execute_proc <-----this is standard, to be repeated for all
grant,pp,l,dm_world,0,execute_proc <-----this is standard, to be repeated for all
grant,pp,l,fam,0,execute_proc the number of lines here correspond to the number of entries in column B for each Name. In this case 2
grant,pp,l,fam_sht,7,change_owner,change_location,execute_proc
save,pp,l
Hope the pattern is apparent.
The thing to note is that based on the values in column C, the numbers associated changes and so does the rest of the line.
So for example DELETE corresponds to a number 7 and the rest of the line would be "change_owner,change_location,execute_proc "
So there is a pattern to produce the grant bits.
For each value in column A there needs to be a corresponding script as in above example and ideally i'd like this to be written to a text file.
There needs to be a single blank line between each script for value in Name (column A)
Also, the number of entries in B can vary.
Hope this makes sense!
Even if I get a solution just so I can populate the 'grant' commands, that would help.
Many Many thanks...and I hope it makes sense!