I want to use a dynamic schema name in the from clause but its not working.

DECLARE
     vblQueryName VARCHAR2(20);
     vblSchemaName VARCHAR2(20);
BEGIN
     SELECT CurrentSchemaName INTO vblSchemaName FROM HR_989_SCHEMA;
     vblQueryName:='060_525_020';
     INSERT /*+ APPEND(HP_ELIGIBILITIES,4) */ INTO HP_ELIGIBILITIES
          LVL1ID,
          LVL1Desc,
          LVL2ID,
          LVL2Desc,
          LVL3ID,
          LVL3Desc,
          LVL4ID,
          LVL4Desc
     SELECT /*+ PARALLEL(a,4) */
          LVL1ID,
          LVL1Desc,
          LVL2ID,
          LVL2Desc,
          LVL3ID,
          LVL3Desc,
          LVL4ID,
          LVL4Desc
     FROM
     bold     vblSchemaName.HP_ELIGIBILITIES a
     WHERE
          UPPER(LVL2ID) = 'XX' ;
     COMMIT;
DBMS_OUTPUT.PUT_LINE( 'Query Executed: ' || vblqueryName);
INSERT INTO HP_QUERYEXECLOG(QueryName) VALUES(vblQueryName);
EXCEPTION WHEN NO_DATA_FOUND THEN NULL;
END;
I want to create a rules table so that the schema name in front of the table name in the from clause can be controlled by a separate table that is maintained but its not working . Help and your valuable inputs needed for this issue

I want to use a dynamic schema name in the from clauseyou can alternatively set the current schema as e.g. in:
declare
   vblqueryname    varchar2 (20);
   vblschemaname   varchar2 (20);
begin
   select currentschemaname into vblschemaname from hr_989_schema;
   vblqueryname := '060_525_020';
   execute immediate 'alter session set current_schema=' || vblschemaname;
   insert /*+ APPEND(HP_ELIGIBILITIES,4) */
         into hp_eligibilities (lvl1id,
                                lvl1desc,
                                lvl2id,
                                lvl2desc,
                                lvl3id,
                                lvl3desc,
                                lvl4id,
                                lvl4desc
      select /*+ PARALLEL(a,4) */
            lvl1id,
             lvl1desc,
             lvl2id,
             lvl2desc,
             lvl3id,
             lvl3desc,
             lvl4id,
             lvl4desc
        from hp_eligibilities a
       where upper (lvl2id) = 'XX';
   commit;
   dbms_output.put_line ('Query Executed: ' || vblqueryname);
   insert into hp_queryexeclog (queryname)
   values (vblqueryname);
exception
   when no_data_found
   then
      null;
end;

Similar Messages

  • My ipod is corrupted and when I try to reset it it will not let me, I tried using the diagnostics feature but its not working? Help please!!

    I dropped my ipod classic and i tried turning it back on and it asks me to plug it in. I did so and it said the data was corrupted. I tried resetting it and it said something about fire wire? I looked on the internet and tried setting it to "Disk mode" and plugging it in and trying it that way, but it doesnt come up on my itunes. I tried diagnosing the issue on the ipod itself and I get to the "Accessorize test" and it says I dont have a FWPWR. How can I fix this??

    Ok you got to make sure that you are the adiminstrtor on the computer. After you do that right click on my computer and hit properties. Make sure under the general tab that you are running windows (2000) service pack (4) or Windows XP Home or Pro service pack (2). After you have established that type in on the support search box uninstall itunes and quicktime for windows. Then once you have downloaded itunes restore the ipod and see if this fixes your problem.

  • Is there a way to use dynamic built string in the "from" clause

    Hi all, im having one problem and now, im not sure how to solve it easily at all... :) Is there someone that would be so kind and put a eye on it? ..thx
    I have plsql proc, in which i have a list of table_names. For each of that table i need to run a query that will retrieve me a list of values and for each of that value i need to do something.
    If i can be more specific about the problem -> each of that table is built as key_column, value_columns, day,starttime. For a key per table there are 4 records per hour - every quarter. Im truncating those quarters to full-quarter (minutes => 0->14 = 0min; 15->29 = 15min, 30->44 = 30, 45->59=45)
    example
    i get for one key and specific hour four records at 15:01;15:16;15:31;15:46 => i truncate em to 15:00;15:15;15:30;15:45..Sometimes there is a problem with the tool that is generating those data for me, and one quarter could be moved a little - so i get data like 15:01;15:16;15:29;15:46 => after i truncate the times i get duplicates in second quarter. It also can happen like this : 23:00; 23:14; 23:29; 23:44; 23:59 => totaly bad => cos the last one supposed to be as 0:00 next day, ..and 23:14 as 23:15...So...that was a problem - and solution -> i wanted to create plsql that will find those hours in each table i ve defined, and for each problem hour i make some fixes - update the bad time ...
    ..and i have problem - can i put an dynamic built table_name in the "from" clause?
    example how i wanted to do that:
    declare
         type t_objectName     is table of varchar2(030) index     by pls_integer;
         l_tableName              t_objectName;
    begin
    l_tableName(1) := 'tmphlrgl';
    l_tableName(2) := 'tmprcfgl';
    l_tableName(3) := 'tmprcfbs';
    l_tableName(4) := 'tmpvlrgl';
    for i in (select evtime from (select day,trunc_quarter(evtime) evtime,m_id from l_tableName(i) group by day,trunc_quarter(evtime),m_id having count(*)>1) order by evtime) loop
    --some other conditions and the update...
    end loop;
    end;
    /I cannot use the l_tableName(i) for FROM ...get an error...I was thinking to build it as dynamic sql and execute immediate into some kind of object that can store mutliple lines, from which i would in the FOR cycle get the data...But im not sure if this could be done in plsql...
    thanks for your time and help..
    d.

    declare
    c sys_refcursor;
    begin
    for i in 1..4 loop
    open c for 'day,trunc_quarter(evtime) evtime,m_id
    from ' || l_tableName(i) ||
    'group by day,trunc_quarter(evtime),m_id having
    count(*)>1) order by evtime';Just to high light SELECT is missing that all
    OPEN c FOR ' SELECT day,trunc_quarter(evtime) evtime,m_id
              FROM' || l_tableName(i) ||
    'GROUP BY day,trunc_quarter(evtime),m_id  HAVING  count(*)>1)   ORDER BY evtime';

  • I bought my iphone 4 through ebay and its unlocked. the problem is that my phone does not sync straight away. I sync my music file through autofill. I want to sync ringtones but its not working

    i bought my iphone 4 through ebay and its unlocked. the problem is that my phone does not sync straight away. I sync my music file through autofill. I want to sync ringtones but its not working.
    I saw cidya aap so i m not sure if it was jailbroken or not before but it is back to normal settings.
    My problem started when I tried to sync my music files. I pressed 'sync' all it says is waiting for sync start, preparing to sync and then waiting for the changes to be applied. but it does not sync at all.
    I found a way to sync my music files through autofill but I really wanted to sync ringtones but its not syncing and I really wanted to put ringtones in my phone please help.

    If you see the cidya app, your iPhone is hacked with the cutsie term for this being jailbroken. This also means all the built in security has been removed making the iPhone as insecure as an android device.
    Restore the iPhone with iTunes as a new iPhone or not from the backup to get rid of that hacking garbage. If the iPhone has hacked to be unlocked, the iPhone will no longer be unlocked when doing so.

  • I baught Seagate Backup plus 2T hard drive to use as my Backup time machine. But its not working when i connect to time machine its not coping files, it keep saying preparing files. Can someone help me please...

    i baught Seagate Backup plus 2T hard drive to use as my Backup time machine. But its not working. when i connect to time machine its not coping files, it keep saying preparing files. Can someone help me please...

    Please read this whole message before doing anything.
    This procedure is a diagnostic test. It’s unlikely to solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.
    The purpose of the test is to determine whether the problem is caused by third-party software that loads automatically at startup or login, by a peripheral device, by a font conflict, or by corruption of the file system or of certain system caches.
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards, if applicable. Start up in safe mode and log in to the account with the problem. You must hold down the shift key twice: once when you turn on the computer, and again when you log in.
    Note: If FileVault is enabled, or if a firmware password is set, or if the startup volume is a Fusion Drive or a software RAID, you can’t do this. Ask for further instructions.
    Safe mode is much slower to start up and run than normal, with limited graphics performance, and some things won’t work at all, including sound output and Wi-Fi on certain models. The next normal startup may also be somewhat slow.
    The login screen appears even if you usually login automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin.
    Test while in safe mode. Same problem?
    After testing, restart as usual (not in safe mode) and verify that you still have the problem. Post the results of the test.

  • I have F.F 3.6 and windows 7.: 1) When i want to buy a airplane ticket and want to select 2 adults or 2 children, the draw down select, does not work in any websides,? WHY?. 2) Have FF any problems with SKYPE

    I have F.F 3.6 and windows 7.: 1) When i want to buy a airplane ticket and want to select 2 adults or 2 children, the draw down select, does not work in any websides,? WHY?. 2) Have FF any problems with SKYPE
    == This happened ==
    Not sure how often
    == After innstalling windows 7

    As a suggestion I'd put the Text_io segments into their own begin - exception - end sub-blocks within the main code. This way if Text_io does raise an exception you can catch it earlier as it may be able to recover - That is if it is a text_io exception.
    Other than that you;ll have to step through in Debug.

  • Hi, i would like my membership cancelled. I got it yesterday but its not working the way i wanted it to work. How do i go about that i getting my refund as its before 30 days.

    Hi, i would like my membership cancelled. I got it yesterday but its not working the way i wanted it to work. How do i go about that i getting my refund as its before 30 days.

    Hi kondwastefstef,
    I'm sorry that your subscription didn't meet your needs. Please contact Adobe Customer Support via phone or chat; they should be able to cancel your account and process your refund. Here's the contact information: Contact Customer Care
    Best,
    Sara

  • How to change recordset bahaviour to accept dynamic column names in the where clause

    Hi
    im using php-mysql and i make a recordset and i want to make the column names in the where clause to be dynamic like
    "select id,name from mytable where $tablename-$myvar";
    but when i do this my i break the recordset and it disappear
    and when i use variables from advanced recordset it only dynamic for the value of the column not for the column name
    and when i write the column name to dynamic as above by hand it truns a red exclamation mark on the server behaviour panel
    so i think the only way is to change the recordset behaviour is it? if so How to make it accept dynamic column names?
    thanks in advance.

    As bregent has already explained to you, customizing the recordset code will result in Dreamweaver no longer recognizing the server behavior. This isn't a problem, but it does mean that you need to lay out your dynamic text with the Bindings panel before making any changes. Once you have changed the recordset code, the Bindings panel will no longer recognize the recordset fields.
    Using a variable to choose a column name is quite simple, but you need to take some security measures to ensure that the value passed through the query string isn't attempting SQL injection. An effective way of doing this is to create an array of acceptable column names, and check that the value matches.
    // create array of acceptable values
    $valid = array('column_name1', 'column_name2', 'column_name3');
    // if the query string contains an acceptable column name, use it
    if (isset($_GET['colname']) && in_array($_GET['colname'], $valid)) {
      $col = $GET['colname'];
    } else {
      // set a default value if the submitted one was invalid
      $col = 'column_name1'
    You can then use $col directly in the SQL query.

  • I was using my apple tv remote but its not working. I tried everything selected different input unplugging the apple tv but still no signal. I can't update bec its blank what am i going to do Please help just purchased this item maybe 3-4 mos ago

    Can someone please help me Apple tv is not working.  There is no signal, i trIed pressing the left and right button and used different hdmi input unplugged the device still not working.  I just purchased it maybe 3-4 months ago

    You might want to try asking in the correct forum. This forum is for iPhones being used in an enterprise environment.

  • I want to read a SD card, but its not working. What need i to do?

    I have a 8GB SD card, and i want that my macbook-pro read this card, i put the card into my MBP, but its giving no response, and it doing nothing?
    Does somebody know what I can do? (Im using MAC os LION)

    hey, thanks for the reply but that isn't the issue. my issue is that the animation doesn't stay within the div container. I tried what you said via chrome console but that's more of a hack way of doing it. I should be able to contain the animation within the div that its being wrapped with but for some reason it is jumping outside the div container.
    Does that make sense? Would be awesome if there was a walkthrough on how the edge animation settings worked. for example the code below. would i need to adjust something below for it to contstrain within the container?
        scaleToFit: "both",
        centerStage: "both",
        minW: "320",
        maxW: "1200",
        width: "830",
        height: "430"
    }, {"dom":{}}, {"style":{"${symbolSelector}":{"isStage":"true","rect":["320px","1200px","830px","430px"] ,"fill":["rgba(255,255,255,1)"]}},"dom":{}});

  • I want to sync music from my PowerBook G4 to my Ipod Generation 7 but it says i need to update the Powerbook but the Powerbook says there is no updates plus i need to update Itunes but its not working.

    I want to Sync music from my PowerBook 4 to my Ipod generation 7 but it says I need to update Itunes to 10.7 but when it finishes updating and i go back to itunes nothing has changed and Itunes is not updated.

    In order to install iTunes 10.7 or later you need OSX 10.6.8 or later. A PowerBook can install up to OSX 10.5.8
    I hate to be the bearer of bad news but any new iPod won't sync with iTunes on Mac not using an Intel processor.

  • Hi i am using  personal hot spot before updating 6.1.3.now iam using ios 6.1.3 version the personal hot spot is not working..can you please help me on this?how to use that,its in a default mode?

    Hi previously i use personal hotspot,after updating my 6.1.3 ios in india iam not able to use that.It is in a default mode.
    Can you please help me how to use personal hotspot.
    Thanks,
    Goutham.

    Im really good at programming but really suck at algorithms
    >If your are 'really good' at programming, you will be able to solve this problem. Because, it has nothing to do with algorithm.
    >>can someone please please write in a algorithm form for me , i need it by friday i would greatly be thankful for u
    >Wrong person, in the wrong place.

  • HT201263 I used everything  but its not working it didnt help me to get the passcode of my iphone...my iphone was accidentally played by kids and we cannot retrive or we dont know the passcode.....

    I want to open my iphone because ot was accidentally played by kids and i dont know the passcode. My iphone is disabled already because of many attempt...can you help me?...

    You need to connect it to the computer with which you initially sync'd your iPhone to iTunes.  If you claim that the computer is no longer available, it reads as if you are in possession of a stolen device.

  • I TRIED RESTORING MY IPHONE 3G AND AN ERROR CODE CAME UP. THE APPLE ICON IS ON MY IPHONE AND IT WANT TURN OFF OR RESET. I HAVE TRIED EVERYTHING I MEAN EVERYTHING BUT ITS NOT WORKING. PLEASE SOMEONE HELP. DON'T HAVE A RIDE TO THE APPLE STORE.

    PLEASE HELP ME.

    No need for the caps.
    If iTunes prompts you to restore your phone, then that is your only choice.  Just follow the instructions iTunes gives you.
    If its not turning on, hold down the power and home buttons at the same time until the Apple logo appears.  Then you will be asked to restore your phone in iTunes.

  • I want to make my animation responsive but its not working correctly.

    Here is a better example of what the issue is.
    http://re.g-ram.co/1uHfiWu
    The animation is suppose to be right below the navigation. Can anyone guide me on what or how I can center it without having it absolute positioned at the top?
    Its being written by jquery. one of my clients did the animation. All i am doing is integrating it in the html.

    hey, thanks for the reply but that isn't the issue. my issue is that the animation doesn't stay within the div container. I tried what you said via chrome console but that's more of a hack way of doing it. I should be able to contain the animation within the div that its being wrapped with but for some reason it is jumping outside the div container.
    Does that make sense? Would be awesome if there was a walkthrough on how the edge animation settings worked. for example the code below. would i need to adjust something below for it to contstrain within the container?
        scaleToFit: "both",
        centerStage: "both",
        minW: "320",
        maxW: "1200",
        width: "830",
        height: "430"
    }, {"dom":{}}, {"style":{"${symbolSelector}":{"isStage":"true","rect":["320px","1200px","830px","430px"] ,"fill":["rgba(255,255,255,1)"]}},"dom":{}});

Maybe you are looking for

  • In Mail App, Viewing Images

    In Mail, My preferences are set to display remote images. However, my incoming mail messages don't display the images. This is the condition when the mail is open, not just in preview. Is there another setting hidden somewhere in the app? Thanks much

  • Simple problem with triggers

    Hi all, Initially I have written a trigger for testing .But im not able to write it as per the requirement.Actually I have written the trigger for a table "test" when a row is inserted into it then my trigger will insert a row in another table.In the

  • Fragmentation and uncontrolled growth of the 'PJID' tablespace.

    Hi, We are running oracle Application in HP ux and db is 9.2.0.5.0 and got issue wile running the UPDATE PROJECT AND RESOURCE BASE SUMMARIES job and it failed with Cause: FDPSTP failed due to ORA-12801: error signaled in parallel query server P006 OR

  • SAP BPC MS - Send email through the implementation of a package

    Hi everyone!!! I want to know if there is a way to create a package to send emails. I need to put a step in a custom menu that sends an email to notify users. I thought to do this via package execution. Maybe there is another way. I count on your hel

  • StageWebView for Local HTML file

    I simply cannot get this to work.  I see a lot of people offering advice on the web for how to implement it, I've been trying all day and it doesn't work with Adobe AIR 2.5 for Android Flash CS5 plug-in. Instead of linking to an external website: