Building Query in Pre-Query. How to make it more Memory Efficient

Hello all,
I have a form with 2 Data Blocks.
First Block is used for giving query Parameters and second one returns the results based on a View.
I build the Select Clause in the pre-query based on the Parameters. So every time I have a Different Query.
Could that create problem in the Database Server due to parsing queries again and again?
Would using a Different approach (i.e. ref Cursors) be more memory Efficient?
Thanks

The pre-query is quite Large so I am pasting only a part of the Code (the rest of it Is Identical).
In the selects v is the alias of the View of the Second Data Block.
The :qf_ bind variables are fields of the First block where I give the Parameters.
               IF :QF_IS_DISPLAYED=1 THEN
               L_WHERE := L_WHERE || ' AND V.IS_DISPLAYED =''1''';
               END IF;
               IF :qf_colour IS NOT NULL THEN
               L_WHERE := L_WHERE || ' AND item_colour=''' ||:qf_colour ||'''';
               END IF;
     IF :qf_product_item_colour IS NOT NULL THEN
               L_WHERE := L_WHERE || ' AND product_item_colour=''' ||:qf_product_item_colour ||'''';
     END IF;
     IF :qf_product_length IS NOT NULL THEN
               L_WHERE := L_WHERE || ' AND product_length=''' ||:qf_product_length ||'''';
     END IF;
               IF :qf_apf_batch_id IS NOT NULL THEN
               L_WHERE := L_WHERE || ' AND apf_batch_id=' ||:qf_apf_batch_id;
               END IF;
                    if :qf_prod_resource is not null then
                    L_WHERE := L_WHERE ||' AND v.resources = ''' ||:qf_prod_resource ||'''';
                    end if;
                    if :qf_customer_number is not null then
                    L_WHERE := L_WHERE || ' AND FACTORY_ORDER_ID IN (SELECT FA.FACTORY_ORDER_ID
                                                                                                                                                 FROM OE_ORDER_HEADERS_ALL OH,
                                                                                                                                                                RA_CUSTOMERS RA,
                                                                                                                                                                XXSC_DEMAND_LINES DL,
                                                                                                                                                                XXSC_FACTORY_ORDERS FA
                                                                                                                                                 WHERE      OH.SOLD_TO_ORG_ID = RA.CUSTOMER_ID
                                                                                                                                                 AND      DL.SOURCE_HEADER_ID = OH.HEADER_ID
                                                                                                                                                 AND          DL.FACTORY_ORDER_ID = FA.FACTORY_ORDER_ID
                                                                                                                                                 AND               RA.CUSTOMER_NUMBER = ''' ||:qf_customer_number ||''')';
                    end if;

Similar Messages

  • How to make it more efficient

    Hi,
    I am working on AQ where I am just sending and receiving simple messages. But the performance is very poor. It takes around 35 seconds to send (enqueue) just 100 messages which is not acceptable for our project. Can someone help me how to make it more efficient. I am using JMS for sending and receiving messages.
    Thanks,
    Sateesh

    Bhagath,
    Thanks for your help.
    Oracle server we are using is 8.1.7. We are using JDBC client that ships with Oracle client (classes12.zip).
    Right now we are working on point to point messages.
    I am just wondering whether I need to do any tuning on server.
    Your help is greately appreciated.
    Here I am pasting sample code that I wrote which may help in finding the problem.
    Thank you so much once again for your help.
    -Sateesh
    import java.sql.*;
    import javax.jms.*;
    import java.io.*;
    import java.util.Properties;
    import oracle.AQ.*;
    import oracle.jms.*;
    public class CDRQueueSender {
    private final String DB_CONNECTION = "jdbc:oracle:thin:@dev1:1521:dev";
    protected final String DB_AQ_ADMIN_NAME = "dev78";
    private final String DB_AQ_ADMIN_PASSWORD = "dev78";
    /** DB AQ user agent name and password */
    private final String DB_AQ_USER_NAME = "dev78";
    private final String DB_AQ_USER_PASSWORD = "dev78";
    private QueueConnectionFactory queueConnectionFactory = null;
    private QueueConnection connection = null;
    private QueueSession session = null;
    private Queue sendQueue;
    private QueueSender qSender;
    public CDRQueueSender() {
    try {
    Properties info = new Properties();
    info.put(DB_AQ_USER_NAME, DB_AQ_USER_PASSWORD);
    queueConnectionFactory = AQjmsFactory
    .getQueueConnectionFactory(DB_CONNECTION, info);
    connection = queueConnectionFactory.
    createQueueConnection(DB_AQ_USER_NAME,
    DB_AQ_USER_PASSWORD);
    session = connection.createQueueSession(
    true, Session.AUTO_ACKNOWLEDGE);
    connection.start();
    sendQueue = ((AQjmsSession) session).getQueue (DB_AQ_ADMIN_NAME,"CDR_QUEUE");
    qSender = session.createSender(sendQueue);
    catch (Exception ex) {
    ex.printStackTrace();
    public boolean sendCDRMessage(CDRMessage messageData)
    throws JMSException, SQLException {
    ObjectMessage objectMessage = session.createObjectMessage(messageData);
    try {
    qSender.send(objectMessage);
    session.commit();
    catch (Exception e) {
    System.out.println(e.getMessage());
    e.printStackTrace();
    return true;
    public void close() throws JMSException {
    session.close();
    connection.close();
    public static void main(String[] args) throws SQLException, JMSException {
    int count = 0;
    CDRQueueSender qSender = new CDRQueueSender();
    long startTime = System.currentTimeMillis();
    long endTime;
    CDRMessage message;
    while(count < 100) {
    message = new CDRMessage("filename", 20, "This is testing", count);
    qSender.sendCDRMessage(message);
    count++;
    //qSender.sessionCommit();
    endTime = System.currentTimeMillis();
    System.out.println("time taken to process 100 records is " +
    ((endTime - startTime)/1000) + " seconds");
    qSender.close();

  • How do i install more memory in my macbook air? it only has 4GB

    How can i install more memory in my macbook air? it has 4GB only and it keeps telling me my start up disk is full.

    Welcome to the Apple Support Communities
    In the case of the MacBook Pro with Retina display and the MacBook Air, memory is soldered into the logic board, so you can't add more memory after buying the MacBook.
    However, memory isn't your problem. One thing is the memory and another thing is the hard drive, and you are running out of space in the hard drive, not in memory.
    To fix this, just delete files that you don't need, or move them to an external drive, in order to make free space on your MacBook

  • How do i allocate more memory to my iphoto application? i am unable to add more photos to my library  i keep getting a pop up saying not enough memory in my application

    how do i allocate more memory from my hd to my iphoto application? i have over 80 gb on my hard drive, but only 1.7 gb allocated to my iphoto application & i am unable to add more photos to my library.  i keep getting a popup that says not enough application memory.

    There is excessive swapping of data between physical memory (that is, the memory chips on the logic board) and virtual memory (one or more files on the startup volume.) That activity is relatively slow and causes the whole system to be less responsive. It can happen for two reasons:
    A long-running process with a memory leak (a kind of bug)
    Not enough memory for your usage pattern
    Tracking down a memory leak can be difficult, and it may come down to a process of elimination.
    These instructions are for OS X 10.9 ("Mavericks.") The procedure may be slightly different for earlier versions of OS X.
    When you notice the swap activity, open the Activity Monitor application and select All Processes from the View menu, if it's not already selected. Select the Memory tab. Click the heading of the Real Mem column in the process table twice to sort the table with the highest value at the top. If you don't see that column, select
    View ▹ Columns ▹ Real Memory
    from the menu bar.
    If one process (excluding "kernel_task") is using much more memory than all the others, that could be an indication of a leak. A better indication would be a process that continually grabs more and more real memory over time without ever releasing it. Here is an example of how it's done.
    The processes named "Safari Web Content" render web pages for Safari. They use a lot of memory and may leak if certain Safari extensions or third-party web plugins are installed. Consider them prime suspects.
    Another process often implicated in memory leaks is "inkjet4" or "inkjet8," which is a component of the HP printing software. If it's present, force-quit the process in Activity Monitor to solve the problem temporarily. Empty the print queues in the Printers & Scanners preference pane (which has a slightly different name in each recent version of OS X.) If you don't use an HP printer, remove the software. Otherwise, if the problem is recurrent, update the software (which may not help) or contact HP support.
    "Wired" memory should be a small part of the total. That memory is not swapped, but it makes less physical memory available which may then result in swapping. If you have a lot of wired memory, that's usually an indication of a memory leak in a third-party program that modifies the operating system at a low level. Ask for guidance in that case.
    If you don't have an obvious memory leak, your options are to install more memory (if possible) or to run fewer programs simultaneously.
    The next suggestion is only for users familiar with the shell. For a more precise, but potentially misleading, test, run the following command: 
    sudo leaks -nocontext -nostacks process | grep total
    where process is the name of a process you suspect of leaking memory. Almost every process will leak some memory; the question is how much, and especially how much the leak increases with time. I can’t be more specific. See the  leaks(1) man page and the Apple developer documentation for details.

  • How do i get more memory on my mac book air? is says that i can add 2 more gig how?

    how do i get more memory on my mac book air? is says that i can add 2 more gig ??? or wat files can i delete

    Macbook Air memory is soldered to the logicboard.
    You can only get 4GB or 8GB (2012 Models) in the Air when you order it that way.  Otherwise, you're stuck with 2GB.
    Unless you're talking about hard drive space - then it is upgradeable - click HERE to see which one corresponds to your model.

  • How do i get more memory installed on my macbook air

    How do i get more memory installed on my macbook air

    If you are referring to RAM, the Air's RAM is not an upgradeable component. The RAM memory is soldered to the main board, and there are no expansion slots.
    It is the price Air owners pay for miniaturization. Every Air is manufactured with all the memory it will ever have. Shop wisely.
    It is technically possible to upgrade the SSD storage though, but will probably void any warranty.

  • How do I get more memory on my IMAC .I have 1 GIG and to run LION you need 2 GIGS?

    How do I get more memory on my IMAC .I have 1 GIG and to run LION you need 2 GIGS?

    Depends on the Mac; what model and processor is it?
     > 'about this Mac' > 'more info'
    In the first section (hardware overview) post this info;
    Nothing below that is reqd, especially not the serial number.

  • How do I allocate more memory to my 1st Gen and 4th Gen to stop Safari crashes?

    How do I allocate more memory to Safari to stop opening crashes?

    Have you tried any troubleshooting?
      Restart: Press On/Off button until the Slide to Power Off slider appears, select Slide to Power Off and, after It shuts down, press the On/Off button until the Apple logo appears.
      Reset: Press the Home and On/Off buttons at the same time and hold them until the Apple logo appears (about 10-15 seconds).
      Restore: Connect your iPhone to iTunes on your computer, backup, and then select Restore to Factory

  • How can I add more memory to my iPad?

    How can I add more memory to my iPad?

    Memory refers to RAM, and can't be increased.
    I asume you mean storege space (like 16GB, 32GB, etc). It also can't be increased.
    There are some wireless external hard drives that can be used with the iPad.
    The Kingston Wi-Drive, which costs $50 for the 16 Gigabyte, and then $30 more for every 16 gigs more. It works by you turning it on and then accessing the files on it from an app that you download on your iDevice. You can access music, movies, and other stuff. No connections or anything, it works like a WiFi connection, you connect to it from the setting on the iPad under wireless networks.
    Then there is the Seagate GoFlex, which some would recommend over the Wi-Drive. But this one costs $199 and had 500 Gigabytes of storage. It works the sameway as the Kingston: no wires, runs over its wireless connection. You can actually fit up to 300 HD movies on it.
    Another option:
    Expand your iPad's storage capacity with HyperDrive
    http://www.macworld.com/article/1153935/hyperdrive.html
    On the road with a camera, an iPad, and a Hyperdrive
    http://www.macworld.com/article/1160231/ipadhyperdrive.html
     Cheers, Tom

  • How can I add more memory to my iPod touch

    How can I add more memory to my iPod touch?

    You are not able to add memory to a iPod Touch.
    The only way to get more memory is to buy one with a larger capacity.

  • How do I add more Memory to the 2 open slots in my iMac - it is 4GB now

    How do I add more Memory to the 2 open slots in my iMac ???  It is 4GB now and I get the spinning beach ball often when several Apps are running.
    Does the Apple Store sell and install???
    Please advise if you have upgraded your iMac memory

    Go to a website such as OWC or Crucial's, determine which type of RAM your computer needs, and buy it from that site. They provide installation instructions on the site.
    (115474)

  • How do I get more memory for my Macbook Pro Spring 2010 13-inch with 2.66GHz Intel Core 2 Duo?

    How do I get more memory for my Macbook Pro spring 2010 13-inch with 2.66GHz Intel Core 2 Duo. Apple says no memory currently available for that model. I have 4 GB memory and 3.99 used. Help!

    macette1976 wrote:
    Now I'm confused. This is the one Crucial told me to get:
    CT3309356 - 4GB DDR3 PC3-8500 Unbuffered NON-ECC 1.35V 512Meg x 64
    $45.99
    Also what do you mean that actual memory is 16GB but with Apple it's 8?
    When I go to the "About this Mac" it says Memory 4G 1067 MHz DDR3, then when I go to System Report it says
     Memory Slot
    Bank 0/ DIMM0 2G DDR3 1067 MHZ OK
    Bank 1/ DIMM0 2G DDR3 1067 MHZ OK
    Sorry I'm clueless. Just don't want to buy something that messes up my machine more than it already is.
    The Crucial site appears to have recommended the correct spec 4gB RAM stick for your model. Please note that you will need to remove the existing sticks of RAM to install new, so you will need 2x4gB to get to 8gB.
    When your model of computer was designed/built, it was tested with readily available 2x4gB (8gB). After release RAM retailers have tested it with higher amounts, and Apple didn't update their quoted specs.

  • How do I add more memory to my Imac, I only have 1GB of memory and need 2GB to download Yosemite!

    How do I add more memory to my Imac, I only have 1GB of memory and need 2GB to download Yosemite?

    Janet,
    This is why the question rkaufmann87 asked about your model is so important:
    [click chart to enlarge if needed]
    The list covers the early iMacs with Intel processors that shipped with either OS 10.4 or 10.5 and have only two RAM slots. As you can see, some have limits to what version of OSX you can install. If the step rkaufmann requests does not narrow down your model, you can do one more thing.
    While the "About this Mac" window is open, click the "More Info..." button at the bottom of that window to get this (assuming you are really running OS 10.5.8 as shown in your profile):
    The code I've indicated with the red arrow corresponds to the codes in the second column on the chart. Post the code your computer reports--again don't post a serial number.
    If your iMac shipped with only 1GB RAM, I fear it is one of the earliest models that cannot be upgraded all the way to Yosemite.

  • We have a 32GB IPad 4.  how do we add more memory?

    We have an Ipad 4 with 32gb.  When downloading it tells us our memory is full.  How can we add more memory?

    I think some needed clarification is in order.
    With iDevices, the storage amount ( 16, 32, 64, 128 GBs) is a fixed amount.
    The only way to obtain more storage on an iDevice is to sell your current iDevice and purchase a larger storage version.
    If you want to store your iPad data (like music, movies and photos) offline and off your iDevice, you can move the data onto wireless WiFi hard drives from Seagate, Western Digital and LaCie. The data can be access by the iDevice over WiFi as these wireless hard drives generate their own WiFi signal and the data from these style drives can stream the data from the drive to the iPad.

  • How much difference will more memory make with Logic?

    I'm running Logic 6 on an iBook G4 with 1.33 ghz and 768 meg of ram. I can max out at 1.5 gig of ram. What difference will this make? I'm also going to upgrade to Logic 7 soon. I'm going to wait a while before I get an INTEL Mac since most of my plugs have no updates available yet (Sampletank, Amplitube, and T-Racks mastering). I figure in a year, INTELS will be much more common.Please share thoughts. I run all the audio files from a 7200 Mercury Firewire drive. I figure before my iBook is outdated beyond use I can upgrade memory and eventually have a newer/faster HD installed (There's a few places that will install new HD, transfer data and have everything back to you in 24 hours).

    Adding memory will only make a truly big difference if you're currently low enough that the system resorts to using virtual memory paging. Load up a typical song in Logic, then start Activity Monitor. On the System Memory display, observe the number for 'page outs'. If it rarely or never increases while you're running Logic, adding memory won't make a huge difference. If 'page outs' is constantly growing, more memory will be dramatically improve the overall behavior of the system.
    Ignore 'page ins', it's not relevant.
    Note: those places that do 24 hour turnaround (via express shipping) for a drive replacement charge quite a premium for the service. I'd say you're better off doing as little as possible to the current system, and saving the money for the next one. Just my opinion, of course.
    Quad G5 2.5Ghz 4.5GB 2x250G, PB 15" 1.5Ghz,80G,1.5G   Mac OS X (10.4.4)  

Maybe you are looking for

  • Apple Mail and the "sent messages" verus "sent" folder

    I have a Mac Pro and a MacBook Pro, both running Snow Leopard with all the latest patches. In mail, in what appears to be the same mail configuration and the same account, I have sent messages being stored in a "sent messages" folder on the IMAP serv

  • Memory card password request after software upgrad...

    Nokia 6700 Requesting Memory card password? I have a Nokia 6700 Classic, the bluetooth stopped working so I called Orange who checked I was following the instructions clearly and then suggested I download the latest software version 13.20  via the co

  • Insufficient data for an Image in smartform as a PDF

    Hi Guys, I am sending a smartform by email as a PDF attachment. Everything is working fine, but the logo is not getting displayed. Whenever I am opening the PDF I am getting the pop up as "Insufficient data for an image". Thanks, Nikhil

  • SQL Query will not work in CRXI

    I am using CRXI Developer R2 against an Oracle 9i DB. The following query works in Oracle SQL Developer, but returns no results in Crystal (no errors in Crystal either). Anyone know what is wrong? SELECT b1.b1_alt_id,        b1.b1_per_type,        is

  • Time dependent business partner master data !!!

    Hi All, In BI side i am loading master data for '0BPARTNER'.... lets assume there is one business partner 'DEVT01'...this business partner is assigned to a developer named 'Ankit'...after 3 months ankit finishes his developmet work....another develop