How to assign a value of string comman separated in the Clause of SELECT m

In table A, I followed values

Price ID
-- ------
1 100
2,200
3 300
4 400
6 500

Now, in table B, I have following values

Product price combi
--------- ----- --------
OIL 600 '1', ' 2 ', 3'

What I do is, first of all get the combi in table B value and then get the count of the table has.

In condition, it should return 3...

create or replace procedure amit_combi_test
as
v_combi varchar2 (100);
tot_row number (10);
cursor table_combi is
Select combi
b;

BEGIN
OPEN table_combi.
LOOP
EXTRACT the table_combi in v_combi;
EXIT WHEN table_combi % NOTFOUND;
dbms_output.put_line (v_combi);

Select count (1) INTO tot_row
a.
WHERE ID in (v_combi);

dbms_output.put_line (to_char (tot_row));

END LOOP;

CLOSE Table_combi;
END;

But the problem is... it shows the value of the variable tot_row = 0; It should come 3...

ace_friends22 wrote:
Thank you all, but it seems regexp_ functions and xmltable are not available in Oracle 9.2... I tried to use it, but it says invalid identifier......

So why it is always a good idea to display the version of your database with your question, especially if you use a version not supported by the database, otherwise we have to assume that you use one of the latest versions supported. This saves also we are wasting our time.

Tags: Database

Similar Questions

  • How to assign a value to an attribute column in the table in the ADF

    Hi all

    BindingContext ctx = BindingContext.getCurrent ();
    DCBindingContainer bc = (DCBindingContainer) ctx.getCurrentBindingsEntry ();
    Iterator DCIteratorBinding = bc.findIteratorBinding ("StudentVO1Iterator");
    Line r = iterator.getCurrentRow ();

    FacesContext facesContext = FacesContext.getCurrentInstance ();
    Application app = facesContext.getApplication ();
    ExpressionFactory elFactory = app.getExpressionFactory ();
    ELContext elContext = facesContext.getELContext ();
    ValueExpression valueExp =
    elFactory.createValueExpression (elContext, "#{data.") StudentAMDataControl.dataProvider} "(,Object.class);"
    AMEST StudentAMImpl = (StudentAMImpl) valueExp.getValue (elContext);
    String newno = amest.getEstNoGenerate ();

    System.out.println ("new number" + newno);
    r.setAttribute ("StudentNo", newno);

    BindingContext ctxdet = BindingContext.getCurrent ();
    DCBindingContainer bcdet = (DCBindingContainer) ctxdet.getCurrentBindingsEntry ();
    DCIteratorBinding iterdet = bcdet.findIteratorBinding("StudentDetailVO1Iterator");
    Line rdet = iterdet.getCurrentRow ();
    System.out.println ("row" + rdet);    print null
    rdet.setAttribute ("DtlStudentNo", newno);

    in code above my header part can affect return value, but the level of detail, it cannot affect. which shows nullpointer exception. because the Row rdet object become null. Why does this happen? it comes out when I press a button.
    I code in backing bean Tin and running on the commercial version of jdeveloper 11g 2...
    help jumping... anyone who knows...
    Thank you.

    A good starting point are the docs (http://docs.oracle.com/cd/E28280_01/web.1111/b31974/bcentities.htm#sm0126).
    Example http://dstas.blogspot.de/2011/10/master-detail-data-presentation-and.html

    Timo

  • How to assign a value of the element from page to main page in the column element when Cre

    I have a form build on table T1. The T1 has a primary key defined (T1PK) and four other columns (C1 - C4). I have a form in this table. This form accepts the values of C1 to C4 and displayis an extra point, is not based on columns of T1 - P1_DUMMY. The form for T1PK element has the value "hidden and protected.
    When creating the form, I wanted that the value of the primary key (T1PK) will be obtained through existing trigger. I want to use the value stored in the page called "P1_DUMMY" for P1_T1PK.

    No matter what I do, I always get this error when I hit the button 'CREATE' on the page of the form:

    ORA-01400: cannot insert NULL into ('DEV'. "" T1 ". ("' T1PK")

    The Create button is a condition not to show if the the P1_T1PK page element is NULL. I created page rendering process, the process of transformation of page like this bock of PL/SQL:

    : P1_T1PK: =: P1_DUMMY

    But I still get ORA-01400. The form has the P1_DUMMY as display only, not not to store the State, so I can see that the P1_DUMMY element has the value I want (2).

    How to assign the value stored in P1_DUMMY in P1_T1PK when I click on the button CREATE on this form?

    Thank you for your time.

    Daniel

    Hello
    The belief question is the way in which the calculation is being defined. You are not using the &. rating (dot ampersand) in PL/SQL and SQL.

    Try this.

    1 define the calculation on P1_T1PK of Type calculation of value of the element
    2. on the next page to load textarea, enter P1_DUMMY. No. colon or &
    3. give appropriate conditions

    Kind regards

  • How to assign a value to the attribute support bean viewcriteria?

    Hello

    I have a readonly VO with the following query

    Select value attr2, attr1, attr4, attr3
    from sometable

    I have a criterion for display in the t above, something like
    attr1 =
    and attr2 =

    I dragged and dropped this criterion on a Status.jsff page in the Panel of the query with table. If the user can search the records by manually entering the values in the query Panel. In addition, there are another page Main.jsff where, if the user clicks on a button, it redirects him to the page Status.jsff carrying a digital value from the page Main.jsff. Now, I have to assign this numerical value of "attr1" criteria to display and execute this VO and show results updated in the Status.jsff page.

    I used the code below:
    ViewObject vo = appModule.findViewObject("VOName");
    ViewCriteria criteria = vo.getViewCriteriaManager () .getViewCriteria ("CriteriaName");
    criteria.getVariableManager () .setVariableValue ('attr1', numericValue);
    vo.applyViewCriteria (criteria);
    vo.executeQuery ();
    For the above code, I got an error saying that "attr1" Variable not defined in the 'VOName '.

    Then I tried to place where simple clause of
    vo.setWhereClause ("attr1 =" + numericValue);
    vo.executeQuery ();
    For this code, I got an error saying that the SQL error in the preparation of the statement. Statement: SELECT * FROM (select attr1, attr2, attr3, attr4, of VOName) QRSLT WHERE (attr1 = 1234)

    Please let me know the solution to this problem.

    You can set the variable bind display property to hide. If variable binding will not appear in the query.

    bindvariable control flag > show hint > hide.

    TUTTU JOSE

    Published by: josetuttu on November 13, 2011 21:45

  • Assign a value based on a condition of the varaible

    How can I assign a conditional numeric value to a variable based on the value of an xml tag. That is if she is 'company A' give it 12 if it is 'company B' 17. Also be able to use this value later in the model.


    Thanks in advance

    Use this:


    To retrieve and print its value later in the model simply put:

    It is documented here:

    http://download.Oracle.com/docs/CD/E12844_01/doc/BIP.1013/e12187/T421739T481157.htm#4535390

    Please spend some time to read the documentation for it.

    concerning

    Jorge

  • assign a value to a text element using the PL/SQL function body

    Hello

    I want to assign a value to a text element using PL/SQL function body option in the Source elements. But the below error when I try to apply it.

    Source code:

    declare
    name varchar2 (100);
    Start
    If v ("P3_CREHIDD") = 'Edit' then
    Select ename in the name of cpy_emp where empno = v('P3_EMPNO2');

    end if;
    end;


    ERR-1904 unable to calculate the default item: type = computation_type = function body declare name varchar2 (100); so start v ('P3_CREHIDD') = 'Edit' and then select ename in the name of cpy_emp where empno = v('P3_EMPNO2'); end if; end;.

    Thank you
    David.

    Hello

    Your body of the function doesn't return anything.
    Maybe it works

    declare
      l_name varchar2(100);
    begin
      if v('P3_CREHIDD') = 'Edit' then
        select ename
        into l_name
        from cpy_emp
        where empno = v('P3_EMPNO2');
      end if;
      RETURN l_name;
    end;
    

    BR, Jari

  • % RGB values is no longer visible to the Magnifier tool Selection white balance

    When you use the white balance selection tool in LR3.3 RC RGB values no longer appear in the Magnifier window while moving the tool around the image. The only way I can get the values to display is to stop moving the tool, then click on one of several keys (e.g. Ctrl or shift or Alt, or------, etc..) As soon as I then move the tool that the RGB values again disappear until I stop and again once, click one of the buttons.  He had worked previously in LR3 (? before I updated to 3.2 to 3.3 - in other words, the values would show all the time as I moved the tool around the image.)   Any thoughts on what to do?

    Thank you.

    Snap1.jpg

    larsonts wrote:

    Any thoughts on what to do?

    This is a known bug. It was found soon enough after 3.3 RC came out he has a chance to set at 3.3 was released in the official version, but you never know with certainty what will be corrected. All you can do is wait.

    HAL

  • How to assign a value to a button

    I'm trying to assign an integer value to a button and the button must send the value of the integer assigned to the writing of TCP/IP, only when the button is pressed. I am able to send data using chain control (as indicated in the attachment) but I want to replace it with several buttons. for example, if I enter 2 in the control of the chain, these data will be sent to a robot (robot a Wi - Fi card) via the tcp/ip Protocol, it moves in front. 3 will return, 8 is on the left, 6 is just. These digital data are already burned in blackfin processor of the robot. In numbers in labview can make my robot so just move in the specified direction. can you please help me to create a button with value and convert it to a string and send it to the writing of tcp/ip. This only happens when the button is pressed. because, if I enter numbers in the control of the chain, it dosent seem good... If I have pimples... I think that my VI will look good and hitech.i am using labview 8.6robot reference:http://www.surveyor.com/SRV_info.html                          http://www.surveyor.com/                          http://www.surveyor.com/cgi-bin/robot_journal.cgi

    Hi momo,.

    You can use a structure of the event. Create a case for each button and enter the correct number to send. If you press a button of your, you can send data to your robot.

    Mike

  • How to assign a value zero if the value is null.

    I have a package, procedure and many functions. I'm trying to get the result of DBMS to list a value for each, if it is null, assign it a zero and move.
    I can't find examples where I can do. Any ideas on how I can assign a zero when there is no value in the table?
    CREATE OR REPLACE PACKAGE emp_net_pay IS
      PROCEDURE emp_tot_sal  (v_empno IN NUMBER);
      FUNCTION find_emp      (v_empno IN NUMBER) RETURN BOOLEAN;
      FUNCTION tot_sal_com   (v_empno IN NUMBER) RETURN NUMBER;
      FUNCTION bef_tax_ded   (emp_no IN NUMBER)  RETURN NUMBER;
      FUNCTION temp_sal_btd  (emp_no IN NUMBER)  RETURN NUMBER;
      FUNCTION tax_emp_sal   (emp_no IN NUMBER)  RETURN NUMBER;
      FUNCTION sal_aft_tax   (emp_no IN NUMBER)  RETURN NUMBER;
      FUNCTION aft_tax_ded   (emp_no IN NUMBER)  RETURN NUMBER;
      FUNCTION tot_net_sal   (emp_no IN NUMBER)  RETURN NUMBER;
    END emp_net_pay;
    /
    CREATE OR REPLACE PACKAGE BODY emp_net_pay IS
    --Procedure calculates totals: Salary plus commission
    PROCEDURE emp_tot_sal (v_empno IN NUMBER)
    IS
      v_tot_sal  NUMBER;
      v_bef_ded  NUMBER;
      v_temp_sal NUMBER;
      v_tot_tax  NUMBER;
      v_sal_tax  NUMBER;
      v_aft_ded  NUMBER;
      v_net_sal  NUMBER;
     BEGIN
      v_tot_sal  := tot_sal_com (v_empno);
      v_bef_ded  := bef_tax_ded (v_empno);
      v_temp_sal := temp_sal_btd(v_empno);
      v_tot_tax  := tax_emp_sal (v_empno);
      v_sal_tax  := sal_aft_tax (v_empno);
      v_aft_ded  := aft_tax_ded (v_empno);
      v_net_sal  := tot_net_sal (v_empno);
         DBMS_OUTPUT. PUT_LINE ('Salary before deductions for employee # ' || v_empno || ' equal: ' || to_char(v_tot_sal,'$999,999.99'));
         DBMS_OUTPUT. PUT_LINE ('Before tax deductions for    employee # ' || v_empno || ' equal: ' || to_char(v_bef_ded,'$999,999.99'));
         DBMS_OUTPUT. PUT_LINE ('Salary minus deductions for  employee # ' || v_empno || ' equal: ' || to_char(v_temp_sal,'$999,999.99'));
         DBMS_OUTPUT. PUT_LINE ('Total taxes for              employee # ' || v_empno || ' equal: ' || to_char
    (v_tot_tax,'$999,999.99'));
         DBMS_OUTPUT. PUT_LINE ('Salary minus taxes for       employee # ' || v_empno || ' equal: ' || to_char
    (v_sal_tax,'$999,999.99'));
         DBMS_OUTPUT. PUT_LINE ('After tax deductions for     employee # ' || v_empno || ' equal: ' || to_char(v_aft_ded,'$999,999.99'));
         DBMS_OUTPUT. PUT_LINE ('Net salary for               employee # ' || v_empno || ' equal: ' || to_char
    (v_net_sal,'$999,999.99'));
     END emp_tot_sal; 
    ..................................................
    Salary before deductions for employee # 7369 equal:      $900.00
    Before tax deductions for    employee # 7369 equal:       $95.34
    Salary minus deductions for  employee # 7369 equal:      $804.66
    Total taxes for                   employee # 7369 equal:       $56.33
    Salary minus taxes for          employee # 7369 equal:      $748.33
    After tax deductions for       employee # 7369 equal:        $8.00
    Net salary for                      employee # 7369 equal:      $740.33
    *******************************************************
    
    alary before deductions for employee # 7654 equal:    $2,650.00
    efore tax deductions for    employee # 7654 equal:
    alary minus deductions for  employee # 7654 equal:
    otal taxes for                    employee # 7654 equal:
    alary minus taxes for          employee # 7654 equal:
    fter tax deductions for       employee # 7654 equal:
    et salary for                      employee # 7654 equal:                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            

    NVL looking for [url http://docs.oracle.com/cd/B28359_01/olap.111/b28126/dml_functions_2048.htm]?

  • How to assign a value to a control to display after loading the page?

    I use JDeveloper 10.1.3.3 using ADF.

    How can I run a support bean method to populate a control immediately after loading the page. My intention is to populate a control hidden with the session id. The code that I would run is something like this:

    FacesContext ctx = FacesContext.getCurrentInstance ();
    ExternalContext ectx = ctx.getExternalContext ();
    HttpSession mySession = ectx.getSession (false) (HttpSession);
    String sessionId = mySession.getId ();

    Where would I put this code?

    Thank you

    John

    Published by: John Matozzi, October 28, 2008 15:47

    Hi John,.

    create a method called getSessionId returning a string in your bean support.

        public String getSessionId(){
    
            FacesContext ctx = FacesContext.getCurrentInstance();
            ExternalContext ectx = ctx.getExternalContext();
            HttpSession session = (HttpSession) ectx.getSession(false);
            return session.getId(); 
    
        }
    

    then in your page you can use the link editor to call the method and display its value.

    
    

    Brenden

  • Assignment of values to text to use in the calculation

    Hi, I have extremely limited experience script and am quite stuck trying to get something to work. Any help would be appreciated.

    I have a combo box (ComboBox1) with three other areas of text with three different Option A and Option B Options (or Option C) with numbers in them (NoBox1, NoBox2, NoBox3), I want to use to add up to a total figure.

    Yes ComboBox1 + NoBox1 + NoBox2 + NoBox3 = Total

    I want to assign a numerical value to the text options in the combo box so that I can use in the calculation. Let's say Option A = 8, B = 12 & Option Option C = 16

    Thank you

    Each combo box item can have an assigned value export, so just set it to the number, you want to use for each item. The value of exports of the selected item will become the value of the field to the drop-down list box.

    If more than one element is to use the same export value, it is best to use a different approach, so report it again if this is the case and I'll give you more information.

  • How to set a value in visibility of component with the expression builder?

    Hello
    I want to put the true/false value in visibility of adf component according to the value of the object of a bean. If the value of the object is zero, visibility value will be false, else visibility is true.
    How can I do without the extra variable definition in the bean to support?
    Thank you, Ali

    HI :-)

    If I just understand your needs, try using this expression el to the property of your element rendering:

    rendered="#{YourBean.yourValue == null ? false : true}"
    

    Concerning

    Majo

  • How to assign the value to the application-level element

    Hello

    I'm learning to APEX.  I use version 4.2.6.

    My question is, I set a text field called 'FINANCIAL_YEAR' in the login page.  I wanted to know how to assign this value to a text element of Application level (on page sent), so that I can get this value through at my request.

    Thank you

    -Anand

    anand_gp wrote:

    Yes, I created a 'text area' under 'HTML' in the 'Home' page  Who accepts the exercise of a table through LOV.  I intend to assign this value to a global variable so that this variable can be read in any of the application to filter the result set from different tables (not yet built the rest of the application).  To do this, I was intending to use "Shared components"-> "Elements of Application".  I'm still not quite sure how it works.

    Start by reading the documentation on elements of application.

    Go to the shared components > Application parts and create your G_FINANCIAL_YEAR item. Value Session State Protection Restricted - can not be set the browser so that the value is not editable by the user, falsification of URLS or scripts.

    On the home page, if there is not already a button to submit the value of the fiscal year, add one in the HTML area, with the Action as a submit Pageclick. Otherwise, you can do without the button and using submit Page in Page Action when the changed value select the parameter in the list so he can undergo.

    Then, in the section of the Page processing, create a calculation:

    Point Type: Application-level element

    Calculate Item: Application: G_FINANCIAL_YEAR

    Point calculation: After submit

    Type of calculation: Value of the element

    Calculation:

    Run the application, select a value in the list of the fiscal year and submit the page. Review of current session state in the viewer of session state by clicking on the link of Session in the toolbar developer. Select the Elements of Application in the view list, and then click set. The element of your application and its current value must be visible. You can now reference value throughout your application by using the appropriate syntax.

    You should also consider if a default value (for example the current year) using a calculation Application from the point of calculation on the new Instance and coordinate the application point and part of the homepage using point application as the Source of value or an expression with Source page element, the value always, replacement of value that exists in the session state.

  • Error ESTK "cannot assign a value.

    Dear friends, started a new project - and of course the new problems:.

    The SumOf (list of values) function works perfectly,

    but an equivalent of the function VsumOf (list of variables) stops at line 16 in the first iteration of the loop: cannot assign a value.

    At this point, the result variable is just - 132.09 - out sort of a numerical problem.

    var z = SumOf (11.1, -11.9, 12345679.0, -12345679.0, 124.5, -17, 18.9, 2.2, 2.5, 2.5, 2.5, 31.31, 312345679, -312345679); 
    alert ("SumOf the numbers = " + z); // giving 166.610000014305  (figures after the 000 are artifacts)
    
    var z = VsumOf (11.1, -11.9, 12345679.0, -12345679.0, 124.5, -17, 18.9, 2.2, 2.5, 2.5, 2.5, 31.31, 312345679, -312345679); 
    alert ("VsumOf the numbers = " + z);
    
    function VsumOf (valuePairs) {
      var nArguments = arguments.length;
      var j, z, result = 0;
      if (Math.floor(nArguments/2) * 2 !== nArguments) {return undefined;}
      
      for (j = 0; j < nArguments; j=++2) {
        if (isNaN(arguments[j])) {return NaN;}        // should be skipped in calling environment
        if (isNaN(arguments[j+1])) {return NaN;}
        z = arguments[j] * arguments[j+1];
        result = result + z;                          // <<== Can not assign value ???
      }
      return result;
    }
    
    // this one works correctly
    function SumOf (values) {
      var nArguments = arguments.length;
      var j, result= 0;
      for (j = 0; j < nArguments; j++) {
        if (isNaN(arguments[j])) {return NaN;}        // should be skipped in calling environment
        result = result + arguments[j];
      }
      return result;
    }
    

    Any ideas what really does this error message mean?

    Hi Klaus,

    Just change your line 12 for

      for (j = 0; j< narguments;="" j="j+2)" {="">

    It should work.

  • How to assign a dynamic name of the factory of connections to a JMS adapter

    Hi all

    IM using JDeveloper 11 g Release 1 version.

    First of all, I need to get the name of a table connection factory and then passing to the JMS adapter is it possible? I can potentially affect the connection factory name a kind of variable and then assign a value to what I get from the database?

    Thank you very much
    José Correia
    BB - D

    Hello
    You can do this by setting the properties of JCA in the invoke of the adapter. Open the BPEL/mediator who calls the adapter when BPEL click twice on the DB adapter inoke-> go to the Properties tab and set the /jca.db.XADataSourceName 'jca.db.DataSourceName' with a variable value by using exp. Builder. In your case, get the value of the DB and set the property with the value of DB

Maybe you are looking for

  • Do not open the PDF files I have tried EVERYTHING, nothing works please help

    In the last two weeks, I can't open PDF files in Firefox. They open fine in Internet Explorer. I've been on the support forum now over 2 hours and EVERYTHING suggested tried unsuccessfully. It seems this is a common problem.Help, please.

  • Problem IPOD Touch Kbps

    In recent weeks my Itunes and Ipod gave me royal fits. Finally, I worked on most of the questions, with the exception of one of the major problems. I have an Ipod Touch 4th generation running IOS 6 (the most recent who qualifies for 4th gen iPod.) I

  • Photostream

    Photostream folder does not appear in my photos on my iPad Pro application. All iOS updates are up to date. I tried switching off Photostream (several times) in Settings > iCloud > iCloud photo library & Settings > iCloud > download to my Photostream

  • Upgrade SSD in Portege Z930 - 14 c

    Hello I think upgradidng my ssd 128 GB stocks to a larger 250 GB model. I'm not sure of the type of ssd used in the machine that want to get the right size etc so can clone my disk and doa replacement right. Nobody knows the type of disc and how simp

  • Is it safe to buy an iphone 5 s, for what is battery, which has been manufactured months ago?

    Hello I plan to buy an iPhone 5s this month of December, 2015 of an apple authorized online retailer, as the price is cheaper there. They say they will deliver a phone in 2015. What happens if they deliver a phone in January? Assuming exhaust the bat