don't forget the select result of a statement to be used several times in the procedure

Hi all

I'm sorry for this kind of question, I'm not newbie, but still need your help.

My need is remember the select result of a statement to be used several times in the procedure.

My first guess is to use a temporary table, but I think there's better decisions.

For example, I should make a heavy request

Select the code from table_function (param1)

Then, this query is used to insert a list of the id in table1, delete table2 and update in table 3.

Help me please do not use if possible temporary tables.

If there is more than one column, you need to create an object type at the database level. Create a collection of this type of object in the procedure.

Example:

CREATE OR REPLACE TYPE "OBJ1" as OBJECT(
        column1 varchar2(256 CHAR),
        column2 varchar2(35 CHAR)
        );

CREATE OR REPLACE TYPE "nt_obj1" as table of OBJ1; -- this could be done at procedure level as well

DECLARE
   t_employee_ids   nt_obj1;
BEGIN
   SELECT OBJ1(column1,column2)
     BULK COLLECT INTO  t_employee_ids
     FROM table1
    WHERE column3 = NNN
.............
.....

Tags: Database

Similar Questions

  • upgraded to 3.6, bookmarks, lost, lost the toolbar bookmarks, bookmarks library, lost cannot go to the previous backup, error message. Not have Torbutton. Cannot save new bookmarks. AutoFill remembers. Don't forget the story is about.

    upgraded to 3.6, bookmarks, lost, lost the toolbar bookmarks, bookmarks library, lost cannot go to the previous backup, error message. Not have Torbutton. Cannot save new bookmarks. AutoFill remembers. Don't forget the story is about.

    I got this yesterday after the 3.6.4 problem upgrade. I'm not sure if I saw all the things you did, but I have def lost all bookmarks and the back button. I fixed it by:
    1. go to the Firefox profile directory, which for me is here but 1st bit will be different for you as mine work specific:

    C:\Documents and Settings\U049177\Application Data\Mozilla\Firefox\Profiles\soez0lvk.default
    2 delete places.sqlite and places.sqlite - journal

    3. start Firefox (you should have the back button now works but not Favorites, he recreated to these 2 files)

    4. in the menu, bookmarks and then organize bookmarks, then button import and backup, then restore, then select a day to restore from. You should now have your backups Firefoxes bookmarks.

    Hope this works for you

  • Unable to connect to a Web site? used several times before. says the dns server is incorrect or does not exsist?

    Unable to connect to a Web site? used several times before. says the dns server is incorrect or does not exsist? help someone?

    If it is hosted by GoDaddy, it's maybe out of service. There is a DDoS (denial of Service) attack to GoDaddy for the moment.

    You could try again later and see if it returns.
  • M300: Don't forget the extended desktop settings

    I use my M300 with a monitor and an extended desktop (i.e. different images on both monitors). I also have the external monitor put in place for a higher resolution than the lcd (and on the left of the LCD not allowed).

    However, I have to redo the settings everytime I connect. Is there a way to get the graphical utility to remember the configuration (and even to assign to the left button of the keyboard hardware)?

    Hello

    As much as I know the laptop don't forget last configuration, and if you use the extend my Windows desktop on this monitor, it may happen that the application window will not be displayed on LCD laptop but on extended monitor you will not be able to see in this case.

    I spend every time as you and it takes just 30 seconds and I can live with it. Just a question: how to connect external monitors (directly to the laptop or docking station)?

  • How to use a function switch box to the reference that is used several times in the previous drop-down list options?

    I use JavaScript coding in LiveCycle and development of dependent drop-down areas, but I find it difficult to write correct code. See the example below. I'm trying to use a multiple box function that refers to an option that is listed several times in the previous pull-down menu. The problem I am running into is that when I refer to any color or Nissan and Chevy, it returns the results of the color in the "Ford" column only. I'll always see color (blue, black, green and purple) options in my second drop-down list and it seems fine, but then the third drop reference only the options and colors 'Ford '. (I don't have the code for the third menu list drop-down).

    I want the client to choose Chevy or Nissan and have her drop downs (based on the color they chose)-dependent, but I can't seem to make this work.

    I hope it is clear enough (probably as mud...). I would appreciate help!

    Form1. #subform [0]. #subform [1]. cboModels::exit - (JavaScript, client)

    cboColor.clearItems ();

    {Switch (this.) RawValue)}

    case "Ford":

    cboColor.addItem ("Blue");

    cboColor.addItem ("Black");

    cboColor.addItem ("Green");

    cboColor.addItem ("Purple");

    break;

    case 'Chevy ':

    cboColor.addItem ("Blue");

    cboColor.addItem ("Black");

    cboColor.addItem ("Green");

    cboColor.addItem ("Purple");

    break;

    case "Nissan":

    cboColor.addItem ("Blue");

    cboColor.addItem ("Black");

    cboColor.addItem ("Green");

    cboColor.addItem ("Purple");

    break;

    }

    Form1. #subform [0]. #subform [1]. cboColor::exit - (JavaScript, client)

    cboPrice.clearItems ();

    {Switch (this.) RawValue)}

    case "Ford":

    case "green":

    cboPrice.addItem ("blah");

    cboPrice.addItem ("blah");

    cboPrice.addItem ("blah");

    cboPrice.addItem ("blah");

    break;

    case 'Chevy ':

    case "green":

    cboPrice.addItem ("blah");

    cboPrice.addItem ("blah");

    cboPrice.addItem ("blah");

    cboPrice.addItem ("blah");

    break;

    case "Nissan":

    case "green":

    cboPrice.addItem ("blah");

    cboPrice.addItem ("blah");

    cboPrice.addItem ("blah");

    cboPrice.addItem ("blah");

    break;

    }

    You can use '\n' for newline in a string, so

    "Option 1, \nOption 2, \nOption 3;

    Put each on its own line.

    Bruce

  • Firefox is remembering my history, but do not allow me to restore the sessions or don't forget the tabs.

    Firefox > History shows a list of recent websites, so I see it's save my history, but firefox is not restore my tabs at startup. ALT > t > o > general is set to display my tabs from the previous session. The firefox home page appears instead, with no option to restore previous session in the lower right corner and a greyed 'restore previous Session' option in Firefox > history
    As suggested, I tried to remove sessionstore.jss and sessionstore.bak, and history of privacy is set to always store.

    This issue started today out of the blue and I can't find a solution.

    This was already the case. I left for the weekend and when I came back, the problem has been corrected. I don't know what it is.

  • Don't forget the last entries in form af:query after navigating to the search page

    12.1.3 JDev

    Let's say I have a BTF with search page jsff with an af:query and result table. The user can navigate on this page after executing the search and do something else in the application. What I want to achieve is if the user navigates to this search page, that the previous entries of the form af:query will be pre-filled.

    Does make sense?

    corresponding AF liaison component: Query has an InitialQueryOverriden property defaults to false.

    You must set to true.

    More details here:

    http://www.jobinesh.com/2009/11/displaying-pre-executed-query-result-in.html

  • Concatenate the select result of a statement under...

    OK, here's my problem. I have 2 tables, a reference to the other. Several rows of table B belong to datas from the table A and I would do a select where I can "Concatenate" the content of the data in table B in one of my select line.
    So, here is what I did:
    select distinct d.code,
      c.libe "Nom",
      d.ddeb "Date de dépot",
      d.nume "Numéro de demande",
      (select p.libe from demande p where p.code=d.nume and p.natu='T' and tri=1
      )
      ||' '
      ||
      (select p.libe from demande p where p.code=d.nume and p.natu='T' and tri=2
      )
      ||' '
      ||
      (select p.libe from demande p where p.code=d.nume and p.natu='T' and tri=3
      )
      ||' '
      ||
      (select p.libe from demande p where p.code=d.nume and p.natu='T' and tri=4
      )
      ||' '
      ||
      (select p.libe from demande p where p.code=d.nume and p.natu='T' and tri=5
      ) "type",
      (select p.libe from demande p where p.code=d.nume and p.natu='C' and tri=1
      )
      ||' '
      ||
      (select p.libe from demande p where p.code=d.nume and p.natu='C' and tri=2
      )
      ||' '
      ||
      (select p.libe from demande p where p.code=d.nume and p.natu='C' and tri=3
      )
      ||' '
      ||
      (select p.libe from demande p where p.code=d.nume and p.natu='C' and tri=4
      )
      ||' '
      ||
      (select p.libe from demande p where p.code=d.nume and p.natu='C' and tri=5
      ) "Commune"
    from demandeur d,
      demande t,
      client c
    where t.code=d.nume
    and c.code  =d.code
    and c.role  ='1'
    and t.natu  ='T'
    and dfin   is null
    and ddeb    <'30/09/2008'
    and clot   is null
    and d.nume in
      (select u.code from demande u where u.libe in ('F1','F 1bis','F2','F3')
      )
    order by d.ddeb asc ;
    The problem is that this method will display only the first five rows of the table B (request). In table B, there could be between rows 1 and 14 for "Common" and up to 10 lines for 'Type '.

    Would there be any cleaner method or smarter to cela?

    THX

    Create a PL/SQL function like this:

    NOT TESTED

    create or replace function getTypes(p_nume in number) return varchar2 is
    retval varchar2(32000);
    begin
      for r in (select libe from demande where code=p_nume and natu='T' order by tri) loop
        retval := retvale||r.libe||' ';
      end loop;
      return retval;
    end;
    /
    
    select distinct d.code,
      c.libe "Nom",
      d.ddeb "Date de dépot",
      d.nume "Numéro de demande",
      getTypes(d.nume) type
    from demandeur d,
      demande t,
      client c
    where t.code=d.nume
    and c.code  =d.code
    and c.role  ='1'
    and t.natu  ='T'
    and dfin   is null
    and ddeb    <'
    and clot   is null
    and d.nume in
      (select u.code from demande u where u.libe in ('F1','F 1bis','F2','F3')
      )
    order by d.ddeb asc ;
    

    Max

  • Don't forget the last location

    I have two devices with the setting Remember last location. However, when the battery dies on them on that I can not see my friends are the last location or iCloud... says only location not found. Someone at - he experienced this?

    Hey Matt,

    It is my understanding that your iPhone location Services will keep track of the location of your devices while the phone is turned on and connected to a cellular network or wireless. The death of the battery of the phone or you lose the network connection, it will say "location unavailable". I never remember displaying "last known location."

    My point is that if the battery is dead, you won't be able to follow the iPhone, to see where it was last known to be the exception:

    • Open the Find My iPhone app.
    • If you are not on a device you own, click Sign Out in the upper right. Then sign in with your Apple and the access code.
    • Once connected, you will see a list of all your devices. Choose the missing iPhone.
    • You will see a point on the map showing you where it's located. If necessary, you can zoom in/out for more details.
    • Click Actions in the lower part.

  • Don't forget the credentials in Client mode

    It seems that the credentials cannot be maintained in customer view. It is sorta embarrassing for my with my own camera.

    Is there something I can do?

    Should be "-password", all the options lies in the documentation here, relevant pages begin on p42

    https://www.VMware.com/PDF/horizon-view/horizon-view-client-Windows-document.PDF

  • Don't forget the permission to the App and login using OAuth

    Hello

    I use my credentials for social actors to connect to my application via OAuth. I am able to do this successfully, but I have a problem with later connections.

    If I am disconnected from the application (Web site) and I try to log in again via the authorization url, I present the same dialog box and the login form.

    Should not be able to remember me (especially if I am also connected to social actors on another tab) and my permissions of the application? Then, I'll simply redirected to return to the application url.

    I use the url below scheme:

    https://[myEndpoint]/oauth2/authorization?response_type=code & redirect_uri = [myredirecturl] & client_id = [myapp'sclientid]

    I hope someone can help clarify.

    See you soon

    Hi CTSocial,

    We offer Single Sign On for corporate customers who are interested in the purchase of this configuration for an additional cost. In this case, you can use any provider identity (including Google) as long as they support SAML 2.0. However, I'm not sure that what you describe corresponds to this paradigm. We will be happy to pass your comments along to our product team.

    Best,

    Socialcast VMware team

  • Dreamweaver update don't forget the account names and passwords?

    This morning I did the update thing Adobe and it hung five applications, including Dreamweaver which I was working.

    I closed Dreamweaver and click [continue] and he finished. I am now running Dreamweaver 11, build 4916.

    I restarted Dreamweaver and made some changes to the page I was working on and has saved those and got an FTP error.

    Poking around a bit reveals that there is now no account name or password specified in my settings of the Site. And that's for ALL sites!

    Well, calm down... breaths of e e d p... We will re - import Sites using the old files .ste, right? They were created with the choice to save the account names and passwords, too. Point, click-click, the construction of the new site [2] and edit the page, save the changes and Boom! FTP error, once again.

    How can I fix it, please?

    Adobe aknowledges that question in the document of the basis of knowledge and skills associated with the update. I think that to solve it, you just need to restart your computer after the update to Dreamweaver.

  • Don't forget the files I had open when Dreamweaver reopening

    One of the annoying features in dreamweaver is that it seems not to remember the files that I had opened when I close and then reopen dreamweaver. Is there a setting I'm missing or an extension that does this?

    Thank you!

    Chris

    It's a setting preferences:

    Change | Preferences | General | Document options: reopen documents on startup

    --

    E. Michael Brandt

    www.divahtml.comwww.divahtml.com/products/scripts_dreamweaver_extensions.phpStandards-compliant scripts and Dreamweaver Extensions
    
    www.valleywebdesigns.com/vwd_Vdw.aspJustSo PictureWindowJustSo PhotoAlbum, et alia
    
    --
    
  • I lost the most views drop-down list under the search bar, it used several times in the same session, and then he just disappeared.

    The drop-down list is / was my part used of any page, use it to access to everything I need. The only other thing I noticed changed it's new green bottom-tab at the top of each page: site Web Safe/number of trackers. I can't get rid of it. Avira virus control icon is on my desktop, but the icon also suddenly appeared on the right side of the search bar. I deleted it because I have it on the desktop. I have no why he appeared suddenly. It is my 3rd session today. I had not changed anything in previous sessions, so don't know why the drop down menu has disappeared.

    Any help appreciated.
    HK

    Hi, hopefully a screenshot can make things more clear - when you right click in the area of the red dot, then a popup menu will appear where you can re-enable the toolbar of bookmarks.

  • try to open a game I have used several times before, on the desktop. get the VIOLATION of ACCESS MEMORY message and cannot open it__

    How to get around this? It worked well before. I recently installed Kapersky. Will this effect to the VIOLATION of ACCESS MEMORY message, when I try to open a particular game?

    Hi Lesley,

    Please use the Windows Vista Forums.

    Access violation occurs at any time that access to a memory area that the program has no access.  This may be due to the bad code, bad RAM, or even a bad device driver.

    Make sure you have up-to-date drivers installed on your computer.

    Disable Kaspersky and try to run the game with run as administrator and check if the problem persists.

    Let us know how it works.

    Kind regards
    Technical support of Microsoft-yama.
    Visit our Microsoft answers feedback Forum and let us know what you think.

Maybe you are looking for

  • Restoration of session at startup

    After an upgrade to ubuntu 12.04, whose firefox upgraded to version 39.0, I always get a 'session restore' at startup, and usually I have to start firefox in twice (i.e. the first time nothing happens).If it's relevant, I use NoScript, and I chose to

  • Pay Apple iwatch

    iI tried to use Apple pay on my iwatch again the card reader does not recognize my watch while my phone works. Is there a way to test the nfc on my watch that only 2 of the three payments worked until this all to morrisons.

  • Windows Explorer sees not full path

    AVG is telling me that I have files in these folders: C:\Documents and Settings\Administrator\Local Settings\Temporary Internet Files\Content.IE5\9DHN12EI\ymsgr1000_1270_us[1].exe. Windows Explorer doesn't let me see the folder Temporary Internet Fil

  • in the windows photo gallery when I shoot 1 picture to correct, there a haze of red around him ideas please

    I wanted to say that this is one of my photos

  • Vista Ultimate cannot find available wireless networks

    Fresh install of Windows Vista Ultimate on my desktop with the Linksys Wireless card can't find any available wireless network. My laptop in the same room (also Vista) detects and connects without any problems. I tried to reset the router, manually f