Best method for writing functions

Hello
These are two functions. They are almost the same, except the "select into".
Y at - it a good way to combine the two functions and how best to reduce the code pl/sql unnessary?
FUNCTION get_row_total_text
RETURN VARCHAR2
IS
   my_row_count_total_text  VARCHAR2(10000);
BEGIN

  my_row_count_total_text := '';

  -- generate the 'total' column function call
  SELECT 'edr_rpt_lane_by_class_package.gen_total_lane_count('
                       ||'lane_id, '
                       ||'direction_id, '
                       ||'interval_start_date_time, '
                       ||'interval_end_date_time, '
                       ||'range_low, '
                       ||'range_high, '              
                       || MIN(site_lane_id) || ', '
                       || MAX(site_lane_id) || ') "COUNT"'
  INTO my_row_count_total_text
  FROM edr_rpt_tmp_report_lanes    ;
  
  

  RETURN ', ' || my_row_count_total_text;

END;

FUNCTION get_row_total_pct
RETURN VARCHAR2
IS
   my_row_count_total_text  VARCHAR2(10000);
BEGIN

  my_row_count_total_text := '';

  -- generate the 'total' column function call
  SELECT 'edr_rpt_lane_by_class_package.gen_total_lane_count_pct('
                       ||'lane_id, '
                       ||'direction_id, '
                       ||'interval_start_date_time, '
                       ||'interval_end_date_time, '
                       ||'range_low, '
                       ||'range_high, '              
                       || MIN(site_lane_id) || ', '
                       || MAX(site_lane_id) || ') "%"'
  INTO my_row_count_total_text
  FROM edr_rpt_tmp_report_lanes    ;
 
 
  RETURN ', ' || my_row_count_total_text;

END;
Published by: Muriel Ram on December 7, 2009 12:34

Published by: Muriel Ram on December 7, 2009 12:36

Try the following (not tested):

FUNCTION get_row_total_text
RETURN VARCHAR2
IS
my_row_count_total_text VARCHAR2 (10000);
my_row_count_total_text_1 VARCHAR2 (10000);
my_row_count_total_text_2 VARCHAR2 (10000);

BEGIN

my_row_count_total_text: = ";

-generate call function of the column 'total '.
SELECT ' edr_rpt_lane_by_class_package.gen_total_lane_count_pct (')
: ' lane_id, '
|' direction_id, '
: ' interval_start_date_time, '
: ' interval_end_date_time, '
|' range_low, '
|' range_high, '
|| MIN (site_lane_id) | ', '
|| Max (site_lane_id)
IN my_row_count_total_text
Of edr_rpt_tmp_report_lanes;

my_row_count_total_text_1: = my_row_count_total_text | ') 'COUNT' ';
my_row_count_total_text_2: = my_row_count_total_text | ') "%"';

RETURN «,» | my_row_count_total_text_1 | ',' | my_row_count_total_text_2;

END;

You can still find to find answers for questions of Justin...

Tags: Database

Similar Questions

  • Which is the best way for a function called identify the class name of the appellant.

    Which is the best way for a function called identify the class name of the appellant.

    (1) sun.reflect.Reflection using the function call
                    Class caller = Reflection.getCallerClass(2);
                    System.out.println("Caller Class Name ::"+caller.getName());
    Trace of function called battery 2) analysis of current threads
                    StackTraceElement[] stElements=Thread.currentThread().getStackTrace();
                    System.out.println("Caller Class Name ::"+stElements[3].getClassName());
    Y at - it all the other ways to achieve the same. What is the best way?
    Called function does accept no argument, I don't want the arguments of function calling function called t.

    Help, please.

    With greetings
    Paul

    798185 wrote:
    Which is the best way for a function called identify the class name of the appellant.

    Y at - it all the other ways to achieve the same.

    SecurityManager

        // 0 is the anonymous SecurityManager class
        // 1 is this class (also works in static context)
        // 2 is calling class
        static Class getClass(int i) {
            return new SecurityManager() {
                protected Class[] getClassContext() {
                    return super.getClassContext();
                }
            }.getClassContext();} 
    
  • Best method for updating CompactRIO data to Server "National Instruments.Variable Engine.1"

    Hi all, I have an OPC Client of third-party I want to use for testing with the CompactRIO. Can I specify 'National Instruments.Variable Engine.1' in the OPC server, create a new item of the mutual FUND, go to a variable and then see its value. I use a CompactRIO and I want to send the updated data that I am acquisitionning of for third-party Client OPC, then, what is the best method? Currently, what works, is that I created a shared variable published to network on the LabVIEW host that I dragged in the CompactRIO project. I've created a small loop increment value every 500ms. I then created on the host computer, a little VI, who issued this national value to "" Instruments.Variable Engine.1". Now, is there a better way to do his? Is it something that can automatically fill in manually the Variable of the CompactRIO motor without publishing the shared inside a LabVIEW application variables? Thank you for your time, best regards!

    Thanks a lot for your replies, Drew,.

    I downloaded the OPC UA API and it will next week.

    Thanks again!

  • Best method for mouse over image

    I want to just make sure I go about it the right way.  I have a line of images when you hover over the image will be display.  I was going to create a div for each image that contains the original image.  Then I was going to create a behavior of hover for each div that would then change the image.

    Who is the best method, or is there another way?

    CSS, if they contain links:

    http://ALT-Web.com/demos/CSS-sprites.shtml

    http://www.tutorio.com/Tutorial/pure-CSS-image-rollovers

    Nancy O.
    ALT-Web Design & Publishing
    Web | Graphics | Print | Media specialists
    www.Alt-Web.com/
    www.Twitter.com/ALTWEB
    www.Alt-Web.blogspot.com

  • Best method for different endian migration

    Hello

    We intend to migrate our EBS R12.1 using 11.2.0.4 database of Solaris Sparc-64 for Linux x 86-64.

    What is the best choice out of the following methods:

    1. transportable Tablespace - using DBMS_FILE_TRANSFER

    2. transportable Tablespace - the use of CONVERT RMAN

    There are other methods available for the object apart from the two?

    Thank you.

    See also MOS Doc 1377213.1

  • Best method for zoom - through a Polaroid to a life-size picture?

    Hey guys!

    I've been playing with a few different methods - masks, caches, etc, but I'm looking for quick recommendation about which method is best for this.

    For convenience, here is a picture of reference:

    http://i.gyazo.com/1efa41b89311a22bfa4d2e93550fd5cf.PNG

    I'm looking for "shell" of the polaroid (the white part, all except the picture in the middle) grow until it is outside of the screen, making the image behind it become full screen.

    Tips, suggestions, ideas, recommendations or the tutorials are all appreciated!

    Thanks in advance,

    Matt

    First, the image of the Polaroid picture must be quite large so that the horizontal dimension of the photo part is at least as wide as your comp if it means 1920 for image or approximately 2200 for boarder image and white. Second, because the image is almost perfectly square you have upper and lower crops. Scale or push with a camera or move the image to the camera. There's not much to it. You could use a matte or a mask on the image and animate the opacity of the mask.

  • Best method for SRM

    With 5 guests and replication of VM 75 which method is preferred for best practices

    (1) deploy vCenter SRM

    (2) deploy SRM in dedicated VM (uses vCenter, database)

    (3) deploying MIS in dedicated VM (separate database)

    Hello

    Second option is the best option that is deployed in dedicated SRM VM (uses vCenter Database) because

    The MRS Server works as an extension to the vCenter Server on a site server. Because the MRS server depends on vcenter Server for some services, you must install and configure vCenter Server on a site before you install SRM.

    SRM benefits of vCenter services, such as storage management, authentication, authorization, and personalization of comments. MRS also uses the standard set of vSphere administrative tools to manage these services.

  • Best method to include functions?

    I have a small group of cffunctions to include on almost every page in an application, I was wondering:

    What is the best/least expensive way to include them in my models?

    in the application.cfc onrequest promising start.  [it actually works, I was wondering if there is a better method.

    -sean

    Group cffunctions to include in almost every page in an application

    This already suggests what might be the most effective solution. As the functions appear to be global to the application, put them is a component and create an instance of the component in the scope in the OnApplicationStart(). The following example assumes that the TestComponent.cfc file exists in the myCFC under the web root directory.

    Assuming that Application.cfc is in the wwwroot root web, insert the following code in OnApplicationStart() of Application.cfc:

    Save the following code as TestComponent.cfc in the wwwroot/myCFC directory.


       
           
           
       

    Create the test page, testAppObject.cfm, anywhere in the application. Insert the following code in it:


    #testCallResult #.

  • BlackBerry smartphones abandon the Roxio software? Is mass storage the best method for transferring multimedia files

    Should I give up on Roxio software and rely solely on the method of mass storage to transfer media files?

    I reinstalled several times the software, but whenever I try to use the Roxio Media Manager on my PC max CPU usage of on 100% and dies. Once, he worked - and as posted here by someone else, it seem very good - but each others times it just hangs.

    After reading now widely through this site and several others, it seems there are serious issues with Roxio. So my question for those of you with BB9000 more time under your belt: do I persevere with Roxio or give up and just rely on mass storage? It looks not pretty, but I moved ringtones, video and photographs around smoothly.

    Am I losing on the compression features in Roxio which I don't get mass storage? If this isn't the case, then my inclination is going to be drop Roxio and stick with mass memory until they fix the bugs or I see on this site a better way.

    Thanks to bifocals. I used the MediaSync before and Yes you are right, this works very well for the music. I was hoping to use the Roxio to transfer (and compression) files of images, photos digital high resolution of small files just for occasional display on the BlackBerry. Œuvres drag / move, but I cannot copy a lot of pictures. Not sure if it is a compression problem or if I just need a bigger memory card? I'll keep experimenting. I hope BB/Roxio will receive enough complaints sort...

    Thanks for the reply. Happy ' 09.

  • best method for the implementation of the equallogic line

    Hello

    We recently purchased an equallogic ps4000 who will be used mainly for purposes of DR in a branch.

    The idea is to have a copy of all critical servers on this group of Branch Office.

    My plan was to create a replica of the 'seed' of all servers when the two paintings are at Headquarters (i.e. on the same network). When I then take the painting at the branch there is much less data to be replicated across the WAN. for example

    • Give the 'branch' equallogic iSCSI headquarters subnet address
    • The replication setup (for example, the replica of the seed)
    • Change the IP address of the 'branch' equallogic/group
    • Unplug and take the painting at the branch
    • Resume replication over the Wan

    I was wondering;

    (a) if it is a good plan

    (b) is the best way to do it?

    Thanks for any advice on this.

    Huw

    Yes, it's a way you can do the initial transfer to the DR group.

    You can also read about the Manual Transfer Utility (MTU), the download is on the same page as the Firmware Version you have installed on your berries (on FW download page, find the section titled "EqualLogic Compatibiltiy tools).

    In a nut shell, after installation of the MTU, then using the same system, the connection to the Admin group and in the Tools Menu interface (bottom left), select "Manual transfer utility" as follows:

    -joe

  • Best method for photo ID for the portfolio & how to retrieve images of portfolio as a group?

    Hello!

    I'm embarrassed to say that after all these years I manually choose my portfolio of images in Lightroom and know that there is a much easier way.  What is the best way to mark the portfolio images and then retrieve them as a group?  I can't use the star ratings that I use these for internal sorting on employment.

    Keywords would be the best way to go, i.e. Enter 'portfolio' or 'the portrait portfolio' for selected images?

    How would you then access the entire catalog and search on these terms?

    Thank you so much everyone and the best, Teri

    You can use keywords, color labels, choose the flags, or any searchable metadata field. There is no 'best '. They all work.

    Click on all the pictures and then the filter or smart collections bar will allow you to do research and create the portfolio.

  • Best method for resizing bitmap images

    I'm looking for a good method resize bitmap images to adapt to the constraints imposed by a container object with the size will change based on the dimensions of the browser window, etc. Basically, it must be able to evolve to adapt.

    I use the following to the resizing of height. «largeImage is a bitmap object.

    ratio = largeImage.height/newheight;
    largeImage.height = newheight;
    largeImage.width = largeImage.width/ratio;

    The problem is, the images look resulting slightly serrated and not really the quality I was hoping.

    Is there a better way to do this in as3?

    Add the following seems to greatly improve the quality:

    largeImage.smoothing = true;

  • What is the best method for a video output to a monitor on the new iMac?

    I noticed that the new iMacs don't have an HDMI port. How can I get a video signal to a monitor in the sequel of my editing?

    Thank you.

    Tom

    in the accessories kit was without adapter?

    Search on amazon for mini hdmi port, from display connector<10€>

  • Best method for multi-developer Server Variables / multi-server environment?

    In addition to having a development environment on my laptop and my desktop computer, we have a staging server and a production server. In addition, we have one or more developers and contributors who may have one or more development that is clean environments.

    Each of these environments may have their own copy of ColdFusion (developer, standard, enterprise - everything is required) and their own copy of SQL Server Express / whatever, their own data source name, the name of user of data, password data, names of CF mappings and so on.  So, while SQL tables and the structure of the code directories is all the same, there are many different things from one to the other.

    Certainly, we need to have a large number of variables so that when someone downloads via SVN commit they don't live, everybody to the top, because they push their own local names in place.

    How do you manage that?  XML file?  CFC? some form of. INI file?   Looking for a solid way to handle this for a multitude of environments and developers, I welcome so see YOUR solution.

    Thank you!

    RLS

    It was the path to enlightenment for us. Hope this helps you.

    http://code.Google.com/p/configcfc/

  • Best method for reports/verify backups successful?

    As far as I know, there are 2 ways to verify backups:

    -Setup error alerts by e-mail and sift through them. Search trends, guess what is still a problem.

    -Open a session in every console and check the recent pictures and recent replicas

    The problem with e-mail alerts is that I'm quite confident when I'm not checking the consoles. I'm supposed to stay calm and assured that the backups work when I get no emails? Fake! That looks like that I'll eventually miss something.

    The problem with the connection to each console is extremely repetitive. I spend 2 hours every day of my working life by clicking on through them. It seems that it is the only way to detect a problem, but also to check instant success.

    How to manage effectively this product? What are others doing? Version is 5.4.2.  I can understand these checks may be easier when you keep only 4 or 5 cases, but what happens when you have 50 +? Here, any advice would be appreciated. I won't stop watching consoles if it means sifting through of the hundreds of e-mails that are generated on a daily basis.

    If you want to send me these questions during the webinar I. We can also set up a separate session according to the participants in the webinar 21.  The webinar itself is supposed to have a general discussion on backup/DR and what questions we all face which could cause questions for customers, MSP and partners.

Maybe you are looking for