Use a variable in the paragraph in PL/SQL

Hello

Please let me know how to use variable in the PL/SQL Select query clause.

[code]

create or replace PROCEDURE emp

2 EAST

emp_id 3 VARCHAR2 (1000);

4 BEGIN

emp_id 5: = '1989100351, 1989100352, 1989100354';

6 - emp_id: = '1989100351';

7 FOR rec IN (select employee_id of employee emp_id WHERE employe_id IN)

8 LOOP

9 dbms_output.put_line (rec.employee_id);

10 END OF LOOP;

11 END emp;

12.

DISPLAYS THE ERROR MESSAGE;

Created procedure.

[email protected]/ICSN - SQL > no errors.

[email protected]/ICSN - SQL > EXEC emp;

BEGIN emp; END;

*

ERROR on line 1:

ORA-01722: invalid number

ORA-06512: at "emp", line 7

ORA-06512: at line 1

[/ code]

You cannot use pl/sql variable with values separated by commas in the paragraph directly, you must break into multiple records

Try this too [g 11]

create or replace PROCEDURE emp

IS

emp_id VARCHAR2 (1000);

BEGIN

emp_id: = '1989100351, 1989100352, 1989100354';

FOR rec IN (select employee_id from employee WHERE employe_id IN ())

Select (column_value) .getnumberval)

from xmltable (emp_id)) double.

)

LOOP

dbms_output.put_line (Rec.employee_id);

END LOOP;

END emp;

/

Tags: Database

Similar Questions

  • Can Oracle 10g - I use a variable for the access of the user identifywhat tablesto?

    I have the following code in a trigger (PL/Sql block) of a form:

    Select fieldname in user1.sometable myvar;

    is it possible to use a variable instead of coding hard "user1"? And on the same subject, this variable would also be declared in the world?

    Thanks in advance,
    Darren

    Hello!

    User1 is the owner of the table sometable.

    If only the User1 runs your form, there is no need to put the tableowner in front of the tablename parameter.

    If other users run your form, you must create a public or private (for each user) synonym of this table.
    After that, you don't need to use owner.tablename in your sql statement.

    But:
    You cannot use a variable for the user name without using dynamic sql
    as you do if you create a recordgroup.

    Concerning

  • Use of Variables in the statement of sym.play(1000)

    I built a system menu to a main menu with three options and a single submenu animation that should be limited to one of the three different places on the timeline, depending on which is click the main menu button.

    For each button in the main menu, I created a click made up of sym.setVariable event ("Subselection","#" ""); in "#" can be set to 1, 2 or 3.  When you click on one of the buttons on the main menu and the submenu opens at the end of this sequence, I inserted the following text - sym.play(1000) (subquery);

    It is all quite clearly displayed in the snap-in to display annotated below.

    It is important for me to master the use of variables and strings concatenated in the instruction of sym.play(1000) so I can create as compact as possible OAM files, so any help is greatly appreciated.  My guess is that I am a stupid syntax error, but I am not opposed to picking the brains of others when mine is insufficient for the task at hand.

    Thank you very much.

    Andy.

    Screen Shot 2014-03-13 at 10.22.01 AM.fw.png

    Hi Harley,

    Image labels are 1,2,3 etc.

    sym.setVariable ("Subselection", 0); in the composition of the scene ready

    Then in the menu, you can set the variable "Subselection" 1,2,3 and then call sym.play(1000) (sym.getVariable ("do"));

    Thank you and best regards,

    Roger Simon

  • Using of Variable in the filter expression will not scan.

    IN ODI 11.1.1.3.0, I've defined a Variable of type 'Alphanumeric' (SelectionDate), default = January 1, 1970 with the query select: select to_char (SYSDATE, 'DD-MON-YYYY') of double.
    I intend to use this variable as a scenario (parameter) variable that receives a value in the form "DD-MON-YYYY', of the execution environment.
    I refreshed the variable and the value received June 16, 2011 (current date). So far so good.

    Then, I defined an Interface and use the variable in a filter expression:

    Filter active: checked

    Tab implementation:
    SOURCE_VIEW. SELECTION_DATE BETWEEN TO_DATE (' #PROJECT1.) SelectionDate', 'DD-MON-YYYY') AND (TO_DATE (' #PROJECT1.)) SelectionDate', 'DD-MON-YYYY') + 1).

    Run on: Source

    During the verification of the expression (click the check mark in the application tab) I always get: Expression is not valid for the DBMS. java.sql.SQLDataException: ORA-01858: a non-digit character was found here where was waiting for a digital.

    I can't filter to analyze. Thank you for your ideas of what could be wrong.



    Jose.

    Hi Jose,

    You must set this variable in a package and refresh it. Then place your interface with the current filter condition.
    Run the package. It should work.

    Thank you
    Fati

  • Use of variable in the For-Each statement

    Hello gurus.

    I'm having a problem using a variable, I created in a statement for each. Here is the code I am using
    My goal is to create a variable based on the type of Bill. If the invoice is a proof or a reprint, a copy should be printed. If it's a final bill, I need two copies.

    <? xdoxslt:set_variable($_XDOCTX,_'x',_0)? >
    for each<? If: Print_Additional_Header_Text_ID238 = "PROOF"? > <? xdoxslt:set_variable($_XDOCTX,_'x',_1)? > <? end if? >
    <? If: Print_Additional_Header_Text_ID238 = "REPRINT"? > <? xdoxslt:set_variable($_XDOCTX,_'x',_1)? > <? end if? >
    <? : otherwise (Print_Additional_Header_Text_ID238)? > <? xdoxslt:set_variable($_XDOCTX,_'x',2)? > <? end if? >
    <? xdoxslt:get_variable($_XDOCTX,'x')? > <? for-each@section:xdoxslt:foreach_number($_XDOCTX,1,$x,1)? >

    foreach is the loop that I use to repeat sections of the Bill.

    When I run with the last impression for each preview, I get an error that says "undefined variable: 'x'"»
    But when I remove the last for each good variable, 1 or 2, will show in the invoice.

    My question is: How can I use the variable 'x' in <? for-each@section:xdoxslt:foreach_number($_XDOCTX,1,$x,1)? >

    TIA
    Darius

    Published by: 852460 on May 24, 2011 08:31

    Published by: DEK17 on July 20, 2011 13:15

    Probably, this will help you

    http://winrichman.blogspot.com/search/label/multiple%20copy

    Try

    
    or
    
    
  • The use of variables in the Calc scripts and business rules

    I'm sure that there have been previous discussions on this topic, but can anyone let me know the benefits of using variables in scripts of Calc and BRs?

    Thank you
    A
    I've never used variable Calc and after reading a guide to the study, which has talked about them, I didn't really understand the benefits.

    ^ ^ ^ I use variables all the time to make difficult abstract formulas. Here is an example.

    /*     Declare variables     */
    VAR varSalaryCosts ;
    VAR varProdOHLabXXXX ;
    VAR varXXXX ;
    
    A whole bunch of code here along with very limited FIX statement and then...
    
    "Salaried Labor"
    (
         varSalaryCosts = "Salary Costs"->"No Department"->"No Category"->"Salaried" -
                             "Wage Bonus"->"No Department"->"No Category"->"Salaried" -
                             "YYYY Retention Bonus 40%"->"No Department"->"No Category"->"Salaried" -
                             "YYYY 60% Ret Bonus Accrual"->"No Department"->"No Category"->"Salaried" ;
         varProdOHLabXXXX = "Number of Employees"->"ZZZZDepartments"->"Codes"->"Salaried" +
                             "Number of Employees"->"Blah Departments"->"Codes"->"Salaried" +
                             "Number of Employees"->"Humph Departments"->"Codes"->"Salaried" +
                             "Number of Employees"->"TTTT"->"Codes"->"Salaried" ;
         "Salaried Labor" = varSalaryCosts * ("Number of Employees"->"Salaried" / varProdOHLabXXXX) ;
    )
    

    The last formula is how the formula was described to me by the owner of the company. I find it much easier to read something like:

    "Salaried Labor" = ("Salary Costs"->"No Department"->"No Category"->"Salaried" -
                             "Wage Bonus"->"No Department"->"No Category"->"Salaried" -
                             "YYYY Retention Bonus 40%"->"No Department"->"No Category"->"Salaried" -
                             "YYYY 60% Ret Bonus Accrual"->"No Department"->"No Category"->"Salaried") *
                             ("Number of Employees"->"Salaried" /
                             ("Number of Employees"->"ZZZZDepartments"->"Codes"->"Salaried" +
                             "Number of Employees"->"Blah Departments"->"Codes"->"Salaried" +
                             "Number of Employees"->"Humph Departments"->"Codes"->"Salaried" +
                             "Number of Employees"->"TTTT"->"Codes"->"Salaried")) ;
    

    I used the TABLE in a calc script really-cool-but-alas-not-invented-by-me do better than planning made the conversion of currency currency conversion in planning. (How's that for a run-on sentence?) It is one of the six blog posts that I'm trying and I will end it soon, I hope. I am now thrash mode. It doesn't have its uses and I'll try to remember to update this thread when I'm done.

    Kind regards

    Cameron Lackpour

  • Column unresolved when using presentation variable in the filter responses

    Hi all

    I am using a dashboard command prompt that sets a variable presentation - pres_year. I use the presentation variable in the filter of the application.
    In the 'Criteria' tab, in the filter for a request, I put a year column (YEAR) the presentation via the Expr Variable variable and enter the variable name of presentation only. End up with:
    YEAR is equal to / is in @{pres_year}

    When you use the dashboard, the prompt and ask all work fine. The problem is when I'm in demand for answers and I click on the "View results" button I get the following error:
    "NQSError: 27005 unresolved column pres_year'.

    Any suggestions?

    Thank you.

    Set a default value after the presentation variable in your filter. If you put no default value, and then in the responses, the application not of value to the variable of presentation. Click on the filter and add default value. Then it won't work.

    Edited by: David_T on October 14, 2010 08:13

  • How to use text variables and the Image for printing

    I work for several months on the product with AS3 Configurator.
    I am not competent with AS3.
    Now, it seems that perhaps my design is all wrong.
    Is there a good way to do this?

    I have a main scenario that has video clips showing images of different options for the product.
    On the first image, I use buttons to select the choice for option 1 of the Option1_mc.
    Can I store the selection in a variable.
    I use a button to go to the next choice (screen 10.)

    On frame 10, I use buttons to select the choice of option 2 in the Option2_mc.
    It is stored in another variable.

    There are about 10 options that are selected and stored in variables.
    Some are text values and other images taken from video clips Option instances.

    I made a Print_mc to use to printjob.
    I can't get the values of the variables to display the first image for printing.

    Any helpl would be appreciated.

    You are welcome.

    you will not be able to insert a variable into a textfield.  you are going to assign to the text of your TextField property set to one of your points of variables to.

    Thus, for example, if you have:

    var var1:String = 'this is a test ';

    You can use:

    TF. Text = var1;

  • using local variables in the help of calc

    Hello

    I am trying to use local variables in a calc by declaring two variables and then referencing these two variables to do some math. However, I get an error: error: invalid member name 1012004 [Cumulative_Biscuits]

    Anyone know why it gives this error? I'm he declare incorrectly? Here is my code.





    ESS_LOCALE English_UnitedStates.Latin1@Binary

    UPDATECALC OFF SET;
    SET AGGMISSG
    SET CACHE HIGH;
    SET CREATENONMISSINGBLK


    var Cumulative_Biscuits, Average_Biscuits;

    Difficulty ("New York", "Cola", "Budget", & CurrYr, & CurrMonth)

    / * Calculate the Cumulative cookies for 24 months * /.
    Cumulative_Biscuits =

    @Sumrange ('cookies'-> 'Real', @XRANGE (PriorYr02-> PriorMonth02, & PriorYr02-> Dec)) +.
    @Sumrange ('cookies'-> 'Real', @XRANGE (PriorYr01-> Jan & PriorYr01-> Dec)) +.
    @Sumrange ('cookies'-> 'Real', @XRANGE (CurrYr-> Jan & CurrYr-> PriorMonth));

    / * Now calc average 24 previous months * /.
    Average_Biscuits = Cumulative_Biscuits / 24;

    ENDFIX

    / * Now to spread the calculated average above for the next 20 months in the current scenario * /.


    Difficulty ('New York', 'Cola', 'Budget')
    / * End of month will always be Dec here * /.
    Fix (& CurrYr, & CurrMonth:Dec)

    "Cookies" = Average_Biscuits-> & CurrMonth;

    Endfix
    / * Month will always be Jan to Dec here * /.
    Fix (& NextYr, Jan: Dec)

    "Cookies" = Average_Biscuits-> & CurrYr-> & CurrMonth;

    Endfix
    / * Beginning of month will always be Jan here * /.
    Difficulty (& NextYr02, Jan: & NextMonth02)

    "Cookies" = Average_Biscuits-> & CurrYr-> & CurrMonth;

    Endfix

    Endfix

    Maybe this will help you too:- Re: calculation with temporary variables does not work

    See you soon

    John
    http://John-Goodwin.blogspot.com/

  • Can I use session variables in data model BI publisher SQL query?

    Hi Experts,

    We apply security at the level of the BI Publisher 11g data.

    In OBIEE we do so using session variables, so I wanted to just ask if we can use the same session variables in BI Publisher as well
    That is, we can include a where clause in the SQL for the sample data as

    Where ORG_ID = @{biServer.variables ['NQ_SESSION.]} {[INV_ORG']}

    I would like to know your opinion on this.

    PS: We implement security EBS r12 in BI Publisher.

    Thank you

    Read this-> OBIEE 11 g: error: "[nQSError: 23006] the session variable, NQ_SESSION.» LAN_INT, has no definition of value. "When you create a SQL query using the session NQ_SESSION variable. LAN_INT in BI Publisher [ID 1511676.1]

    Follow the ER - BUG: 13607750 -NEED TO be able TO SET up a SESSION IN OBIEE VARIABLE AND use it IN BI PUBLISHER

    HTH,
    SVS

  • Use of variable in the instructions of expression TestStand

    I'm trying to implement the following:

    Locals.tot_power = (Locals.reading + Locals.tot_power) 10th

    as long as expression of TestStand, he does not accept the variable locals.reading for power exp. is it possible to do it somehow?

    I guess that there is also another simple solution that is to use the Evaluate() function.
    In the following example, Locals.MyNumber and Locals.Exp are numeric variables.

    E.g.:
    Locals.MyNumber = evaluate (Val ("10F" + Str (Locals.Exp)))

    Roberto Piacentini
    National Instruments
    Technical sales engineer
    www.NI.com/support

  • Cannot use Global Variable in the Structure of the event

    I'm using LabVIEW 2009.

    In my LabView project, I have a global Boolean variable called EStop. I can read and write the global variable. If I double click on the global variable, it takes me to EStop.vi which includes a text button. EStop.vi is part of my project.

    In one of my report, I have a Structure of the event. If I go to one of the event handlers in this case Structure and right click and select Add event, I get a list of possible events. But this list does not EStop or an EStop events.

    I would like to add an event to EStop case: changed value.

    Why I can not add to a case of events events that include events on Global Variables as value changed?

    How can I add EStop: event changed my structure of the event value.


  • The use of variables in the help of timelines

    I wonder how can I use this code for a nav to change the wire and outside the States.

    This line of code works.

    sym.getComposition () .getStage ().getSymbol("Section2") .getSymbol ("map_Popups") .getSymbol ("U SA") .play ("Over");

    I try to save every country in a variable, but do not work.

    sym.setVariable ("current2", "USA");

    sym.getComposition () .getStage ().getSymbol("Section2").getSymbol ("map_Popups") .getSymbol (current2) .play ("over");

    Now you need a getVariable() to read. Try this:

    sym.setVariable ("current2", "USA");

    get the variable

    var newCountry = sym.getVariable ("current2");

    sym.getComposition () .getStage ().getSymbol("Section2").getSymbol ("map_Popups").getSymbol(ne_wCountry).play ("Over");

  • Use of variables in the url

    I created a php store values into a mysql database.  I animated that I have to call this php using window.open:

    window.open ("http://localhost/send_and_update.php?Tid=26 & dBA = 78 ", "_self");

    It works very well, the 26 78 data set is saved in the database.  But now I want to send values to variables in i animate.  I have try this:

    Var time = 22

    window.open ("http://localhost/send_and_update.php?Tid=time & dBA = 78 ", "_self");

    It will not work.  Any suggestion?

    Svein Tore

    Hello

    You can try this

    var time = 22

    link var = "http://localhost/send_and_update.php?Tid=" + time + "& dBA = 78"; "

    Window.Open (link, "_self");

  • using a variable outside the function that defines

    Why can't I not use the variable "numOfItems" outside of the function in the code I have attached below? I need to have a variable that retrieves its value in the number of nodes in an xml document and used later to the timeline root, outside the service the xml onLoad, once it has been loaded.



    You are still facing the same problem.

    Track at the bottom of your code tries to trace before your xml file has finished loading. Therefore, you have to wait as well.

    Inside your onLoad

    traceResult();

    And where you have your current track down.

    function traceResult() {}
    trace (numOfItems);
    }

    That should do it.

Maybe you are looking for

  • change suffix by default adresse_web

    My Firefox browser a - com as suffix Internet standard in the www.address.com address bar which - I want to change it-I have done this before but forgot how and where!

  • NB305 - impossible to obtain the limited warranty

    I brought a NB305-106 a few weeks ago and I have a problem, try to get the limited warranty, TEMPRO, it just says that my number series/number are not valid, and on the web when you try to register, it says that the serial number has already been sav

  • LP-6500 e710nzMSI.msi missing and I can not find

    I had 3 HP printers go bonkers on me in the past 6 months. My computer geek makes things worse. So I have CCleaner and wiped out any reference to HP in the registry. Then I installed a loan, HP DJ 1512. It works beautifully. Until today. Now, I used

  • How to make a DVD of Vista repair? NeoSmart does not currently offer it.

    How to make a DVD of Vista repair? NeoSmart does not currently offer it.

  • positioning of image in my application

    Hi guys, I have another question. How can position an image below on the right in my application? I have 2 image Bitmap logoAci = Bitmap.getBitmapResource ("logo_aciglobal.png");BitmapField bitmapFieldOrig = new BitmapField (logoAci, Field.FOCUSABLE)