Pass the result of a SQL Query as table_name  for another SQL Query

Hi All,
How to pass the result of a SQL Query as parameter to another SQL Query
Eg: I am doing the steps below.
1) select distinct table_name as TAB1 from all_tab_cols where table_name like 'T_%' and column_name like '%XYZ'
2) I want to pass the table_name from step 1 above as parameter to another query "select * from TAB1"
Thanks

Naveen B wrote:
Hi All,
How to pass the result of a SQL Query as parameter to another SQL Query
Eg: I am doing the steps below.
1) select distinct table_name as TAB1 from all_tab_cols where table_name like 'T_%' and column_name like '%XYZ'
2) I want to pass the table_name from step 1 above as parameter to another query "select * from TAB1"
ThanksYou should craete PL/SQL code with cursor which will accept a parameter and call that cursor inside the first one
But if the first sql returns only one row, you can do it with simple sql code
select * from (select distinct table_name as TAB1 from all_tab_cols where table_name like 'T_%' and column_name like '%XYZ')- - - - - - - - - - - - - - - - - - - - -
Kamran Agayev A. (10g OCP)
http://kamranagayev.wordpress.com
[Step by Step install Oracle on Linux and Automate the installation using Shell Script |http://kamranagayev.wordpress.com/2009/05/01/step-by-step-installing-oracle-database-10g-release-2-on-linux-centos-and-automate-the-installation-using-linux-shell-script/]

Similar Messages

  • Minus and passing the result set

    I have a query in a procedure....let us say "test.prc":
    select A.VALUE from TABLE A
    where A.VALUE_ID = get_rec.VALUE_ID minus
    select B.VALUE from TABLE B
    In the above query, I am passing the "get_rec.VALUE_ID" from a cursor above the query.
    Now is there a way to capture the result set of the above minus operation and pass the result set to the calling sql program (called "call_test.sql")?
    Thanks,
    Chiru
    Message was edited by:
    Megastar_Chiru

    I got what I was trying to do...
    I have 1 more question though....I am printing out my output using dbms package from sql*plus...using the following command
    dbms_output.put_line(nvl('Flex Value set Id : '||get_rec.flex_value_set_id,0)||' values that have no corresponding alias : ' || nvl(v_flex_val,0));
    "get_rec.flex_value_set_id" gets passed in from my cursor above the dbms statement.
    and it looks like below:
    Flex Value set Id : 20118 values that have no corresponding alias : 00
    Flex Value set Id : 20118 values that have no corresponding alias : 10
    Flex Value set Id : 20118 values that have no corresponding alias : 11
    Flex Value set Id : 20118 values that have no corresponding alias : 20
    Flex Value set Id : 20118 values that have no corresponding alias : 30
    Flex Value set Id : 20124 values that have no corresponding alias : Standard
    Is there some way to neatly break when the value set id changes? ...ie., make it print output something like below:
    Flex Value set Id : 20118
    values that have no corresponding alias : 00
    values that have no corresponding alias : 10
    values that have no corresponding alias : 11
    values that have no corresponding alias : 20
    values that have no corresponding alias : 30
    Flex Value set Id : 20124
    values that have no corresponding alias : Standard
    Thanks,
    Chiru

  • Event 123 - The DSM service was delayed by nn seconds for a driver query/download/install on device then screen freezes

    The reader's digest version of the saga is I received a Dell Vostro 460 with a wiped disk. The PC emitted beep code indicating PSU or RAM issue when turned on.  After resolving the marginal power supply with a new replacement, I installed Windows 7
    but as soon as I would launch IE the system would freeze.  All of the BIOS & device drivers are current.  I tried upgrading to Windows 8 but kept getting the black screen right after the install process finished installing the devices. I had
    to resort to a clean install.  Having successfully install Windows 8.1 I have been able to a get to the desktop, however every time I launched IE my system freezes in the same way as with Windows 7.  I installed a different browser and used that
    to research the event log errors.  As the system freezes, I see warning log entries with event id 123 entries:
    Event 123 - The DSM service was delayed by 125 seconds for a driver query/download/install on device  'ACPI\GENUINEINTEL_-_INTEL64_FAMILY_6_MODEL_42_-_________INTEL(R)_CORE(TM)_I7-2600_CPU_@_3.40GHZ\_8'
    Event 123 - The DSM service was delayed by 517 seconds for a driver query/download/install on device 'PCI\VEN_8086&DEV_1C3A&SUBSYS_04AB1028&REV_04\3&11583659&0&B0'
    Event 123 - The DSM service was delayed by 106 seconds for a driver query/download/install on device 'PCI\VEN_8086&DEV_0100&SUBSYS_04AB1028&REV_09\3&11583659&0&00'
    Event 123 - The DSM service was delayed by 155 seconds for a driver query/download/install on device 'PCI\VEN_10DE&DEV_0423&SUBSYS_049410DE&REV_A1\4&2209AF9F&0&0008'
    There are more but these warnings are stacked in groups of two or three then the error & critical entries indicating I did a hard reboot. 
    When I use Firefox browser to open several tabs everything is fine until I stream audio/video then the same freeze screen happens and i have to reboot. Anything you can offer will be very much appreciated.

    Hi,
    'PCI\VEN_10DE&DEV_0423 is a graphic card driver from the vendor’s official webpage.
    Besides as you mentioned in the post, it happened when you launch Internet Explorer, there is an accelerated  Graphics item in the Internet Explorer, the settings should be changed, please follow this way:
    Go to the control panel, then select the Internet Option, go to advance, just like the screenshot below:
    select the checkbox if it is empty, anyhow make it different from the previous settings, then restart your computer to see the result.
    Wade Liu

  • My Wireless mac keypad has stopped properly working. The keys sometime do not correspond to the result, or a a simultaneous duel actio, for example when the delete button is pressed the. Ursor does go backwards, but it also turns the sound up. Any ideas?

    My Wireless mac keypad has stopped properly working. The keys sometime do not correspond to the result, or a a simultaneous duel actio, for example when the delete button is pressed the. Ursor does go backwards, but it also turns the sound up. The keyboard is properly connected to the computer, and the battery life is up in the nineties.
    Help please !!!!

    Hi, thankyou for your response. Can I just confirm that you mean turning the computer on and off again, or re-booting the whole system. If it is the first I have already turned the system on and off, with no luck.
    Regards

  • XDK for PL/SQL and XML Parser for PL/SQL

    Is there a difference between the terms:
    XDK for PL/SQL
    and
    XML Parser for PL/SQL V2
    or are they the same thing...?
    cheers,

    XDK stands for XML Developer's Kit. There are Oracle XDKs for Java, C, C++, and PL/SQL. These development kits contain building blocks for reading, manipulating, transforming, and viewing XML documents.
    XML Parser is one component of XDK. Other components of XDK are
    XSLT Processor, XSU, XSQL Servlet, XML Class Generator, etc.
    For more information on XDK and its components please refer to:
    http://otn.oracle.com/docs/products/oracle9i/doc_library/release2/appdev.920/a96621/adx01bas.htm#1656
    Regards,
    Anupama
    http://otn.oracle.com/sample_code/content.html

  • Hi, I need help my computer is not starting up at all, nothing happening when I press the button on/off. The battery charger is working as using it for another laptop. Not sure what to do. Anyone have any idea? many thanks

    Hi, I need help my computer is not starting up at all, nothing happening when I press the button on/off. The battery charger is working as using it for another laptop. Not sure what to do. Anyone have any idea? many thanks

    You could try a SMC reset:
    http://support.apple.com/kb/HT3964
    If no change, do what Allan advises.
    Caio.

  • Hi, we trialed from central and have bought the plus version but have still been charged for another month of the trial. Would you be good enough to refund the charge please considering we have bought the main product?

    Hi, we trialed from central and have bought the plus version but have still been charged for another month of the trial. Would you be good enough to refund the charge please considering we have bought the main product?

    After much back and forth drama, and the assistance of one awesome person at Apple, and also a great iTunes representitive, they have agreed to refund me.
    I have not yet recieved the refund but will post here when I do.
    This has been a long and drawn out headache, but I am glad that finally things seem to be set straight.

  • Hi, I am worried about the old Iphones, couldn't we change them for another version? I have my Iphone 3, love it, but now I am feeling out of the picture. The phone works perfect...Is there any plan to do so? like recycling?

    I am worried about the old Iphones, couldn't we change them for another version? I have my Iphone 3, love it, but now I am feeling out of the picture. The phone works perfect...Is there any plan to do so? like recycling?

    You can purchase any model (currently sold) iPhone that you desire.
    What's the big deal or so complicated about figuring that out?

  • My Ipad broken the screen, what´s the option I have, anybody knows? The apple gives options, to subsidies or replaice for another original screen?

    My Ipad broken the screen, what´s the option I have, anybody knows? The apple gives options, to subsidies or replaice for another original screen?

    I don't know what country that you are in, but in the US the price for repair (i.e. replacement) is (from here) :
    iPad model
    Out-of-Warranty Service Fee
    New iPad
    $299
    iPad 2, iPad
    $249

  • How to pass the result of one script to another?

    Hi
    Is there any possibility to pass info from one script to another? I run some scripts at night and they have to use the results I get during the day...
    Thank you in advance for any help
    Vera

    There's a couple of ways of doing this.
    It sounds like the second script isn't being called directly from the first one, so you can't pass the data directly, so that leaves you with a couple of options.
    One is to have the first script write the data to a file, then have the second script read that file.
    The other would be to store the data as a property in the first script - properties are saved between executions - then have the second script read the first script's property when it starts up.
    For the first option, just have the script write the data to a file:
    set myData to "here's the data to save"
    set myFile to (open for access file (path to home folder as text & "data.file") with write permission
    write myData to myFile starting at 0
    close access myFile
    Now the second script can read the file:
    set otherScriptsData to read file (path to home folder as text & "data.file")
    For the second option, just store the data as a property:
    property myData:""
    set myData to "here's the data to save"
    Now loading the data in the second script goes like:
    set otherScript to load script file "path:to:other.scpt"
    set otherScriptsData to otherScript's myData
    Here you can see the second script loading the script then reading its myData property.

  • How to pass the sequence number of current loop in a for loop in FPGA vi to the host

    PCI-7830R
    LV 8.2
    What I was trying to do is to use multiple DIO to generate pulse at different sequence. Mode one is to automatically sweep from DIO1 to DIO20; mode 2 is several DIOs generate pulse simoutaneously.  So I use a case structure to make the selection, in the mean time, I set up two for loop in each case so that I can use multiple pulse generations. For example, in scanning mode, if I set 2 exposures, it sweeps from 1 to 20 then do it again.  
    Then I need to get the loop sequence number, i of each scenario. So I put an indicator within the first loop, and create a local variable of it and put in the second one.  Running the FPGA vi alone, I can see the indicator change in each case from 0 to N-1, N being the for loop time.But in the host vi, I tried to add this indicator as an element in the read/write invoke method, in the debugging mode, I could only see it directly jump to N-1 without all the changes I saw in FPGA vi. 
    Is it possible to get this number passed correctly from FPGA vi to the host vi? Thanks

    Thanks for the reply Jared.
    Excuse me if it looks incorrect, but I'm new to FPGA programming, so I would have to look into the FIFO you referred to.  I used local variables because for one thing I have several different cases containing for loop in each of them, and I only want one indicator for the "i".  If I put the indicator out of any for loop, it's only gonna show the last number which is N-1.  For the other thing, it seems like property nodes are not allowed in FPGA vi.  And by doing this, I can see the i number changing from 0 to N-1 in each case, well, in FPGA vi's front panel.  But while I ran the host vi with everything, the indicator in host vi's front panel only showed the last number N-1. It may be the reason you said, it happened too fast before the indicator in host vi can catch it.
    What I want to realize is to group the data I collect in host vi, for example, when I choose multiple exposure in each mode, and the FPGA runs 1 through 20 then do it again, I want the data stored in two groups using the loop sequence number as the seperator in file name.  So it goes like 1-1, 2-1.......20-1; then 1-2, 2-2,.....20-2.

  • Query browser error for a Bex query

    Hello,
    I am using Query browser in Dashboards 4.0 to retrieve the data from Bex query. When I select a few dimension measures out of the structure with certain key figures and clicking the preview of the results, I am getting the error message as "Request Processing failed(XLS 000009)[] Error DBMAN(257):SQL Error:58115
    Error RS Exception:Arithmetic overflow error converting" kind of error message.
    When I remove some dimension members which were selected, I am able to see the preview of the data. What could be the probable reason for the above kinda error?
    Thank you.

    These are generic error, please go through the below link and let us know whether its helpful or not.
    Microsoft ODBC data manager not found
    Error during "Add Query" in Dashboard 4.0
    Happy to help you!
    -SumanT

  • Query Elements Description for a specific query - Useful for Translation

    Hello everyone,
    I would like to know how I can determine a list of all query elements (with their Element ID) within a single query. So, based on a query (technical name), I would like to have a list of all query elements used.
    I would prefer a list of Element IDs, so then I can check if the proper description of each element is available in different languages (in table RSZELTTXT).
    Or if there is a handy tool to check wether all elements are properly translated (and then I don't mean the translation module in the Adlinistration Workbnech, because it is not handy or opening Bex Query designer in different languages), please let me know.
    Kind regards from Belgium,
    Ben De Windt

    Hi,
    Please check for personalization, if the userid has hidden it?
    Regards,
    Harsha

  • I´m getting the following message: Email address is already verified for another Apple ID.

    When trying to add a new account I´m getting this error message: Email address is already verified for another Apple ID.
    I didn´t know I have another Apple ID. How can I find out which Apple ID is that one and how can I add this email address to the Apple ID I currently use? Thanks

    Are you sure you don't have another ID? If you purchased Apple hardware you may very well have been given an ID as part of the registration process. You can check this by going to http://appleid.apple.com and clicking 'Find My Apple ID'. Follow the instructions and it should list any IDs you have.
    However once an address has been associated with an Apple ID you can't use it with another (even if it's removed from the first) so you are probably going to have to use another address, such as a free one from Yahoo or GMail.

  • When I try to change ID get the following message:Email address is already verified for another Apple ID

    I just got an iphone 5 and want to establish an apple ID. I have 2 apple IDs: both are associated with my son. One uses my email address the other his. The one using my email adress is being used by him: apps, itunes etc. The one associated with his email address has nothing going on.So... I have changed the latter to be associated with my wife's email so that I might switch the IDs so that his email is connected  with his apps and itunes. No problem. Then, I tried to change the ID with my email address with his (the one I just changed), but I continue to get the message :Email address is already verified for another Apple ID. Does it take time for the system to disassociate his email with an apple ID? Is there something I am missing?

    In my experience, I have seen it take days. However, if the issue still persists a week from now, I'd check with iTS, as they can look up in directory services to see if you've (or someone else) has inadvertently combined this with other Apple IDs...  A very common thing since many users are not aware what they have even done.

Maybe you are looking for

  • Z68A-GD80(G3) Beta BIOS Versions For Ivy CPU's

     E7672IMS.J10 ==> E7672IMS.J21 01.Fix vdroop offset control function can't work normally issue and            modify code to avoid chip bug issue.    02.Add Gigadevice 25Q64BSIG" SPI ROM support.    03.Fix Adjusted DRAM Frequency and XMP info incorre

  • Group Messaging for Windows 8 Phones

    Can anyone tell me if Verizon is going to send an upadate for group messaging with the new Windows phones?  I have asked Verizon and they can't tell me anything about this and I spoke with At&t and all their's have the option to turn off and on the M

  • Ntsc subtitles pixellated

    hey all, i'm having a major issue with the quality of subtitles that i made within DVD SP. I am working on a feature film and needed to send NTSC copies to some american distribution companies. So i created the dvd files, then did the subtitles in DV

  • WAR vs. EAR

    We are converting our Web services to a new architecture that uses Spring & WebLogic 10. Our architects tell us we will no longer use EJBs. So, this raises the interesting question: Can we now use the simpler WAR format instead of EARs? I must have r

  • I cannot download App because of former owner

    I have bought a computer, OSX already installed. I clean the whole system. But it is still not possible to download apps. The message I get is that the App is already downloaded by other Apple-iD (the former owner of the MAC, I assume).