How to use variable bin in the package without asking a user?

Hello

I would write a SQL but I want to use bind variable as static package, without asking the user? As below?

I would ask you, below it is a variable emp_id? Is this variable BINDING?

DECLARE
bonus NUMBER (8.2);
emp_id NUMBER (6): = 100;
BEGIN
SELECT salary * 0.10 IN employees OF bonus
WHERE employee_id = emp_id;
END;
/

If this isn't the case, as this SQL, how can define a CONNECTION variable as static inside a code? don't ask a user?
version of DB. 9.2.0.8

best regards and thank you

OracleADay wrote:

I would write a SQL but I want to use bind variable as static package, without asking the user? As below?

Yes, as you did in this code example.

All SQL statements must be analyzed as sliders to be filled. PL/SQL source code can contain code PL/SQL (programming language) and the source SQL.

So, indeed you are coding 2 languages of different source code in the same source program. The PL/SQL compiler is a pretty smart to understand what is PL/SQL code and what is the SQL code. To obtain the SQL source code, he creates transparently calls to the SQL engine - this call to the SQL engine will contain instructions on how to analyze the SQL and bind constants or variables in PL/SQL to SQL.

The SQL engine saves the sliders in the Shared Pool (the memory of the SGA structure) of Oracle. And you can easily watch the content of the present to see what SQLs cursors here - and what bind variables, if any, they use.

I posted an example - creating a procedure containing a SQL, execution of the PL/SQL code and then watching the cursor that has been created in the shared Pool. See {message identifier: = 2243507}. And it's a little easier to do that (more detailed) SQL tracing approach Pierre indicated above.

If this isn't the case, as this SQL, how can define a CONNECTION variable as static inside a code? don't ask a user?

A PL/SQL variable or a constant that you use in a SQL statement in the PL/SQL code, will be treated as a variable binding when parsing SQL and create the cursor so that it (or re - using an existing cursor).

Tags: Database

Similar Questions

  • How to use a function inside the package?

    Hello

    You will need to convert weight unit of kilogram kips when filling out the weight values into a temporary table. In our database, schema there is a function called convert_units is available.
    How could I use this feature in my package? My package is also resides in the same database schema.

    Here, I pasted the function.
         convert_units
       (
         in_base_unit_id       NUMBER,
         in_conversion_unit_id NUMBER,
         in_value              NUMBER
       ) RETURN NUMBER AS
    CURSOR unit_cur IS
      SELECT *
      FROM units_conversion
      WHERE base_unit_id = in_base_unit_id
        AND conversion_unit_id = in_conversion_unit_id;
    unit_rec unit_cur%ROWTYPE;
    BEGIN
      OPEN unit_cur;
      FETCH unit_cur INTO unit_rec;
      IF unit_cur%NOTFOUND THEN
        unit_rec := NULL;
      END IF;
      CLOSE unit_cur;
      RETURN (in_value+unit_rec.pre_adjust_add)*(unit_rec.rate);
    END convert_units;

    Hello

    It seems that the first two arguments of this function are ID in the units_conversion table. If you know this id = 1234 means kilograms, 9876 means kips, then you can do things like:

    wt_kips := convert_units (1234, 9876, wt_kilograms);
    

    or

    INSERT INTO tmp_table ( ..., weight_val,                               ...)
           VALUES           ( ..., convert_units (1234, 9876, wt_kilograms), ...);
    

    I can't just look at the code which could be any valid ID. I'm not even sure of the order of the arguments. I hope you have instructions on how to use the function.

    If the function is in a package named pk_xyz (a different package to the one in which you call it), add the name of the package, like this

    wt_kips := pk_xyz.convert_units (1234, 9876, wt_kilograms);
    
  • You can use variable substitution in the Calc script.

    Hi guys,.

    I want to use variable substitution in the calculation script. I v_SECSUBAREA that my substitution variable and its value would be like C12.00 or C13.00 or C12.00, C13.00.

    But it gives me error mentioned below by checking the syntax of the calculation script.

    Error: parsing formula [statement of DIFFICULTY] (line 15) 1200315 error: invalid object type

    Calculation script:

    -----------------------------

    FIX (& v_CLEARYEAR, & v_CLEARMON)

    FIX (& v_SECSUBAREA)

    DIFFICULTY ('REPGBP', 'REPEUR', 'REPUSD', 'local', @DESCENDANTS ("DIVISION"), @LIST(&v_SECDNBENTITY), @DESCENDANTS ("SubAnalysis"),

    @DESCENDANTS ("RTNROW"), @DESCENDANTS ("RTNCOL"))

    CLEARDATA "RESUB."

    ENDFIX;

    ENDFIX;

    ENDFIX;

    Variable substitution:

    ----------------------------------

    PRCCOR_ALLv_SECSUBAREAC12.00

    Calculation script does not have C12.00 as the value for the variable substitution. If I give FY15 then Script gives me a correct syntax.

    Please help me to get this resolved.

    Thank you

    Shruti

    Hello

    Assuming that you calculate in the PRC. Database COR_ALL.

    You may set the C12.00 value in quotes like "C12.00".

    Kind regards

    Philip Hulsebosch.

  • I got a license number for Adobe Master Collection from my school (Stevens Institute of Technology) and I can't understand how to use it to obtain the product. I created a user name and this is as far as I'm away.

    I got a license number for Adobe Master Collection from my school (Stevens Institute of Technology) and I can't understand how to use it to obtain the product. I created a user name and this is as far as I'm away. I need to download the product and I may not know where to start.

    Ask someone to your school... You have a Cloud redemption code, or a number of series CS6?

    If cloud, http://helpx.adobe.com/x-productkb/global/redemption-code-help.html Redemption Code and

    http://www.Adobe.com/products/creativecloud/FAQ.html

    http://helpx.adobe.com/creative-cloud/help/install-apps.html to install or uninstall

    http://forums.Adobe.com/community/download_install_setup/creative_cloud_faq

    What is http://helpx.adobe.com/creative-cloud/help/creative-cloud-desktop.html

    To start https://helpx.adobe.com/creative-cloud.html the Cloud

    If CS6, download to other downloads and enter your serial number when prompted

    Once again, your 1 resource is your school

  • How to use JavaScript to change the named view

    How to use JavaScript to change the named view

    Do you mean to jump to a specific Destination named within a PDF file? SE so there

    the method gotoNamedDest of the Document object.

  • How to use CSS to create the horizontal navigation bar in Dreamweaver CS6

    How to use CSS to create the horizontal navigation bar in Dreamweaver CS6

    One of the ways to do this is the following: Editor Tryit v1.9

    You can also use floats to get something in the same direction.

  • How to use JavaScript to limit the number of boxes to check the user can select a PDF form?

    How to use JavaScript to limit the number of boxes to check the user can select a PDF form?

    Here's the working solution

    Please rename all the boxes like chkBox0, chkBox1... .chkBox30 (must start with 0)

    Value of exports of each checkbox must be "Yes" (default value is Yes)

    Place this Code at the level of the Javascript Document

    -Code JavaScript document-

    var counter = 0;                Checked the meter

    -Count boxes checked again when the document is closed and reopened.

    for (var i = 0; i)<= 30;="">

    If (getField("chkBox"_+_i).value == 'Yes') {}

    Counter += 1;

    }

    }

    -The function of validation-

    function validateCheckBox(name,value) {}

    If (value == 'Yes' & meter)<>

    Counter += 1;

    } else if (value == 'Off') {}

    counter = 1;

    } else {}

    getField ("name") .value = "Off";

    App.Alert ("you can select only four checkboxes");

    }

    }

    -End of Document Javascript-

    Now put this line in the MouseUp event all checkboxes

    Box - Code MouseUp event.

    validateCheckBox (event.target.name, event.target.value);

    //----------------------------------------------------------------------------------

    Hope this will help

    Kind regards

    Post edited by: Mohammad Irfan

  • How to report a bug in the package XMP Toolkit?

    Hello

    How to report a bug in the package XMP Toolkit?

    Thomas

    Hi Thomas,

    Please let us know any bugs through this forum. We will file a bug in their own country. Unfortunately, there is currently no public bug for XMP tool.

    Thank you

    Jörg

  • Check the package/procedure for a user level privileges

    Hi gurus,
    How to check the package/procedure for a user-level privileges? as dba_tab_privs for the tables.

    for example: grant execute on User1 dbms_scheduler.
    now I must verify that user1 has run on dbms_scheduler privilege or not.

    What is the advice for this?

    Thanks in advance,
    Charles
    SQL> select privilege, count(*) from dba_tab_privs group by privilege order by 1;
    
    PRIVILEGE                       COUNT(*)
    ---------------------------------------- ----------
    ALTER                               19
    DEBUG                              256
    DELETE                              131
    DEQUEUE                            3
    EXECUTE                           19315
    FLASHBACK                          52
    INDEX                               14
    INSERT                              137
    MERGE VIEW                          36
    ON COMMIT REFRESH                     52
    QUERY REWRITE                          52
    
    PRIVILEGE                       COUNT(*)
    ---------------------------------------- ----------
    READ                                7
    REFERENCES                          54
    SELECT                                3752
    UNDER                                3
    UPDATE                              111
    WRITE                                5
    
    17 rows selected.
    

    DBA_TAB_PRIVS is more than simple tables.

  • Music: How can I transfer all of the music files to another user account

    How can I transfer all of the music files to another user account

    In simple terms, simply copy it to an external drive and then copy them back as the other user.  If files are protected by DRM (Digital Rights Management) as iTunes from Apple or Napster, you will need to know your service music, if the files can be copied.

    "rstoyka" wrote in the new message: * e-mail address is removed from the privacy... *

    How can I transfer all of the music files to another user account

  • Icon of Yahoo disabled of blackBerry Smartphones. How can I get rid of the icon without hide it?

    Very well done on my BB before I got my job and my Yahoo put email in place.  Later, I have disabled Yahoo mail and I remember he was difficult to understand how to do it and remove the icon.  I thought about it however.

    Now I have synced my new 8900 and the Yahoo icon is there yet.  He is not receiving or sending of email which is good, but how can I get rid of the icon without having to hide it?  I want that he gone forever!

    Thank you!

    You must remove this account from your carrier's BIS site yahoo email:

    http://www.BlackBerryFAQ.com/index.php/How_to_add_/_delete_email_addresses

    Good luck.

  • PC can see and access the laptop without asking for a user name and password but the laptop cannot access the PC because it asks me a username and password that I don't know.

    Vista - Windows 7 network connection. username and password is unknown.

    Hello

    I just got a laptop with windows 7 on it and I want to connect to my other PC for it, they are on the same network through a router. the PC can see and access the laptop without asking for a user name and password but the laptop cannot access the PC because it asks me a username and password that I don't know.

    If someone could answer this question, it would be great.

    Hello
    Maybe this can help.

    Win7 when configured on the peer-to-peer network has three types of configurations of sharing.

    Group residential network = only works between Win 7 computers. This type of configuration, it is very easy to entry level users to start sharing network.

    Working network = fundamentally similar to previous methods of sharing that allow you to control what, how and to whom the records would be shared with.

    Public share
    = network Public (as Internet Café) in order to reduce security risks.

    For the best newspaper of the results of each computer screen system and together all computers on a network of the same name, while each computer has its own unique name.

    http://www.ezlan.NET/Win7/net_name.jpg

    Make sure that the software firewall on each computer allows free local traffic. If you use 3rd party Firewall on, Vista/XP Firewall Native should be disabled, and the active firewall has adjusted to your network numbers IP on what is sometimes called the Zone of confidence (see part 3 firewall instructions

    General example, http://www.ezlan.net/faq.html#trusted
    Please note that some 3rd party software firewall continue to block the same aspects it traffic Local, they are turned Off (disabled). If possible, configure the firewall correctly or completely uninstall to allow a clean flow of local network traffic. If the 3rd party software is uninstalled, or disables, make sure Windows native firewall is active .

    ------------------------------

    If your network consists only of Win 7 and you want a simple network, use it.

    http://Windows.Microsoft.com/en-us/Windows7/help/videos/sharing-files-with-HomeGroup

    After you have configured the homegroup, scroll to the bottom for the Permission/security section.

    -----------------------------

    Win 7 networking with other version of Windows as a work network.

    In the center of the network, by clicking on the type of network opens the window to the right.

    Choose your network type. Note the check box at the bottom and check/uncheck depending on your needs.

    http://www.ezlan.NET/Win7/net_type.jpg

    Win 7 - http://windows.microsoft.com/en-us/windows7/Networking-home-computers-running-different-versions-of-Windows

    Win 7 network sharing folder specific work - http://www.onecomputerguy.com/windows7/windows7_sharing.htm

    Vista file and printer sharing - http://technet.microsoft.com/en-us/library/bb727037.aspx

    Windows XP file sharing - http://support.microsoft.com/default.aspx?scid=kb;en-us;304040
    Sharing printer XP - http://www.microsoft.com/windowsxp/using/networking/expert/honeycutt_july2.mspx

    Setting Windows native firewall for sharing XP - http://support.microsoft.com/kb/875357
    Windows XP Patch for sharing with Vista (no need for XP - SP3) - http://support.microsoft.com/kb/922120

    When you have finished the configuration of the system, it is recommended to restart everything the router and all computers involved.

    -------------

    If you have authorization and security problems, check the following settings.

    Point to a folder that wants to share do right click and choose Properties.

    In the properties

    Click on the Security tab shown in the bellows of the photo on the right) and verify that users and their permissions (see photo below Centre and left) are configured correctly. Then do the same for the authorization tab.

    This screen shot is to Win 7, Vista menus are similar.

    http://www.ezlan.NET/Win7/permission-security.jpg

    The Security Panel and the authorization Panel, you need to highlight each user/group and consider that the authorization controls are verified correctly.

    When everything is OK, restart the network (router and computer).

    * Note . The groups and users listed in the screen-shoot are just an example. Your list will focus on how your system is configured.

    * Note . There must be specific users. All means all users who already have an account now as users. This does not mean everyone who feel they would like to connect.

    ---------------------

    *** Note. Some of the processes described above are made sake not for Windows, but to compensate for different routers and how their firmware works and stores information about computers that are networked.

    Jack-MVP Windows Networking. WWW.EZLAN.NET

  • How to use variables in the report?

    Hello all,.
    I'm new to PlSql. Please bare with me.

    I have a report that runs on SSRS.
    Here is what I need it to do:

    When the report is run:
    1st of the month: it pulls the data from the previous months.
    16th of the month: from the 1st of the current month to 15.

    I am trying to use a case statement to find the right date and then use this value to ReportDate.
    ReportDate is a column in the database.

    -Find the 1st of the month
    SELECT
    CASE
    WHEN SYSDATE > last_day (add_months (SYSDATE-1))
    AND SYSDATE < last_day (add_months (SYSDATE,-1)) + 2
    THEN
    ReportDate = last_day (add_months (SYSDATE-2))

    ON THE OTHER
    SYSDATE
    END ReportStartDate,

    With the help of 10G.
    Again, I'm pretty new to this, so go easy. Let me know if I can provide any other details.

    Hello

    Welcome to the forum!

    1009545 wrote:
    Hello all,.
    I'm new to PlSql. Please bare with me.

    Certainly not! Isn't this kind of a site!
    Did you mean "Please * bear * with me?"

    I have a report that runs on SSRS.
    Here is what I need it to do:

    When the report is run:
    1st of the month: it pulls the data from the previous months.
    16th of the month: from the 1st of the current month to 15.

    What happens if it is running on another day of the month?
    The query below uses leans on the previous month when it circulates at any time from 1, in the 15th day of the month, inclusively and leans on the 1st to the 15th of the current month when run 16 or later.

    I am trying to use a case statement to find the right date & then use this value to ReportDate.
    ReportDate is a column in the database.

    -Find the 1st of the month
    SELECT
    CASE
    WHEN SYSDATE > last_day (add_months (SYSDATE-1))

    ADD_MONTHS (SYSDATE-1) will always be some time this month, then
    LAST_DAY (ADD_MONTHS (SYSDATE-1) will also be the previous month, but)
    SYSDATE is always in the current month,
    SYSDATE > ADD_MONTHS (SYSDATE-1) will always have the value TRUE.

    AND SYSDATE< last_day(add_months(sysdate,="">
    THEN
    ReportDate = last_day (add_months (SYSDATE-2))

    It's 2 months in the past. Are you ever interested in this old stuff? Areen can't you always interested in 1 months ago, or the current month?

    ON THE OTHER
    SYSDATE
    END ReportStartDate,

    With the help of 10G.
    Again, I'm pretty new to this, so go easy. Let me know if I can provide any other details.

    Whenever you have a problem, post CREATE TABLE and INSERT statements for some examples of data and outcomes from these data.
    See the FAQ forum {message identifier: = 9360002} it only takes a few minutes to read and can really help you get the most out of this forum.

    I think you want something like this:

    WITH     period_of_interest     AS
    (
         SELECT     CASE
                  WHEN  TO_CHAR (SYSDATE, 'DD') < '16'
                                           -- should be '16' above.  See note
                  THEN  TRUNC ( ADD_MONTHS (SYSATE, -1), 'MONTH')
                  ELSE  TRUNC (             SYSDATE    , 'MONTH')
              END     AS period_start
         ,     CASE
                  WHEN  TO_CHAR (SYSDATE, 'DD') < '16'
                  THEN  TRUNC (SYSDATE, 'MONTH')
                  ELSE  TRUNC (SYSDATE, 'MONTH') + 16
              END     AS period_end
         FROM    dual
    )
    SELECT     ...
    FROM     table_x              x
    JOIN     period_of_interest  p  ON  x.transaction_date >= p.period_start
                          AND x.transaction_date <  p.period_end
    ;
    

    Period_end is a somewhat misleading name for the column; It's actually the first DATE after the end of the period; That's why I used < (and not < =) when compared to the x.transaction_date.

    I'm not sure what ReportDate is in your description. This is an example of timid, you must validate CREATE TABLE and INSERT statements for some examples of data. It could be that ReportDate is just what I called transaction_date above.

    Published by: Frank Kulash on June 3, 2013 16:55
    This site is falling out my code. It seens to think the in the first

    WHEN TO_CHAR (SYSDATE, 'DD') < '16'
    

    indicates a kind of markup and will not display the '16', even if I put it on a separate on its own line.

    Published by: Frank Kulash on June 3, 2013 17:09
    Used & lt; to correct the estrangement, after sentries below.

  • What is the right way to use variables controlled by the two buttons and programming?

    First of all, I apologize if this has been discussed before.  I know not how to phrase succinctly the application, so maybe I just missed the search terms.

    We have several pieces of the Labview software in the laboratory that automatically control things like the taps and heaters.  Sometimes we also manually control these same things.  I'm moving old NI PCI (and older versions of Labview) maps to a variable and based on compactRIO system shared network.  However, I'm still not on best practices to achieve.  I need to be able to have a script running at any time control panel so that I can access, for example, a valve controller (which is just a Boolean), and I need power open and close the valve by programming other scripts.  I need, of course, the control panel to track the State of the valve until it opens another script, the Panel indicates that it is open, and the next push on the control panel it will close.

    Historically, this has been processed using structures business to move from a "computer control" and "hands-on" with global variables that define the State of the valves.  Of course, this is not recommended.

    So far, I've played with the help of two variables, a status of valve and the other for the State of button.  The Panel configuration then loops, reads the status of the valve and puts the State of button if the State of the valve has changed.  I can do this with registers at offset or with the structures of the event, but anyway, it gets very crowded and seems inefficient.  Is there a good way to do this in Labview?  It seems this is a common problem, so I hope there is an easy and elegant solution that I've missed.

    Variable published use shared network.  Your scenario and your manual of the interface and change the variable and then shared your cRIO reads fair value and writes the appropriate values.

    Now for a cool part.  On your manual interface, right-click on your heart control that you want to use to control the shared variable and go to properties.  There should be a data binding tab in the Properties dialog box.  You can bind a control/indicator to a published network shared variable.  So this button will always be attributed to the current state.

    Your script should just read the shared variable before resuming to verify that it is in the correct state.

  • How to use a structure of the event in a Subvi

    I am using a structure of the event within a Subvi.  The Subvi has a table constructor that built tables and the structure of the event is used so that when the program runs, it allows you to change the elements of the array.  It works, but when I apply within a Subvi, it does not work properly.  This goes into a Subvi, because it will be part of a much larger progrram, so it must be modular.

    If you are using a structure of the event, it is not a Subvi.  If you worry about modularity, you should not use the structure of the event.

    You seem to have a fundamental misunderstanding of modularity.  An event structure must be placed in a while loop.  If you have a while loop in a Subvi, you have transferred control of your program to the Subvi.  You are not at this stage modular.  Your higher level GUI has no control.  You would have to create a stupid system of variables to pass data down to the loop to stop the loop and return to your main VI.  This is not a good design decision.

    Instead of searching for a way to make something broken, you should spend effort trying to understand what you really want to accomplish.  You should also spend some time to learn how to work the event structures.

    This application is small at the moment and it is already on the way to the unreadable.  It's a terrible thing to do for you.  Break these habits now.  variables are only when absolutely necessary.  Using subVIs to accomplish individual tasks, do not run the entire application.  With the structures of the event, use a value of stop button change event for will not be held hostage to the time-out.  If your variable is '2' in it, you're doing something wrong.  It has to be something different between set points, put it in the name.  If you want to make the subVIs, create an icon.

    But first and foremost, invest time in understanding dataflow

Maybe you are looking for

  • I am able to implement several personal dictionaries

    I realize different addons can be used. But there is a facility to use a custom dictionary How to use the spellchecker of Firefox? It is easy to create and pass the dictionaries other than by using addons.For example can I create my own personal dict

  • Equium A60: Unable to connect to the browser with Wlan

    Hi on my A60, there is no switch on the right side to connect to the internet browser, the laptop shows large signal and connected, but I can't seem to get access, are there keys that I could use?

  • The option for the DM4 beats edition HARD drive

    I dm4 beats with i7, 8 GB ram, 1 TB 5400 RPM hard drive. The laptop is very slow during operations and only works very well with fresh install a few days. As I am a heavy user and have a lot of cloud storage apps and use of heavy applications. I thin

  • Switch-SG300-20-20 as L3 switch?

    Hello In the company of a client, there is a ring of 3850 switches (L3) connected by optical fiber (the links are links L3 not trunks) and using OSPF for routing traffic between the different VLAN switches. Now, the client wants to include a new swit

  • Not connected to the BlackBerry Server blackBerry smartphones

    Whenever I have do hard reset, the tour of my device or reboot after uninstall an application is not registered on the network. He pushing me race frequently diagnosed or registry HRT and need to wait for the BlackBerry registration message within 1-