Need help for PL/SQL Script

If I wanted to give access to all my tables in my schema to a role, how could I do that.

Thus, rather than run a query for each table 100 times, looking for something
who would have a loop.

For each Table in my schema, give select, update and insert, but remove it from user role?

?

Thank you advance, 10 G here.
BEGIN
    FOR v_REC IN (SELECT TABLE_NAME FROM USER_TABLES) LOOP
      EXECUTE IMMEDIATE 'GRANT SELECT ON ' || v_REC.TABLE_NAME || ' TO your_role_name';
    END LOOP;
END;
/

SY.

Tags: Database

Similar Questions

  • I need help for an asp script, I installed

    I installed a user name & password using an asp script for one of my Web page and when I put the right username and password, it uses the domain name, then the file is correct, however it puts the name of the file to the address once again. Someone has an idea? I have accumulated my brain

    Hi Bufordhurley,

    The question you posted would be better suited in the MSDN Forums. I would recommend posting your query in the MSDN Forums for further assistance:

    http://social.msdn.Microsoft.com/forums/en/categories/

  • Hello, need help for Adobe Reader DC playing animation files that are specified in the pdf output by script Latex Beamer. My Adobe Reader DC refuse to open any format that I gave him.  Thank you very much

    Hello, need help for Adobe Reader DC playing animation files that are specified in the pdf output by script Latex Beamer. My Adobe Reader DC refuse to open any format that I gave him.  Thank you very much

    Hey ihorl18351266,

    Please note that you can open PDF files using only the CD player. Any other format will not be supported by the software.

    Kind regards

    Ana Maria

  • I need help for the upgrade of my current system.

    I need help for the upgrade of my current system.

    I have SBS 2008 with (Exch 2007, SQL 2005, Sharepoint, backupexec 2010 for sbs) licenses.

    I want to make the larger environment using the following:

    (1) apply Virtualization

    (2) apply to the failover process (clustering)

    "(3) the environment must support adding server terminal server, ERP server, exchange server, domain controller, backup manager.

    Storage 4) that supports Raid (1 and 5)

    UTM excellent 6) that supports (SSL VPN, VPN Global)

    suitable backup solution 7)

    (8) good antivirus for clients

    my questions:

    (1) can you provide me with a good design for this environment

    (2) should I choose what operating system:

    Microsoft datacenter or company

    I know datacenter provide us the unlimited VM but needs per processor license

    so if I have two Grouped servers I want to buy 4 licenses

    and just 4 VMs per company license... to say that we have two servers and maintain 8 vms so wat happened if 1 goes down... How can I migrate the 4 virtual machines on the server failed to another server group... ? should I buy enterprise license?

    (3) if I get the SAN storage for data... How can I save this storage... should I get another SAN?

    (4) how can I upgrade SBS stad single server (windows standrad) without losing the licenses as Exch 2007, SQL 2005, sharepoint.is it a must to buy an edition full std server or there is a way to upgrade (license wise, I mean)?

    (5) what about win2k8 license for VM:

    lets say we have physical that has windows license so that enough to have windows for VM or should I buy windows for VM licenses?

    (6) can I use backExec license for SBS with windows 2008 standard

    (7) who better to virtualization AMD or INTEL

    (8) hyper V or VMware?

    (9) what of Microsoft data protection Manager... is this good?

    (10) what virtual machine manager? What are the benefites keys

    Thanks in advance

    Hello AnasAI,

    You can find the Server forums on TechNet support, please create a new post at the following link:

    http://social.technet.Microsoft.com/forums/en/category/WindowsServer/

  • Need help with a SQL query

    Hello

    I have a data in table (raj_table) with columns (char11) raj_id, raj_number (varchar2 (15)), raj_format (NUMBER), Primary_ID (identity with the values of the primary key column)

    Primary_ID raj_id Raj_number Raj_format

    1                            raj                 rajvend                      1

    2                            raj                 rajvend                      1

    3                            raj                 rajvendor1                 2

    4                            raj                 rajvendor1                 2

    5                            raj                 rajvendor1                 2

    6                            raj                 rajvendor2                 3

    I used under SQL to get query output as below, but has not achieved the required result:

    Select client_id vendor_number, vendor_format, primary_id, row_number() on sl_no (client_id partition, primary_id, vendor_format order of client_id primary_id, vendor_format, vendor_number, vendor_number)

    from raj_table by sl_no asc

    SL_NO raj_id raj_number raj_format primary_id

    1                   1                   raj              rajvendor                 1

    1                   2                  raj              rajvendor                 1

    2                   3                   raj              rajvendor1                2

    2                   4                   raj              rajvendor1                2

    2                   5                  raj               rajvendor1                2

    3                   6                    raj              rajvendor2                3

    I need help with a SQL query to get the result as above without using the group by clause. I want to bring together the combination of separate line of the three columns (raj_id, raj_number, raj_format) and add a unique serial number for each online game (SL_NO column below). So, above there are 3 unique set of (raj_id, raj_number, raj_format) I can get in a group by clause, but I can not add prmiary_id, SL_NO values if I group by clause. I used the analytical functions like row_number() but no luck. Need solution for this.

    with t as)

    Select 'raj' raj_id, 'rajvend' raj_number, 1 raj_format, 1 primary_id Union double all the

    Select option 2, 'raj', 'rajvend', 1 double Union all

    Select 3, 'raj', 'rajvendor1', 2 double Union all

    Select 4, 'raj', 'rajvendor1', 2 double Union all

    Select 5, 'raj', 'rajvendor1', 2 double Union all

    Select 6, 'raj', 'rajvendor2', 3 double

    )

    Select dense_rank() over (order of raj_id, raj_number, raj_format) sl_no,

    t.*

    t

    order by primary_id

    /

    PRIMARY_ID RAJ RAJ_NUMBER RAJ_FORMAT SL_NO
    ---------- ---------- --- ---------- ----------
    1 1 raj rajvend 1
    1 2 raj rajvend 1
    2 3 raj rajvendor1 2
    2 4 raj rajvendor1 2
    2 5 raj rajvendor1 2
    3 6 raj rajvendor2 3

    6 selected lines.

    SQL >

    SY.

  • I need help to write a script that detects the first instance of a paragraph style and then change

    I need help to write a script that detects the first instance of a paragraph style and then he goes to a different paragraph style.  I don't necessarily need someone to write all this, by the biggest problem is to find how to find just the first instance of the paragraph style.  Any help would be greatly appreciated, thank you!

    Hello

    then try this with your active doc:

    ....................

    myDoc var = app.activeDocument;

    mStyle var = myDoc.paragraphStyles.item ("PS_NameToFind"); change the name to paraStyle

    var mStyle_1 = myDoc.paragraphStyles.item ("PS_NameToChange"); change the name to paraStyle

    var mFrames = myDoc.pages.everyItem ().textFrames.everyItem () .getElements ();

    app.findTextPreferences = null;

    app.findTextPreferences.appliedParagraphStyle = mStyle;

    for (var k = 0; k)< mframes.length;="">

    {

    currFound = mFrames [k] .findText ();

    If (currFound.length > 0)

    currFound [0] .paragraphs [0] .appliedParagraphStyle = mStyle_1;

    }

    app.findTextPreferences = null;

    ................

    Rgds

  • Need help with query SQL Inline views + Group

    Hello gurus,

    I would really appreciate your time and effort on this application. I have the following data set.

    Reference_No---Check_Number---Check_Date---description---Invoice_Number---Invoice_Type---Paid_Amount---Vendor_Number
    1234567 11223 - 05/07/2008 -paid for cleaning- 44345563-I-* 20.00 *---19
    1234567 11223 - 05/07/2008 - 44345563 -a--10,00---19 ofbad quality adjustment
    7654321 11223 - 05/07/2008 - setting the last billing cycle - 23543556 - A - 50.00 - 19
    4653456 11223 - 05/07/2008 - paid for cleaning - 35654765 - I - 30, 00-19

    Please ignore '-' added for clarity

    I'm writing a paid_amount based on Reference_No, Check_Number, Payment_Date, Invoice_Number, aggregate query Invoice_Type, Vendor_Number and display description with Invoice_type 'I' when there are multiple records with the same Reference_No, Check_Number, Payment_Date, Invoice_Type, Invoice_Number, Vendor_Number. When there are no more records I want to display the respective Description.

    The query should return the following data set

    Reference_No---Check_Number---Check_Date---description---Invoice_Number---Invoice_Type---Paid_Amount---Vendor_Number
    1234567 11223 - 05/07/2008 -paid for cleaning- 44345563-I-* 10.00 *---19
    7654321 11223 - 05/07/2008 - setting the last billing cycle - 23543556 - A - 50.00 - 19
    4653456 11223 - 05/07/2008 - paid for cleaning - 35654765 - I - 30, 00-19
    Here's my query. I'm a little lost.

    Select b., A.sequence_id, A.check_date, A.check_number, A.invoice_number, A.amount, A.vendor_number
    de)
    Select sequence_id, check_number, check_date, invoice_number, sum (paid_amount) sum, vendor_number
    of the INVOICE
    Sequence_id group check_date, check_number, invoice_number, vendor_number
    ) A, B OF INVOICE
    where A.sequence_id = B.sequence_id


    Thank you
    Nick

    It seems that this is a duplicate thread - correct me if I am wrong in this case->

    Need help with query SQL Inline views + Group

    Kind regards.

    LOULOU.

  • Need help for optical safety circuit.

    I buy these parts and prototype with real components, but since I multisim, I thought it would be nice to create the circuit and maybe work through issues I can practically.

    I need a circuit that takes 120 VCA, generates 5 VDC and 1.5Vdc power of optical transmitter and receiver.  I actually use a data port because he has great range and is pretty cheap.  Rather than send the binary code well I just send a light stead that is broken or not broken through doors and windows in my house.  Then the receiver sees this as an entry and order a relay.

    I tried several voltage regulators that come with multisim, but I get an error of execution of my circuit.  Really I can't the 120 VAC to power levels necessary for the functioning of the optics.

    Otherwise I might want to run on a system 120Vdc with battery backup, so throw a 120Vdc up to 20 v DC switching power supply - but I have not found a SMP in the library which takes 120 as input and as output 20.

    Basic plan: 120VAC source-> transform to 24Vac-> Full bridge rectifier to ~ 20 v DC-> voltage capacitor filter on the input of two voltage regulators (1 to 5 VDC, 1 to 1.5Vdc) - then circuit since the two power supply of the transmitter and the receiver.

    I just need help for 5V and 1.5V, from there, I know that the real world circuit will work component tests already carried out.  Thanks for reading.

    I didn't Multism so I can't advise you on the compatible models. I ran the model on semiconductors with slight modifications of format on my SPICE simulator based on Berkeley Spice 3f5. I had to change the format of model resistance semiconductors appeal but has not changed any values.

    The output of your power supply circuit 3 (with 5 V, not the 1.5 V regulator regulator) was 4.99995 V.

    There are a few messages about changing templates published for compatibility Multisim woth. You can search those to see if there are any suggestions on what you'll need to fix in the model.

    Lynn

  • I need help for activation of the real administrator account.

    I have a problem with Adobe reader 9 standard, Adobe customer service asked the unhide real administrator account before you can continue to help me.

    I need help for that.

    http://www.Vistax64.com/tutorials/67567-administrator-account.html

    http://www.howtogeek.com/HOWTO/Windows-Vista/enable-the-hidden-administrator-account-on-Windows-Vista/

    Read the above info.

    See you soon. Mick Murphy - Microsoft partner

  • I need help for my reader to USB drive on my windows 10 ACER?

    I need help for my reader to USB stick on my chrome windows 10 plug ins acer. Can you help me?

    What Adobe application that you use?

    This is the Adobe Media Encoder forum, and you did not mention anything on this subject. If you can let us know what Adobe application, you need help, we can help you make the right forum.

    Thank you

    Regalo

  • Hello, I need help for cancel the payment on my adobe account.

    Hello, I need help for cancel the payment on my adobe account. I'm from Peru, Im paying a monthly fee as a student. Help, please...

    Cancel your membership creative cloud

  • Need help to modify the Script to find the number of vCPU and reservation of memory in VC

    Hello

    Need help to modify the script so that his can person report to the vc all focus level instead of each level of the Cluster.

    Thank you

    KR

    Try this instead:

    $vmsInfo = Get-VM
    #Creating array to place new object
    
    $reportdata = @()
    
    Foreach ($vm in $vmsInfo)
    {
    #Creating new object
    $vmInfo = "" | Select Name, CPUReservationMHz, MemoryReservationGB
    $vmInfo.Name = $vm.Name
    $vmInfo.CPUReservationMHz = $vm.ExtensionData.ResourceConfig.CpuAllocation.Reservation
    $vmInfo.MemoryReservationGB = $vm.ExtensionData.ResourceConfig.MemoryAllocation.Reservation / 1024;
    #Inserting data into new object.
    $reportdata += $vminfo
    }
    $reportdata
    
  • Need help for calculation script

    I was instructed to convert an Excel file into a fillable PDF, with formulas and calculations. Unfortunately, I'm a complete newbie to creating forms using calculations and javascript, but so far, I was able to use the built-in functions or to find examples of javascript for the formulas that I am duplicating. However, my final calculation stuck me.

    Basically, I do an if / then calculation based on a field being greater or less than another. If the result is greater, the script should return a 'YES', if it is lower, it should return a 'no' the excel function is as follows:

    = IF(C45>C32,"YES","NO")

    Could someone help me with this script?

    Here is the code for calculating customized to do this, assuming that the names of the other fields are C45 C32 and that their format is set to number:

    c45 var = getField("C45").value;

    c32 var = getField("C32").value;

    If (c45! = "" & c32! = "") {}

    If the two fields are not empty, compare them...

    Event.Value = c45 > c32? "YES": "NO";

    } else {}

    If the fields are empty, reset this field

    Event.Value = "";

    }

  • Need help with understanding PowerCli scripting by LucD

    Hello

    I'll give you the standard statement that I am a noob powercli and don't really know what I'm doing here.  Here's a script that works because it runs without error and gives a report but I need help to understand this under his weight.

    Connect-VIServer '< our vcenter >' - user < user > admin-password < admin-user-pwd >

    $allvms = @)

    $vms = get - Vm | where {$_.} PowerState - eq "Receptor"}

    $start = (get-Date). AddDays(-1)

    $metrics = "mem.usage.average".

    $stats = get-Stat-entity $vms - start $start - Stat $metrics

    $stats | Group-object - property {$_.} Timestamp.Day}, {$_.} @entity.name} | %{

    $vmstat = "" | Select the day, MemAlloc, MemMin, MemMax, MemAvg, VmName

    $vmstat. VmName = $_. Values [1]

    $vmstat. Day = $_. Group [0]. Timestamp.Date

    $mem = $_. Group | where {$_.} MetricId - eq "mem.usage.average"} | Measure-object-property value - average - Maximum - Minimum

    $vmstat. MemMax = [int] $mem. Maximum ##dfsdf

    $vmstat. MemAvg = [int] $mem. Average

    $vmstat. MemMin = [int] $mem. Minimum

    $vmstat. MemAlloc = $_. Group [0]. Entity.MemoryMB

    $allvms += $vmstat

    }

    $allvms |

    Export-Csv "c:\ < folder > \ <>.csv file Destination"-noTypeInformation

    It connects to our server vcenter server and offers two days of data.  Today and yesterday, all with a timestamp of 0:00.  See below for an example of a virtual machine.

    VmNameDayMemAllocMemMaxMemAvgMemMin
    < name VM1 >07/05/2016 0:004096181818
    < name VM1 >06/05/2016 0:0040963612

    8

    The MemMax, the MemAvg and the MemMin are for this day?  Just the max of this period of sampling time 0:00?

    What I'm looking for, it is to find that the use of the maximum memory of virtual machines are for the whole day.  So I hope that I can remove memory of VMs that do not use it.  I was listed on the change $start = (Get-Date). The value of AddDays(-1) to $start = (Get-Date). AddDays(-30) and see what things alike.  I want to be sure however that the value for MemMax is the highest value for a period of 24 hours.  That is to say for the 07/05/2016 the given virtual machine never used a maximum of 18% of his memory attributed the 06/05/2016 the maximum amount of memory used was 36%, and so on that I extend on the date range.

    Kind regards

    Michael

    It then becomes a rather simple Get-Stat script.

    $vms = get - Vm | where {$_.} PowerState - eq "Receptor"}

    $start = (get-Date). AddDays(-1)

    $metrics = "mem.usage.average".

    Get-Stat - entity $vms - start $start - Stat $metrics |

    Select Timestamp,@{N='VM'; E={$_. @entity.name}}, Value |

    Tri-objet-VM property |

    Export-Csv "c:\------.csv '-noTypeInformation

  • Need help with Oracle SQL merge records according to date and term dates

    Hi all

    I need help to find this little challenge.

    I have groups and flags and effective dashboards and dates of term against these indicators according to the following example:

    GroupName Flag_A Flag_B Eff_date Term_date
    Group_ATHERETHERE2011010199991231
    Group_ANN2010010120101231
    Group_ANN2009010120091231
    Group_ANN2006010120081231
    Group_ANTHERE2004010120051231
    Group_ATHERETHERE2003010120031231
    Group_BNTHERE2004010199991231
    Group_BNTHERE2003010120031231

    As you can see, group_A had the same combination of (N, N) flag for three successive periods. I want to merge all the time periods with the same indicators in one. Where entry into force will be the most early (underlined) time period and end date will be later (underlined)

    So the final result should look like this:

    GroupName Flag_A Flag_B Eff_date Term_date
    Group_ATHERETHERE2011010199991231
    Group_ANN2006010120101231
    Group_ANTHERE2004010120051231
    Group_ATHERETHERE2003010120031231
    Group_BNTHERE2003010199991231

    Thanks for your help

    Here's the DDL script

    drop table TMP_group_test;

    create table TMP_group_test (groupname varchar2 (8))

    , flag_a varchar2 (1)

    , flag_b varchar2 (1)

    , eff_date varchar2 (8)

    , term_date varchar2 (8)

    );

    insert into TMP_group_test values ('Group_A', 'Y', 'Y', ' 20110101 ', ' 99991231');

    insert into TMP_group_test values ('Group_A', 'n', ' n ', ' 20100101 ', ' 20101231');

    insert into TMP_group_test values ('Group_A', 'n', ' n ', ' 20090101 ', ' 20091231');

    insert into TMP_group_test values ('Group_A', 'n', ' n ', ' 20060101 ', ' 20081231');

    insert into TMP_group_test values ('Group_A', 'n', 'Y', ' 20040101 ', ' 20051231');

    insert into TMP_group_test values ('Group_A', 'Y', 'Y', ' 20030101 ', ' 20031231');

    insert into TMP_group_test values ('Group_B', 'n', 'Y', ' 20040101 ', ' 99991231');

    insert into TMP_group_test values ('Group_B', 'n', 'Y', ' 20030101 ', ' 20031231');

    commit;

    Post edited by: user13040446

    It is the closest, I went to the solution


    I create two rows;

    Rnk1: partition by group name, order of eff_date / / desc: this grade will sort the records of the most recent and handed to zero for each group\

    Rnk2: (dense) partition by group name, flag_A, flagb: this grade for each combination of group\flag gives a number so that they are classified as "families".

    Then I use the function analytic min

    Min (eff_date) more (partition of GroupName, rnk2): the idea is that, for each Member of the same family, the new date is the min of the family (and the max for the date of the term), at the end I just need separate so that the duplicates are gone

    Now the problem. As you can see from the query below, records of 1 and 6 (as identified by rownum) are identified in the same family, because they have the same combination of flag, but they are not successive, so everyone must keep its own date of entry into force.

    If only I can make the distinction between these two that would solve my problem


    Query:


    Select rowNum,GroupName, flag_a, flag_b, eff_date, term_date, rnk1, rnk2

    , min (eff_date) more than (partition by GroupName rnk2( ) min_eff

    Of

    (

    Select rowNum,

    GroupName , flag_a , flag_b , eff_date , term_date

    rank() more than (partition by GroupName stopped by eff_date desc) rnk1

    DENSE_RANK() more than (partition by GroupName order by flag_A flag_B ( ) rnk2

    de dsreports . tmp_group_test

    ) order by rowNum

    Hello

    user13040446 wrote:

    Hi KSI.

    Thanks for your comments, you were able to distinguish between these lines highlight, but lost lines 2,3,4 which are supposed to have the same date min = 20060101.

    Please see the table wanted to see the final result I want to reach

    Thanks again

    This first answer is basically correct, but in the main query, you want to use the function MIN, not the analytical function aggregation and GROUP BY columns with common values, like this:

    WITH got_output_group AS

    (

    SELECT GroupName, flag_a, flag_b, eff_date, term_date

    ROW_NUMBER () OVER (PARTITION BY GroupName

    ORDER BY eff_date

    )

    -ROW_NUMBER () OVER (PARTITION BY GroupName, flag_a, flag_b)

    ORDER BY eff_date

    ) AS output_group

    OF tmp_group_test

    )

    SELECT GroupName, flag_a, flag_b

    MIN (eff_date) AS eff_date

    MAX (term_date) AS term_date

    OF got_output_group

    GROUP BY GroupName, flag_a, flag_b

    output_group

    ORDER BY GroupName

    eff_date DESC

    ;

    The result I get is

    GROUP_NA F F EFF_DATE TERM_DAT

    -------- - - -------- --------

    Group_A Y 20110101 99991231 Y

    N Group_A 20101231 20060101 N

    Group_A N 20051231 20040101 Y

    Group_A Y Y 20031231-20030101

    Group_B N Y 99991231 20030101

    which is what you asked for.

Maybe you are looking for

  • The BIOS update can I use for Satellite A200 - 14 d (PSAEC)?

    Laptop came with vista home. Now the WXP running. Should which BIOS I use?5.20 - WINNER is not vista compatible or 1, 80 - WIN, that is? What does compatibility mean in this case? Not for vista = for laptops which didn t come with preinstalled vista

  • Need driver XP LAN Satellite A100 - 036 PSAAN

    I uninstalled my Home Vista and install Windows XP and then all the necessary drivers. But I cannot run the LAN driver and cannot connect to the internet. I do not have the model of my LAN...Please link me where I can download this driverDetails:Sate

  • DVD player stopped working

    My DVD on my Dell Inspiron 1545 drive stopped working about 9 months ago.  I uninstalled and reinstalled the program twice and nothing ever changes. I also did test problems, and nothing shows. What can I do about it? Help, please!

  • Administrator account type changed from standard

    I have 2 on my pc to Setup user accounts - two of them have been "administrator."  They have now been changed to the standard.  That's happened?  Was it a Vista update that made that change?  I used the built-in Administrator account to log in and th

  • How to access the screen under display PopUp

    Hello I made a transparent display of the PopUp. But I want to access the screen below this screen PopUp, such as screen PopUp remains on top, but gets to focus on the screen below. I got the screen below, using: -. Ui.getUiEngine () .getActiveScreen