Same link several times variable using dynamic SQL

Salvation;
I have a query that uses the variable even several times, is there a way I could just use that variable only once and it will take several times.
Request is;
run immediately "SELECT count (*) x WHERE MONTH_ID =: VOMNTH_ID"
UNION
SELECT count (*) FROM Y WHERE MONTH_ID =: VOMNTH_ID
Union
SELECT count (*) FROM WHERE MONTH_ID = z: VOMNTH_ID ' help months1, month1, months1
What I don't want only once to provide months1.
Your help is appreciated.
PKM
execute immediate
  'with p as (select :vmonth_id pmon from dual)
SELECT count(*) FROM x,p WHERE MONTH_ID = p.pmon
UNION
SELECT count(*) FROM Y,p WHERE MONTH_ID = p.pmon
union
SELECT count(*) FROM z,p WHERE MONTH_ID =p.pmon '
using month1;

HTH

Nigel cordially

Tags: Database

Similar Questions

  • How to extract the same song, several times using different bit rates or formats and store all the digital music files in WMP 12 default on the same HDD music library

    Using Windows Media Player 12 (w/under Windows 7), "can I ripping the same song, several times, using different bitrates & and/or formats and store all the digital music files in the music library by default WMP - 12, on the same hard drive?

    1.) #1 goal: tear up the same song repeatedly, w / "different rates" as a WMA file.

    2.) #2 goal: tear up the same song repeatedly, w / "different rates" as an mp3 file.

    3.) #3 objective: NOT to each subsequent copy (version) of the song, deleted & and/or replaced by the previous version of the song [even].

    4.) question Bottom Line Up Front--> is Windows Media Player 12 (included with the Windows 7 operating system) are able to achieve '#1 objectives; #2; & #3 above?

    5.) details/example: I want to tear the piece "Maria Maria by Carlos Santana" to my laptop as a Windows Media Audio [WMA] file.  In addition, I would like to rip the song 'Maria Maria' three several times with 3 different bitrates in format WMA; and, as an MP3 file.  Therefore, my final result wished (after the extraction process), will take place the four 4 audio files split up as follows: (a) 'Maria Maria by Carlos Santana'--> Format: file WMA; Ripped @128 Kbps bitrate.  (b) ' Maria Maria by Carlos Santana'--> Format: file WMA; Ripped to the "Variable bit rate; (c) ' Maria Maria by Carlos Santana'--> Format: file WMA; Ripped commissioning "Lossless." and (d). 'Maria Maria by Carlos Santana'--> Format: MP3 file. Ripped @256 Kbps bitrate.

    6.) my preference: I do NOT want to rename the file (s). {for example, 'Maria Maria by Carlos Santana' renamed/changed for--> "Maria_Maria_by_Carlos_Santana_128kbps.wma",...} 'Maria_Maria_by_Carlos_Santana_256kbps.mp3 '; etc.}.  In addition, I am not concerned about the additional disk space that will be consumed after multiple copies of the same song with different speeds of transmission and different formats.

    7.) my experience w / Windows Media Player 10 (w / the operating system of Windows XP): using WMP - 10, my goal (s) described above is not a problem at all.  Simply insert the CD purchased by Carlos Santana, containing the song "Maria Maria"... Select the desired Format (WMA; WMA VBR; WMA Lossless; or mp3)... Select the desired flow rate (WMA... 128/160/192kbps_mp3: 128/192/256/320 kbit / s; etc.) ; and click on the "RIP" button to start the copy process on the hard disk of of Carlos Santana's "Maria Maria".  This process (w / WMP-10) would result in having the same song, copied on the hard disk, with levels of quality different "audio" (via the different bit rate settings); regardless of the format (MP3/WMA) which was chosen.

    8.) my experience w / Windows Media Player 11 (w / the operating system of Windows XP): using WMP 11, to described above of my objective (s) could not be reached e-a-s-i-l-y.  The problem with WMP - 11 - in short - which was after the desired selection "Rip settings" tab 'Options' of WMP - 11 (i.e., Format & Bit Rate) and heart-wrenching piece wanted to {'Maria Maria by Carlos Santana'} a moment later/second, WMP11 remove / would crush the previous version of the song [even].  Therefore, the program would NOT allow the user to have multiple copies of the same song on the hard drive of the PC; which obviously restricts a user to have the freedom to choose what level of quality digital audio, they prefer to listen to.

    9.) the ability to have multiple copies [at my descretion] of the same song (on my hard drive) with different bitrates and formats in my music library, is important for me because it has a direct impact on "how I enjoy MY music ', and in what form (audio quality), I choose to listen to my music.  {For example, when I exercise and listening to my camera, digital audio player (Zune), a song ('Maria Maria by Carlos Santana'), will usually be torn off at a lower rate due to the unit of capacity reduction of storage - compared to the storage capacity of notebook PCs/desktop/external hard drives PC.}  However, when I listen to my music through my home cinema or entertainment system (which contains a hard disk dedicated with a large storage capacity), I prefer to load the entertainment system with digital music files that have been ripped to WMA... with the bit being rate-setting is for the: settings "WMA Variable Bit Rate" or "WMA Lossless.

    10.) there you have it.  This is my first post in this forum.  I hope that [detailed] explanations, will be sufficient to encourage these "with knowledge & the hands on experience" using Windows Media Player 12 (as well as with WMP-10/WMP-11 respectively), by providing a [step] "How-to"... "solution to my situation.  It would be highly appreciated.  I'm looking forward-'the solution' - and relevant suggestions & and/or community feedback regarding my request for assistance.

    * Thank 'All' (that would) in advance... For your time & Assistance *.

    Certainly, you can, but I would say that they be in different folders, for your convenience as well as Windows.  You can create one for each debit/format, then you will know who is who.

    In Windows Media Player, on the toolbar, select Tools, Options, Rip, and then select the flow you want first, rip music, then change the folder (higher on the same tab) and rip again... and so on and so forth.

    When you are at home on your home theater, you can use the 320 bitrate folder, when you transfer to the Zune, you can use one of the lower bitrate files (although I personally tear it up to 320 and let the Zune reduce as he wants, even with the iPhone via iTunes, hard drive space is not really a problem here) my server has several hard drives, and I can always add more if and when space is low!

  • Help please - component video using the same clip several times

    Hi people,

    I have a 9 minute video I want to cut into pieces and make a 3 min video. I searched the help system and Forum, but found nothing - very probably (not being is not a native speaker) looking for the wrong keywords.

    How can I add the same clip several times to a movie? If that has been resolved, I could do the rest with setting- and outpoints and would.

    Thank you in advance.

    Christoph

    You can place the clip on the timeline and use the Split Clip (small scissors under the monitor icon) to split your clip. Place the cursor where you want to trim your clip, and then click the icon of the scissors. Move the cursor to the next position, and then click the icon of the scissors again. Then press DELETE on your keyboard and that article will be deleted and the gap will be closed. If you wish, you can take small sections, you created and drag them around to change their positions.

    Once you have edited your clip, you can export the section 3 minutes as a DV - AVI to use repeatedly in your video. All you need to do to export is file > export > Movie. If you have several clips on your timeline you must place the work area bar (WAB), the gray bar above the timeline, on the section that you want to export. Then in the window export movie go into settings and for the beach, select work area bar.

    You can then reimport the 3 minute clip in your project and use it as many times as you want.

  • link: new values on after the trigger by using dynamic sql.

    Hello all I have a problem I want to solve using dynamic sql on a trigger. The problem is that are around 5 qty fields who each have 18 separate fields. This is because of different sizes (S, M, L, XL, etc., up to 18). So I will try to use the: new values on a trigger to dynamically fill these information on a table, but immediate execution is run is returning the value like: new.open_sz (x) instead of the actual numeric value of the column. See code below. Is there a way to do this.

    Thank you in advance.


    CREATE OR REPLACE TRIGGER T_EXAMPLE
    after update of
    open_sz1, open_sz2, open_sz3, open_sz4, open_sz5, open_sz6,
    open_sz7, open_sz8, open_sz9, open_sz10, open_sz11, open_sz12,
    open_sz13, open_sz14, open_sz15, open_sz16, open_sz17, open_sz18
    on order_li_m for each line
    declare
    Is of TYPE NumArray table indexes number directory;
    NumArray v_orderqty;
    -TYPE VarArray is the table of the varchar2 (200) index directory.
    -v_orderqty K_A2KSTD. VarArray;
    v_col varchar2 (30);
    v_sql varchar2 (1000);
    BEGIN
    for a 1 in... 18 loop
    v_col: = ': new.open_sz' | one;
    v_sql: = ' SELECT: 1 double ';
    run immediately v_sql in v_orderqty (a) using v_col;
    dbms_output.put_line (v_orderqty (a));
    end loop;
    end T_EXAMPLE;
    /

    Raffy Martin wrote:
    Is there a way to do this.

    You may not use: news and: old identifiers in dynamic SQL, the way to do it is to specify the real column names.

  • Same image several times in a project?

    Can someone explain to me how I can use the same image several times in the same project?

    What kind of project?

    If you create a book or calendar, or card, you can move the film strip with photos to 'Placed Photos' and then you can add the same photo for additional photo boxes, for example:

    For a slide show select the picture to present, and then use the combination of keys ⌘D or "Image > duplicate" to create several versions of the same photo and add additional versions in the project.  "Duplicate" actually not dupliquera not the original file. All versions will share the same original.

    For example - the same picture several times in a slide show:

  • Can I fade in and out on the same track several times in After Effects?

    Hi all

    I was wondering if it is possible to fade in and out, on the same track, several times. Like, I have this audio I want to fade at the beginning-48db to + 0 dB, and at the end of the song I want it to go from + 0 dB to-48db. I don't know if it's possible, but I can't get it to work. Can I get more than two keyframes for the same way?

    Thank you for taking the time to read my question.

    Marco van Lindt

    I do not recommend the use of AE to do any sort of audio work, but yes. You can have hundreds of keyframes by track. If you set the value, we must add another keyframe. There is no that?

  • problem using dynamic sql

    Hi all

    I have to insert the record in a table in one database to another database which requires db_link.so to do this I use run immediately, but when I try to insert by using the procedure below it will directly itno exception block.
    Help, please



    declare
    p_study_to NUMBER: = 1;
    p_study_from NUMBER: = 3;
    P_db_link VARCHAR2 (30): = 'abc ';
    BEGIN

    RUN IMMEDIATELY ' INSERT INTO RRRRR
    (study_to, db_link, dt_created, dt_modified, modified_by)'
    ||' SELECT study_to, db_link, dt_created,
    dt_modified, modified_by
    OF UUUU@:2'
    using p_study_to, p_db_link;
    EXCEPTION
    WHILE OTHERS
    THEN
    dbms_output.put_line ('error when inserting in RRRRR');
    END;
    /


    Thanks in advance!

    Hello

    You can tell only AID like this to give values for expressions, not table names (or their qualifications, as in this case).
    Try:

    declare
         p_study_to     NUMBER := 1;
         p_study_from      NUMBER := 3;
         P_db_link      VARCHAR2(30) := 'abc';
         sql_txt          VARCHAR2 (2000);
    BEGIN
    
         sql_txt := 'INSERT INTO     RRRRR (study_to, db_link, dt_created, dt_modified, modified_by)'
              ||           ' SELECT  study_to, db_link, dt_created, dt_modified, modified_by'
              ||          ' FROM    UUUU@' || p_db_link ;
         dbms_output.put_line (sql_txt);
    
            -- EXECUTE IMMEDIATE  sql_txt;
    END;
    

    Whenever you write dynamic sql code, it displays first.
    Only when it shows something that looks right should you UN-comment the EXECUTE IMMEDIATE statement.
    Before you go into Production, comment out code (or delete) the call to put_line.

    Use an EXCEPTION handler only when you can improve on what is the mechanism of error by default, for example, you plan a particular error, and you have something specail do when this error occurs.

    Using dynamic SQL just to have the same code running on different databases, where each database needs a different connection name? If so, use synonyms instead of dynamic SQL.

  • Cannot download apps - constantly says that cc has lost functionality I have re installed several times and used the cc cleaning tool - HELP please not very impressed with not be able to use a new customer applications!

    Hi all

    New customer to CC, cc said constantly that he lost the functionality and to re - install, I have done this several times and used the CC cleaning tool. What's the point of having CC if you cannot use this?

    Thanks for your reply, but I spent some time with support online yesterday which has managed to make me sort, I do not have a UPDATER AAM file, I could not delete the contents of the OOBE folder either, I had to rename the folder creative cloud. I was sent then the application manager - who was then updated to the new until I'm able to get apps. Long-term, but it worked. I tried the procedure you have above, just not all the steps worked for me. Thanks to the Member of the support staff who helped me, I have been literally pulling my hair out!

  • Installed CC 30-day trial.  Getting the error "Lightroom can't create a catalog named"ightroom catalog on volume OC (c) because Lightroom can't save the changes to this place". Tried to "Choose a different catalog" same mistake several times.

    Installed CC 30-day trial.  Getting the error "Lightroom can't create a catalog named"ightroom catalog on volume OC (c) because Lightroom can't save the changes to this place". Tried to "Choose a different catalog" same mistake several times.

    Hello

    Try resetting preferences

    Note:-back up your Lightroom Catalog beforehand and save Photoshop preferences

    * Now reset preferences Hold Down CTRL + ALT + SHIFT (WIN) CMD + OPTION + SHIFT (MAC) while starting Lightroom. A dialog box appears prompting you to restore Preferences (LR)

    Once done open again Lightroom

    Make sure you have a lot of read/write of the location where you save the catalog... To create a folder on your desktop, confirm, then try to create the catalog again it

    I would like to know if there is a question...

    Thank you

    Assani

  • How to write the SQL without using dynamic SQL?

    How can you write this under SQL without using execute immediately?

    You can use static SQL (using something like a CASE statement)?

    test procedure (one in varchar2, b number, each number) is

    v_num_recs pls_integer;

    Start

    Select count (*)

    in v_num

    FROM table1

    where

    col1 = one and

    If b is not null then col2 = b

    If c is not null then col3 = c;

    / * i.e. If b is not null, where condition to add this line only. If c is not null, where condition should add only this line. OR condition No. it * /.

    dbms_output.put_line (v_num);

    end;

    Or should I use dynamic SQL statements for this?

    I was wondering if the two are NOT NULL? Well check this.

    Select count (*) in v_num

    table

    where col1 = one

    and col2 = (CASE WHEN (b is not null) THEN b ELSE END col2)

    and col3 = (CASE WHEN (c is not null) THEN ELSE END col3 c)

  • Challenges using dynamic SQL for data quality tests

    (published for the wrong forum)

    Background:

    I'm developing a data quality, mechanism, on Oracle 11 g, which uses five blocks of PL/SQL by test test script:
    < li > two to supervise the event test by inserting a record in this regard in a fact table and update after the test with the result of the counts;
    table < li > two to create an image "should be" of the tested data set and store it in a scene.
    < li > and the remaining block to perform the analysis by selecting a union of the staging table data and the data "such what" of the target table, abandoning all matching files so that only incompatibilities (errors) remain and store this information in a results table, labeled with either recording source "should be" ("should be") or target ("such what").

    I intend to do this pilot by the data, so that each block is stored as a value in an array of scripts, associated with one or more test scripts through the record key values and pulled in a SQL statement execution by a stored procedure in a package called by Informatica Oracle dynamic. In this way, a variety of data quality tests can be programmed as automated controls that work every night and trigger alerts if problems are detected.

    I have two challenges:
    < li > PL/SQL blocks that create the DataSet "should be" can be very long, and I learned through Discussion Forums OTN size maximum of 32767 K for a string of PL/SQL variable cannot be large enough to fit the entire block, and the EXECUTE IMMEDIATE statement accepts not the CLOB.
    < li > if there is no anomaly, the trick of COUNT () ON the PARTITION that I use to get the counts of subquery won't work, because the analysis block everything is an INSERT INTO < i > < /i > table (column1, Column2, etc.) SELECT (< i > < /i > comparison query) statement, to avoid that my duty to hit the table target several times. My approach to this is driven by performance problems.

    First question: can I I EXECUTE IMMEDIATE nest, so that the SQL block running offers another EXECUTE IMMEDIATE statement that calls another block of SQL? This would solve my problem first.
    Second question: what is the way most effective to get the record account of subqueries in an INSERT INTO (SELECT) statement? I feel I'm too close the code to see the obvious answer here.

    Here is a shell of the block analysis ((deuxieme question):
    DECLARE
    
    StartDate DATE;
    EndDate DATE;
    TEST_KEY NUMBER;
    
    BEGIN
    
    INSERT INTO TEST_EVENT_DETAIL 
        (TEST_EVENT_KEY,TEST_EVENT_DETAIL_KEY,COLUMN1,COLUMN2,COLUMN3,COLUMN4,
        COLUMN5)
    SELECT
        TEST_KEY as TEST_EVENT_KEY,
        TEST_EVENT_DETAIL_SEQ.NEXTVAL AS TEST_EVENT_DETAIL_KEY,
        RESULTS.TABLENAME as COLUMN1,
        RESULTS.COLUMNNAME1 as COLUMN2,
        RESULTS.COLUMNNAME2 as COLUMN3,
        RESULTS.subqry_count as COLUMN4,
        null as COLUMN5  -- there are more generic columns, this is just an example; columns not used by a particular test are filled with nulls
    FROM
    (SELECT MIN(TABLENAME) as TABLENAME,
        min(subqry_count) as subqry_count, 
        COLUMNNAME1,
        COLUMNNAME2
      FROM 
    (SELECT TABLENAME as TABLENAME,
        count(TABLENAME) over (partition by TABLENAME) subqry_count,
        COLUMNNAME1,
        COLUMNNAME2
      from
    (
    /** Source Data **/
     SELECT 'SOURCE' as TABLENAME,
        COLUMNNAME1,
        COLUMNNAME2
       FROM TEST_EVENT_STAGE A
     WHERE A.TEST_EVENT_KEY=TEST_KEY
      UNION ALL
    /** Target Data **/
      SELECT 'TARGET' as TABLENAME,
        COLUMNNAME1,
        COLUMNNAME2
      FROM TABLENAME B
      WHERE ____________
    ) TMP
    )
    GROUP BY COLUMNNAME1, COLUMNNAME2
    HAVING COUNT(*) = 1 -- this drops out all records that don't match
    ORDER BY COLUMNNAME1, COLUMNNAME2, TABLENAME ASC
    ) RESULTS;
    
    END;
    and here's some pseudocode for the stored procedure that would call the PL/SQL (first question) blocks:
    Declare
    
    TestProcessStart DATE;
    TestKey     NUMBER;
    StartDate      DATE;
    EndDate      DATE;
    BlockStatus        varchar2(200);
    BlockSQL        varchar2(32767);
    
    begin
     
    Set BlockSQL=(select SCRIPT_BLOCK from DIM_SCRIPTS where SCRIPT_KEY=(select SQL_BLOCK2 from DIM_TEST where TEST_KEY=TestKey));
    
    execute immediate 'begin ' || BlockSQL || '; end;'
       using in BlockSQL, in out BlockStatus ;
    
     if BlockStatus != 'OK' then
        dbms_output.put_line('error');
     end if;
    end;
    Any ideas/recommendations?

    PL/SQL blocks that create the data set "should be" can be very long, and I learned through the Forums of Discussion OTN 32767 K maximum size for a string of PL/SQL variable cannot be large enough to fit the entire block, and the EXECUTE IMMEDIATE statement does not accept the CLOB.

    Not in 11g more: EXECUTE IMMEDIATE statement:

    »
    dynamic_sql_stmt

    Literal string, string variable or string expression representing a SQL statement. Its type must be CHAR, VARCHAR2 or CLOB.
    «

  • Loading the same image several times

    I'm trying to dynamically load one image several times in flash. Basically, I want to end up with two movieclips mc1 and mc2 that contains the image. I am currently using the load (connected to the ProgressBar) component to dynamically load the image. It works very well for the loading of the image once, but I don't really know how to create a second clip with the image.

    Here is my code for loading the first image:


    var mc1:MovieClip = new MovieClip();
    var listener: Object = new Object();
    Listener.Complete = function (eventObj:Object) {}
    nextFrame();
    };
    imageLoader.addEventListener ("complete", listener);
    MC1 = imageLoader.content;
    imageLoader.load (imgURL);


    But everything that I tried to load mc2 with this same image has failed. I tried 'mc2 = imageLoader.content', 'mc2 = mc1', "attachMovie", "duplicateMovieClip", called imageLoader.load () twice on the imgURL and creating a second component Loader and load the image again. All of these methods have failed. Most of them can load mc1 alright and sometimes even mc2 appears on the scene, but in the mc2 AS is always undefined.

    Can someone point me in the right direction for the loading of multiple copies of the same image? It really shouldn't be so hard, does it?

    Well I found a solution. It turns out that Flash does not reproduce the content dynamically loaded as an image into a movieclip. But there is a small class called BitmapData that will do exactly what I was looking for. Here is the link that I got this info from: http://www.senocular.com/flash/source.php?id=0.174

  • Need help incorporating a little a Hyper link in report based on dynamic SQL

    I try to have a column in my report to link to a document on my network, when you click on the column in the report. I have a table that contains a row for each document that I want to link to. The URL of the document is stored in a column named NDDL. DOC_LINK. I would like the text "Linked" to appear as a value in the column of the report and to be a hyper link to the document.

    The report is a 'classic' function PLSQL retune an unfavourable SQL. I'm on Apex version 4.2.1.00.08

    I am struggling with the "' stuff and may not work. stuck to the line in question, but I can't see it properly, so I hope someone can help out.
    ...
      q := q || '  NDDL.DOC_TITLE as FILE_NAME, '; 
      q := q || '  NDDL.DOC_DESC, ';
      q := q || '  ''<a href="http:'' || NDDL.DOC_LINK || ''target="_blank"> </a>'' as LINKED , ';
      q := q || '  NDDL.MOD_DATE, ';  
    ...
    The # in the above line must be:
    {code}
    http: "| NDDL. DOC_LINK | target ="
    Thanks!
    
    Edited by: Sky13 on Mar 7, 2013 12:45 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            

    You've got several problems if I remember right. First of all, your PL/SQL is not work properly. Then, he has not shown what you expected to see. At the last, he did not open the location that you should open. I have solved at least two of these three issues. Now, I see that you have a third number and try to use this report to provide direct access to some resources within your network. Something like:

    \\kgi002.kgisystems.com\development\dba\dba_support\DBA_Support_Schedule.xls

    In fact, you can't do it this way and wrap this path within the < a href = "" tags to make it work. " You probably expect the click on this link to open the referenced document. :) It is a security problem and this problem has been discussed several times in this forum - search on three words "open the path to the document" would lead you to many answers:

    Re: open Windows Explorer with the path of IR? (would it might work)
    Open the interactive report document

    Denes Kubicek
    -------------------------------------------------------------------
    http://deneskubicek.blogspot.com/
    http://www.Apress.com/9781430235125
    http://Apex.Oracle.com/pls/Apex/f?p=31517:1
    http://www.Amazon.de/Oracle-Apex-XE-Praxis/DP/3826655494
    -------------------------------------------------------------------

  • Why Windows asks me to install the same updates several times. Often several times the same updates and often several times in the same day?

    I install security updates and important. Sometimes in the same day, I wonder to install the same updates. When I check the history I see that they are already installed. This can happen several times in the same day.

    Troubleshooting Windows Update or Microsoft Update when you are repeatedly offered an update

    UTC/GMT is 00:34 Sunday, March 11, 2012

  • Why does my automatic update install same update several times?

    In Windows Vista, my automatic updates are set for 03:00 every day.  It updates on its own.  Update icon tells me new updates are available.  After you have downloaded and installed, I check the download history to find same status update (KBxxxxxxx) # "successful" several times.  I don't think it will hurt.  But, can it be fixed?

    (1) updates (for example the download/install MRT and updates of Windows Defender) appear to download and install a certain number of times.

    (2) this is the wrong forum for questions of WU - please ask with precision the EXACT KB numbers involved in the Windows forum http://answers.microsoft.com/en-us/windows/forum/windows_update updates

Maybe you are looking for