Insert values from more than one select query

Hi all, I've a simple question:
I need to insert values into a table from two select statements.
There's what I need to accomplish:
I need to monitor the cursors opened on a database, so:
I created the following table:
O_CURSORS
Cols: TOTAL (Number 5), USER (VARCHAR2 20), DATE (TIMESTAMP)
I think some query like the following should work, but unfortunately, it doesn't.
insert into O_CURSORS (total,user,date)
values (
(select a.value, s.username from v$sesstat a, v$statname b, v$session s where a.statistic# = b.statistic#  and s.sid=a.sid and b.name = 'session cursor cache count'),
(select sysdate from dual)
)This statement is not working, the message is
"Not enough values"
If I modify the statement as follows, it works fine
insert into O_CURSORS (total,user)
(select a.value, s.username from v$sesstat a, v$statname b, v$session s where a.statistic# = b.statistic#  and s.sid=a.sid and b.name = 'session cursor cache count'),
)Any advice would be very appreciated!
Thanks in advance.

You don't have to select sysdate from dual; it can be a part of any select statement. Just include sysdate in your first query:
INSERT INTO O_CURSORS (total,user,date)
SELECT a.value, s.username, SYSDATE
FROM v$sesstat a,  v$statname b,   v$session s
WHERE a.statistic# = b.statistic#
  AND s.sid=a.sid and b.name = 'session cursor cache count'You'll note also that I elimiated the VALUES keyword, and just used a SQL statement to satisfy the INSERT statement.
Edited by: user13640471 on Feb 21, 2011 1:17 PM
Edited by: user13640471 on Feb 21, 2011 1:18 PM

Similar Messages

  • RE: Getting multiple values from more than one multiple select popup window

    I have a button on a JSP of mine that when clicked creates a popup window (right now it is called popup.html) with a multiple select menu.
    My question is how do I get all the values selected from the menu into my JSP (sample.jsp) so that I can set each of the values for my bean.
    The other problem is that I have more than one select multiple menu.
    Please help if you can. Any advice or suggestions here would be greatly appreciated!
    Thank you!

    I realize that I can use request.getParameterValues to get the values selected from my html because I am passing them to the hidden inputs I have and then using the request.getParameterValues to get each of the values.
    MY PROBLEM IS WHAT IF I HAVE 4 MULTIPLE SELECTS??? How can I use the same html popup menu to get the values from the 4 different multiple selects????
    I look forward to your response.
    This code is from my JSP:
    <INPUT TYPE="TEXT" NAME="Field1" SIZE="15">
    <INPUT TYPE="hidden" name="F1Rad1">
    <INPUT TYPE="hidden" name="Permission">
    <input type=button name=choice onClick="window.open('optionPicker.html','popuppage','width=250,height=100');" value="Options"></TD>
    Here is my optionPicker.html code for the pop up menu:
    <html>
    <head>
    <script language="JavaScript">
    function sendValue(s)
    var boxSize= s.options[0].value;
    var restrict     = s.options[1].value;
    window.opener.document.addNewForm.F1Rad1.value = boxSize;
    window.opener.document.addNewForm.Permission.value = restrict;
    window.close();
    </script>
    </head>
    <body>
    <center>
    <form name=selectform>
    <select multiple name=selectmenu size="2">
    <option value="large">Large Text Input Area
    <option value="restrict">Restricted Access
    </select>
    <p></p>
    <input type=button value="Select Option(s) For Field" onClick="sendValue(this.form.selectmenu);">
    </form>
    </center>
    </body>
    </html>

  • JDBC-XI-FILE scenario. How to extract data from more than one table in JDBC

    Hi,
    I was asked a question like in JDBC-XI-FILE scenario........ How to extract data from more than one tables (i.e from JDBC system) ?? What is the logic to do the same ??
    I am not sure whether this is a valid question..........but any help in this regards is highly appreciated.
    Regards
    Kumar

    HI,
    Yes it can be possible ,please see the following links
    JDBC  Receiver with Oracle Stored Procedures
    configuring jdbc adapter with multiple tables
    RFC -> XI -> JDBC Scenario Updating Multiple Tables
    /people/alessandro.berta/blog/2005/10/04/save-time-with-generalized-jdbc-datatypes
    JDBC Adapter multiple Selects
    https://www.sdn.sap.com/irj/sdn/advancedsearch?query=jdbc%20with%20multiple%20tables&cat=sdn_all
    Regards
    Chilla..

  • On some pages the text from more than one paragraph stack up on top of each other, like writing something then writing something else on top of it.

    On some pages the text from more than one paragraph stack up on top of each other, like writing something then writing something else over the top of it. Some pages will run text and pictures together, like a car rear-ending another or a train pile up. Other pages will cut an image or text short, i.e. it will display a portion of the top of the image or text but not the rest. This happens on Amazon for example, the section where it says "Customers who looked at this also looked at" will allow only a certain amount of the upper portion of the description immediately below the picture of the product but below that section everything is fine until I get to another section displaying more products and their descriptions and then it cuts the bottom portions off again. I've noticed this behavior mostly in the sections with product photos, the text sections seem okay. YouTube also displays this behavior. It's even doing it on this page right now. Below this box I can read "The more information you can provide the better chance your question will be answered " , but directly below that in the next sentence I can see the start of it with "Troublshootin" and the "Automatically Add" in a green field covering the "g". The next clear text is "A window will open in the top corner. Click Allow, and then click Install. If the automated way doesn't work, try these manual steps." I tried turning of pre-fetching, clearing history, cookies, and cache, scanning for malware with Avast and Windows Defender all to no avail. It began when I upgraded from dial up to DSL via AT&T Uverse. I have a Motorola NVG510 modem. The modem was replaced an hour ago along with new dedicated lines and DSL/Phone splitter from the box by an AT&T technician to make sure my incoming lines were up to par. He ran a connection test and verified everything is up to standards. IE does not display this behavior. I am running Firefox20.0.1 and all previous versions have acted the same way since I upgraded to DSL about 3 months ago.

    If you have increased the minimum font size then try the default setting "none" in case the current setting is causing problems.
    *Tools > Options > Content : Fonts & Colors > Advanced > Minimum Font Size (none)
    Make sure that you allow websites to choose their fonts.
    *Tools > Options > Content : Fonts & Colors > Advanced: [X] "Allow pages to choose their own fonts, instead of my selections above"
    It is better not to increase the minimum font size, but use an extension to set the default page zoom to prevent issues with text not being displayed properly.
    You can use an extension to set a default font size and page zoom on web pages.
    *Default FullZoom Level: https://addons.mozilla.org/firefox/addon/default-fullzoom-level/
    *NoSquint: https://addons.mozilla.org/firefox/addon/nosquint/

  • Can takes from more than one track be comped at the same time?

    Greetings,
    I know that this question has been asked recently in this forum (http://discussions.apple.com/thread.jspa?messageID=9527542&#9527542), but I don't think that the respondents completely understood the question... Or perhaps I did not understand the suggested solutions to the problem. I will ask the question in a slightly different way...
    Suppose that I record guitar with 2 microphones (a pickup mic, and a room mic). The first microphone is recorded onto track 1, the second microphone is recorded onto track 2. Multiple takes are done in this manner. When it comes time to comp the tracks, how is it done? Can the takes from more than one track be comped together at the same time? I have tried to do this by grouping both tracks together, but it does not work.
    Any suggestions?
    Thank you.

    You had the right idea grouping the tracks together. You must make sure that in the group settings, the box titled "region selection (edit)" is checked. This will allow you to make the same cuts (or in this case, swipes) on all regions in the group.

  • More than one selects in a function

    Hi All,
    Is it that there can not be more than one selects in a function?What is the work around for this thing?
    Regards,
    Amit.

    Hi Krystian Zieja ,
    Thanks for responding. I do not know what was going wrong but now it is working fine.
    The problem is that I was not able to compile a function with two select statements in it. If I could comment one of the select statements it was getting compiled. But now it is getting compiled with both the selects.
    Now since we are at it can you solve another of my problem. I want to see the output of my function. If I write DBMS_OUTPUT.PUT_LINE statements in it I am not able to see the output. Is there anyway that I can call my function and it can show the output on the screen.
    I am using Benthic Golden 32 editor. Is there any way in it that I can call my function from it ?
    Regards,
    Amit.

  • Combo box or similar where more than one selection can be made

    Hi. I need to create a combo box field or similar where more than one selection can be made. Does anyone know if this is possible? I know this can be done with the check box tool but the client wants a drop down box. Thanks in advance.

    I don't quite understand some of this but of course you can bind more than one object into the RMI Registry. If you use different names the clients will use the object corresponding to whatever name they looked up. If you rebind different objects to the same name, the clients will use the object that was there at the time they did the lookup.
    Clustering is a problem for RMI/JRMP because stubs are not location-transparent: they refer to the originating JVM. If you need this kind of functionality I would use RMI/IIOP and do some CORBA magic in the ORBs at both the clustered servers. CORBA references are location-transparent so a service can be logically 'moved' from one JVM to another.

  • Opening hotmail: Please refresh your browser window, When you access your Windows Live Hotmail account from more than one computer, we ask you to sign in again to help keep your account private and secure . Refreshed but no change. in Safari no problem

    opening hotmail in firefox: Please refresh your browser window, When you access your Windows Live Hotmail account from more than one computer, we ask you to sign in again to help keep your account private and secure . Refreshed but no change. in Safari no problem

    Go to '''Options '''on Firefox Browser-->'''Advanced'''-->''Click on'' '''Network '''tab-->''Select '''''Settings'''-->''Select '''''Use System Proxy Settings
    '''

  • HT1206 Can I have in one iphone 5 music from more than one itunes accounts?  My daughter and I have our music in the same pc. She and I have iTunes accounts. I have not been able to load in my ophone with my itunes acct music that she purchased in her acc

    Can I have in one iphone 5 music from more than one itunes accounts?  My daughter and I have our music in the same pc. She and I have iTunes accounts. I have not been able to load in my ophone with my itunes acct music that she purchased in her account.  I have not been able to do this. Thanks

    iTunes Match is not sharable across Apple IDs. The best way to get the music on her iPad is to leave hers signed into her Apple ID on the iTunes Store and sync via USB.

  • Reporting from more than one infocube and also from multiple ODS

    Hi all,
            Someone please help me in these issues.
    How can we do reporting from more than one cube ( if data in all the cubes are required, but only a few fields from each cube). And how to do the same with more than one ODS.
    Thanks in advance,
    Sekhar

    Hi Sekahr
    Can u jus create a multiprovider.
    Before creating the multiprovider..Just check the Common charcterstics avilable in
    all the ods based on that give the mapping ..
    and then once u have completd the creation of multiprovider execute the same in
    the tcode <b>Listcube</b> and then create the querys as per the user thats it...
    Regards
    R M K
    Assining points is the only way of saying thanx in SDN ***

  • My itunes library has organically grown from more than one itunes account but all now on a separate computer.  If I upgrade to iTunes match will I have to pay for each account?

    My itunes library has organically grown from more than one itunes account (all paid for by me) but all now on a separate computer.  If I upgrade to iTunes match will I have to pay for each account or just once, for the computer?

    No.  Provided the computer that you use to upload / match your Songs is authorised to play all of the Songs all works well - once complete you can download Song files that will play on your libraries / other computers without each computer having to be authorised.

  • How to assign values for more than one field

    Hi,
    I have written following code
    constants: fieldname(30) value '(SAPMF02D)KNA1-AUFSD'.
    constants: fieldname1(30) value '(SAPMF02D)KNA1-LISFD'.
    constants: fieldname2(30) value '(SAPMF02D)KNA1-FAKSD'.
    field-symbols: <L_FIELD>  TYPE ANY.
    field-symbols: <L_FIELD1> TYPE ANY.
    field-symbols: <L_FIELD2> TYPE ANY.
          Assign (fieldname) to <l_field>.
          <L_FIELD> = 'ZB'. " value according to your requirement
          Assign (fieldname1) to <l_field1>.
          <L_FIELD1> = 'ZB'.
    while debugging <l_field1> is not assinging (fieldname1).
    Im able to assing for (fieldname).
    how to assign value for (fieldname1).
    plz suggest me to assign values for more than one field.
    Regards,
    Brahmaji

    Hello,
    Because there is no field name called LISFD in KNA1. Actually you misspelled the field name.
    It is KNA1-LIFSD

  • How to pull groups from more than one OU using weblogic "All Groups Filter" from AD.

    Hi,
    Please help me for pulling groups from more than one OU using weblogic "All Groups Filter" from AD.
    AD structure is:
    c001639domain.local
           ||
           ||
        OU=Security_Groups
                      ||
                      ||
                      >> OU=CORP_ECM---> n number of group
                      >> OU=CORP_hodata--> n number of group
                      >> OU=CORP_citrix--> n number of group
                      >> OU=CORP_driver --> n number of group
                      >> OU=CORP_temp --> n number of group
    Requirement is i want to filter groups from OU=CORP_ECM and OU=CORP_hodata.
    Thanks,
    Jagan.

    I used below option but its not working getting zero groups.
    (&(objectClass=group)(|(ou=CORP_ECM,dc=Domain,dc=com)(ou=CORP_hodata,dc=c001639domain,dc=local)))

  • How to from more than one delivery note - conversion into one invoice

    Dear Experts,
    How to from more than one delivery note - conversion into one invoice?
    Thanks and best regards,
    Wilson Hong

    Dear Wilson Hong,
    Single invoice for multiple deliveries will takes place based on these criterion
    1.If you want single billing document for multiple deliveries these data should be same in all order for all items.
    -> Payer
    -> Inco term
    -> Payment term
    -> Actual GI Date from Delivery
    -> Shipping Condition
    -> Account Assignment Group
    -> Exchange rate (in case of export sale order)
    -> Foreign trade data.
    2.In addition to this you need to maintain proper copy control settings between delivery and invoice.
    Go to VTFL transaction input your delivery type and invoice type then go in to the item level settings here you find field Data VBRK/VBRP maintain this field with routine 3-Single invoice.
    If the above data and settings are exists you can do single invoice for multiple deliveries.
    I hope this will help you,
    Regards,
    Murali.

  • Can a master data will have loading from more than one data source

    Dear gurus,
          I have a master data object which has every day loading from one particular data source. Now I got a requirement to load data from another data source. If we load data from more than one data source , will there be any problem with data? Will it accept loading from more than one data source.?
    Regards
    Rs

    Hi Ram,
    We can load the data to target morethan one datasource.Thats advantage in BI compare to BW. It will accept loading from more than one datasource.but you have to take care about characteristic and attributes are the same in both datasources like that.
    Regards,
    SVS

Maybe you are looking for

  • Apps bought with old apple id? I cant update app as ID is no longer in use?

    I have an old apple account that alot of my apps were bought on. I didnt use this id for a couple of months and now it is no longer a registerd ID, even though I did not delete it I have a new ID now but my problem is that when I try and update or bu

  • IPhone 4 only syncs last photo in every picture folder selected

    My husband's IPhone 4 refuses to sync more than one photo from each folder he selects to update. It's always the last photo in the folder. He's had this problem from day one of owning the phone, and he's tried many times to fix. He's running Windows

  • KM Notifications using UWL

    Dear KM gurus ~~      I want to configure KM notifications using UWL. To be more specific, I want to configure a way so that a notification is sent out to an user, who has opened a document for editing locally and has not yet checked in those documen

  • USage of URL iView

    Hi All, How can we use the URL iView, in the process of portal branding. Regards Seshu

  • BundleException: Unable to resolve package; (package=org.apache.felix.scr.annotations)

    Hi guys, My bundle is installed but not active: Got the following errors in my log: org.apache.sling.installer.core.impl.tasks.BundleStartTask Could not start bundle (bundle ID=1246) : myservlet.bundle. Reason: org.osgi.framework.BundleException: Unr