No data found in the select statement error

Hi all

Find my sample table and data structure:
SQL> desc states;
 Name                                                  Null?    Type
 ----------------------------------------------------- -------- ------------------------------------
 SNO                                                            NUMBER
 SNAME                                                          VARCHAR2(10)

SQL> select*from states;

       SNO SNAME
---------- ----------
         1 kerala
         2 Tamil nadu
         3 AP
         4 MP
         5 jammu
Now, I create a block like:
declare
v_state varchar2(20):=' AP';
v_no number;
begin
select sno into v_no from states where sname=v_state;
dbms_output.put_line(v_no);
end;
/
After excecuting this block no data found error takes place.
Coz in where defective condition. "AP"="AP."

What oracle function I should use to eliminate this error.

I tried something like
where trunc(sname)=trunc(v_state);
But it defective. Please help me

/ * Don't know what is your exact question, but: * /.

use the TOPPING instead of TRUNC

Published by: hoek on November 26, 2011 10:00

Tags: Database

Similar Questions

  • Details by e-mail to the people found in the select statement

    Hello

    I managed to send me an e-mail to test base for the first time.

    However, I now require a method to be found via a SQL select with their information only email people.

    for example, select statement returns the details below: -.

    NAME OF APPLICATION DETAILS
    Fred.Bloggs request2 details
    Fred.Bloggs request4 details
    Jim.Blair request3 details

    I should concatenate the field IE @company.com

    so

    [email protected] receiving an email
    "request2 details" completed
    "request4 details" completed

    and

    [email protected] receiving an email
    "Details of the request3" completed

    I need help for the loop enter the full e-mail address of each person, and then send them only their data.

    Thanks in advance for your help.

    Wire UPDATE with news (previously the report erroneously) select sql statement

    your Reported

    Published by: user11962502 on December 1st, 2009 01:56

    Published by: user11962502 on December 1st, 2009 02:02

    Hello
    I don't have easy access to an Oracle instance to check it works and get the syntax right right right now but my first reaction would be to use a combination of rpad() and width as the column to be constant. This can be a you hard-code (IE, if you know what type of query will always say less than 8 characters) or ideally, first select the maximum length of the table:

    SELECT MAX(LENGTH(request)) + 3  INTO l_max_length FROM my_table WHERE clauses;
    /*Added the three to give a bit of extra space - modify to suit your needs*/
    

    Then when you are out of the field, do something like:

    message:=message || rpad(i.request,l_max_length - LENGTH(i.request));
    

    This will ensure that everything is aligned. Of course, it only works if the email is sent in plain text and that the user is using a font to width fixed to read emails in plain text. Most people do, but do not count on it.
    As before, the other option is to use an HTML table, however HTML emails are not very nice - try to stick with the plaintext if possible! :)

  • Date equality in the select statement

    Equal date in a select statement which gives 0 results table contains records corresponding to it.please suggest what wrong in this query

    1 Select * from EOE_POC. PRODUCT_TEST_REPORT where CREATE_DATE = ' 03-SEPT-13'

    2 - Select * from EOE_POC. PRODUCT_TEST_REPORT where CREATE_DATE > = ' 03-SEPT-13'

    above query (a 2nd) gives 2 records. But I'm planning to check equality is no greater... Please enlighten

    Hello

    Try below

    Select * from EOE_POC. PRODUCT_TEST_REPORT where trunc (CREATE_DATE) = '' 03-SEPT-13;

    Kind regards

    Bobin

  • mixture of column type in the select statement

    Oracle 11g r2.

    tab_test (name varchar2, blob... photo)

    (1) select general use *.

    Stored procedure: open ref_cursor to some * of table_test...

    Coast of java: call.registerOutParameter (1, OracleTypes.CURSOR);  Call.Execute ();

    It works very well.

    (2) enter the name of the column in the select such as

    Stored procedure: open ref_cursor to select name, photo table_test...

    Coast of java: call.registerOutParameter (1, OracleTypes.CURSOR);  Call.Execute ();

    ERROR: java.sql.SQLSyntaxErrorException: ORA-00932: inconsistent data types: expected - got BLOB

    My question, if I specify the column names in the select statement, including the varchar2 and blob, how can I registerOutParameter (1, OracleTypes.CURSOR);?

    Thank you

    Scott

    PS The number of returned columns, in real case schenario, is a little, so I prefer to specify column names.

    Wrong forum. This forum is for questions of sql and pl/sql.

    Enter the question ANSWER and the repost in the JDBC forum

    https://community.oracle.com/community/developer/english/java/database_connectivity/java_database_connectivity _(jdbc)

    When repost you provide the necessary information to help you:

    1. information on the full version for Oracle DB

    2 version of the JDK

    3. the name and version of the JDBC jar file

    4. real code that demonstrates the problem

    You should also review the info re REF CURSOR in the JDBC Developer's Guide

    http://docs.Oracle.com/CD/E16655_01/Java.121/e17657/oraint.htm#i1058743

  • Planning of Oracle EBS 11i - no data found for the region (/ oracle/apps/az/regionMap)

    We do not currently use Oracle planning.
    I'm setting up planning in development server if it will help us.

    After you set a database mapping (which points to the development server itself)

    I have create a selection of games for Receivables Tax Codes and rates.

    Then I extracted to download an extract, no problem.

    I update the selection sets, click the defined filter, it gave me an error page:
    ------
    You have encountered an unexpected error. Please contact the system administrator for assistance.
    Click here for exception details.
    ------
    Click on the 'here', a long java exception stack traces, what should I do to solve this problem:
    ------
    oracle.apps.fnd.framework.OAException: no data found for the region (/ oracle/apps/az/regionMap/TAX_CODE).
    at oracle.apps.fnd.framework.webui.OAWebBeanFactoryImpl.getWebBeanBaseData(OAWebBeanFactoryImpl.java:1705)
    at oracle.apps.fnd.framework.webui.P13NWebUIHelper.addPersonalizationToolEntry(P13NWebUIHelper.java:928)
    at oracle.apps.fnd.framework.webui.P13NWebUIHelper.addPersonalizationToolEntryRecursive(P13NWebUIHelper.java:842)
    at oracle.apps.fnd.framework.webui.P13NWebUIHelper.addPersonalizationToolEntryRecursive(P13NWebUIHelper.java:849)
    at oracle.apps.fnd.framework.webui.P13NWebUIHelper.addPersonalizationToolEntryRecursive(P13NWebUIHelper.java:849)
    at oracle.apps.fnd.framework.webui.P13NWebUIHelper.addPersonalizationToolEntryRecursive(P13NWebUIHelper.java:849)
    at oracle.apps.fnd.framework.webui.P13NWebUIHelper.addPersonalizationToolEntryRecursive(P13NWebUIHelper.java:849)
    at oracle.apps.fnd.framework.webui.P13NWebUIHelper.addPersonalizationToolEntryRecursive(P13NWebUIHelper.java:849)
    at oracle.apps.fnd.framework.webui.P13NWebUIHelper.addPersonalizationToolEntryRecursive(P13NWebUIHelper.java:849)
    at oracle.apps.fnd.framework.webui.P13NWebUIHelper.addPersonalizationToolEntryRecursive(P13NWebUIHelper.java:849)
    at oracle.apps.fnd.framework.webui.P13NWebUIHelper.addPersonzliationToolEntries(P13NWebUIHelper.java:830)
    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1796)
    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:497)
    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:418)
    to _html._OA._jspService(_OA.java:88) oa
    at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
    at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:417)
    at oracle.jsp.JspServlet.doDispatch(JspServlet.java:267)
    at oracle.jsp.JspServlet.internalService(JspServlet.java:186)
    at oracle.jsp.JspServlet.service(JspServlet.java:156)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
    at oracle.jsp.provider.Jsp20RequestDispatcher.forward(Jsp20RequestDispatcher.java:162)
    at oracle.jsp.runtime.OraclePageContext.forward(OraclePageContext.java:187)
    to _html._OA._jspService(_OA.java:98) oa
    at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
    at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:417)
    at oracle.jsp.JspServlet.doDispatch(JspServlet.java:267)
    at oracle.jsp.JspServlet.internalService(JspServlet.java:186)
    at oracle.jsp.JspServlet.service(JspServlet.java:156)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
    at org.apache.jserv.JServConnection.processRequest(JServConnection.java:456)
    at org.apache.jserv.JServConnection.run(JServConnection.java:294)
    at java.lang.Thread.run(Thread.java:534)
    # # 0 in detail

    Exception:
    oracle.adf.mds.MetadataDefException: unable to find the component with an absolute reference = / oracle/apps/az/regionMap/TAX_CODE, XML Path = null. Please check that the reference is valid and the definition of the component on the file system or in the MDS repository.
    at oracle.adf.mds.internal.MetadataManagerBase.findElement(MetadataManagerBase.java:1343)
    at oracle.adf.mds.MElement.findElement(MElement.java:97)
    at oracle.apps.fnd.framework.webui.OAWebBeanFactoryImpl.getJRADWebBeanBaseData(OAWebBeanFactoryImpl.java:2881)
    at oracle.apps.fnd.framework.webui.OAWebBeanFactoryImpl.getWebBeanBaseData(OAWebBeanFactoryImpl.java:1700)
    at oracle.apps.fnd.framework.webui.P13NWebUIHelper.addPersonalizationToolEntry(P13NWebUIHelper.java:928)
    at oracle.apps.fnd.framework.webui.P13NWebUIHelper.addPersonalizationToolEntryRecursive(P13NWebUIHelper.java:842)
    at oracle.apps.fnd.framework.webui.P13NWebUIHelper.addPersonalizationToolEntryRecursive(P13NWebUIHelper.java:849)
    at oracle.apps.fnd.framework.webui.P13NWebUIHelper.addPersonalizationToolEntryRecursive(P13NWebUIHelper.java:849)
    at oracle.apps.fnd.framework.webui.P13NWebUIHelper.addPersonalizationToolEntryRecursive(P13NWebUIHelper.java:849)
    at oracle.apps.fnd.framework.webui.P13NWebUIHelper.addPersonalizationToolEntryRecursive(P13NWebUIHelper.java:849)
    at oracle.apps.fnd.framework.webui.P13NWebUIHelper.addPersonalizationToolEntryRecursive(P13NWebUIHelper.java:849)
    at oracle.apps.fnd.framework.webui.P13NWebUIHelper.addPersonalizationToolEntryRecursive(P13NWebUIHelper.java:849)
    at oracle.apps.fnd.framework.webui.P13NWebUIHelper.addPersonalizationToolEntryRecursive(P13NWebUIHelper.java:849)
    at oracle.apps.fnd.framework.webui.P13NWebUIHelper.addPersonzliationToolEntries(P13NWebUIHelper.java:830)
    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1796)
    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:497)
    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:418)
    to _html._OA._jspService(_OA.java:88) oa
    at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
    at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:417)
    at oracle.jsp.JspServlet.doDispatch(JspServlet.java:267)
    at oracle.jsp.JspServlet.internalService(JspServlet.java:186)
    at oracle.jsp.JspServlet.service(JspServlet.java:156)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
    at oracle.jsp.provider.Jsp20RequestDispatcher.forward(Jsp20RequestDispatcher.java:162)
    at oracle.jsp.runtime.OraclePageContext.forward(OraclePageContext.java:187)
    to _html._OA._jspService(_OA.java:98) oa
    at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
    at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:417)
    at oracle.jsp.JspServlet.doDispatch(JspServlet.java:267)
    at oracle.jsp.JspServlet.internalService(JspServlet.java:186)
    at oracle.jsp.JspServlet.service(JspServlet.java:156)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
    at org.apache.jserv.JServConnection.processRequest(JServConnection.java:456)
    at org.apache.jserv.JServConnection.run(JServConnection.java:294)
    at java.lang.Thread.run(Thread.java:534)


    Exception:
    oracle.adf.mds.MetadataDefException: unable to find the component with an absolute reference = / oracle/apps/az/regionMap/TAX_CODE, XML Path = null. Please check that the reference is valid and the definition of the component on the file system or in the MDS repository.
    at oracle.adf.mds.internal.MetadataManagerBase.findElement(MetadataManagerBase.java:1343)
    at oracle.adf.mds.MElement.findElement(MElement.java:97)
    at oracle.apps.fnd.framework.webui.OAWebBeanFactoryImpl.getJRADWebBeanBaseData(OAWebBeanFactoryImpl.java:2881)
    at oracle.apps.fnd.framework.webui.OAWebBeanFactoryImpl.getWebBeanBaseData(OAWebBeanFactoryImpl.java:1700)
    at oracle.apps.fnd.framework.webui.P13NWebUIHelper.addPersonalizationToolEntry(P13NWebUIHelper.java:928)
    at oracle.apps.fnd.framework.webui.P13NWebUIHelper.addPersonalizationToolEntryRecursive(P13NWebUIHelper.java:842)
    at oracle.apps.fnd.framework.webui.P13NWebUIHelper.addPersonalizationToolEntryRecursive(P13NWebUIHelper.java:849)
    at oracle.apps.fnd.framework.webui.P13NWebUIHelper.addPersonalizationToolEntryRecursive(P13NWebUIHelper.java:849)
    at oracle.apps.fnd.framework.webui.P13NWebUIHelper.addPersonalizationToolEntryRecursive(P13NWebUIHelper.java:849)
    at oracle.apps.fnd.framework.webui.P13NWebUIHelper.addPersonalizationToolEntryRecursive(P13NWebUIHelper.java:849)
    at oracle.apps.fnd.framework.webui.P13NWebUIHelper.addPersonalizationToolEntryRecursive(P13NWebUIHelper.java:849)
    at oracle.apps.fnd.framework.webui.P13NWebUIHelper.addPersonalizationToolEntryRecursive(P13NWebUIHelper.java:849)
    at oracle.apps.fnd.framework.webui.P13NWebUIHelper.addPersonalizationToolEntryRecursive(P13NWebUIHelper.java:849)
    at oracle.apps.fnd.framework.webui.P13NWebUIHelper.addPersonzliationToolEntries(P13NWebUIHelper.java:830)
    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1796)
    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:497)
    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:418)
    to _html._OA._jspService(_OA.java:88) oa
    at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
    at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:417)
    at oracle.jsp.JspServlet.doDispatch(JspServlet.java:267)
    at oracle.jsp.JspServlet.internalService(JspServlet.java:186)
    at oracle.jsp.JspServlet.service(JspServlet.java:156)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
    at oracle.jsp.provider.Jsp20RequestDispatcher.forward(Jsp20RequestDispatcher.java:162)
    at oracle.jsp.runtime.OraclePageContext.forward(OraclePageContext.java:187)
    to _html._OA._jspService(_OA.java:98) oa
    at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
    at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:417)
    at oracle.jsp.JspServlet.doDispatch(JspServlet.java:267)
    at oracle.jsp.JspServlet.internalService(JspServlet.java:186)
    at oracle.jsp.JspServlet.service(JspServlet.java:156)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
    at org.apache.jserv.JServConnection.processRequest(JServConnection.java:456)
    at org.apache.jserv.JServConnection.run(JServConnection.java:294)
    at java.lang.Thread.run(Thread.java:534)

    Please see if (Planning Framework error (no data found for the region) when the filters in selection rule [367684.1 ID]) help.

    Thank you
    Hussein

  • How to ask the user to type in the select statement

    Hello

    Can anyone tell me the syntax of the select statement where I can ask the user to enter the value.

    for example, I try to use belowthing, but it displays error

    Select * from emp where empname =: empname

    SP2-0552: Bind "empname' undeclared variable.


    2. is there a dictionary of data table to see all pl/sql procedures and corresponding code?


    Thank you
    Sri

    Try:

    select * from emp where empname='&empname';
    

    L.

  • Pivot will not get result in the select statement

    This is the version of oracle 11g R2 on windows details 7 OS

    CREATE TABLE OTBOOKINGDETAILS
    (EMPNO VARCHAR2 (10 BYTE),
    DATE OF OTBOOKEDDATE,
    NUMBER (5.0) DAY OF THE WEEK.
    DAYCEILINGHRS VARCHAR2 (10 BYTE));

    Here is the data

    INSERT INTO OTBOOKINGDETAILS VALUES (101 ', 3 MARCH 2013', 1,' 09:00 ');
    INSERT INTO OTBOOKINGDETAILS VALUES (101 ', 3 APRIL 2013', 2' 01:00 ');
    INSERT INTO OTBOOKINGDETAILS VALUES (101 ', 3 MAY 2013', 3,' 01:00 ');
    INSERT INTO OTBOOKINGDETAILS VALUES (101 ', 3 JUNE 2013', 4' 01:00 ');
    INSERT INTO OTBOOKINGDETAILS VALUES (101 ', 3 JULY 2013', 5,' 01:00 ');
    INSERT INTO OTBOOKINGDETAILS VALUES (101 ', 3 AUGUST 2013', 6,' 01:00 ');
    INSERT INTO OTBOOKINGDETAILS VALUES (101 ', 3 SEPTEMBER 2013', 7,' 00:00 ');
    INSERT INTO OTBOOKINGDETAILS VALUES (102 ', 3 MARCH 2013', 1,' 09:00 ');
    INSERT INTO OTBOOKINGDETAILS VALUES (102 ', 3 APRIL 2013', 2' 01:00 ');
    INSERT INTO OTBOOKINGDETAILS VALUES (102 ', 3 MAY 2013', 3,' 01:00 ');
    INSERT INTO OTBOOKINGDETAILS VALUES (102 ', 3 JUNE 2013', 4,' 02:00 ');
    INSERT INTO OTBOOKINGDETAILS VALUES (102 ', 3 JULY 2013', 5,' 01:00 ');
    INSERT INTO OTBOOKINGDETAILS VALUES (102 ', 3 AUGUST 2013', 6,' 04:00 ');
    INSERT INTO OTBOOKINGDETAILS VALUES (102 ', 3 SEPTEMBER 2013', 7' 01:00 ');
    INSERT INTO OTBOOKINGDETAILS VALUES (101 ', 3 OCTOBER 2013', 1,' 00:00 ');
    INSERT INTO OTBOOKINGDETAILS VALUES (101 ', 3 NOVEMBER 2013', 2' 01:00 ');
    INSERT INTO OTBOOKINGDETAILS VALUES (101 ', 3 DECEMBER 2013', 3,' 01:00 ');
    INSERT INTO OTBOOKINGDETAILS VALUES (101 ', 13 MARCH 2013', 4,' 04:45 ');
    INSERT INTO OTBOOKINGDETAILS VALUES (101 ', 14 MARCH 2013', 5,' 01:00 ');
    INSERT INTO OTBOOKINGDETAILS VALUES (101 ', 15 MARCH 2013', 6,' 01:00 ');
    INSERT INTO OTBOOKINGDETAILS VALUES (101 ', 16 MARCH 2013', 7' 01:00 ');

    Here, I want to Dayceiling hours below the output using pivot

    EMPNO OTBOOKEDDATE DAY1_HRS DAY2_HRS DAY3_HRS DAY4_HRS DAY5_HRS DAY6_HRS DAY7_HRS
    101 03/03/2013 09:00 01:00 01:00 01:00 01:00 01:00 00:00
    102 03/03/2013 09:00 01:00 01:00 02:00 01:00 04:00 01:00
    101 03/10/2013 00:00 01:00 01:00 04:45 01:00 01:00 01:00

    ChakravarthyDBA wrote:
    I need to include the pivot query in the select statement

    Can' are you use PIVOT here since you do not know from the start what values OTBOOKEDDATE. So use:

    select  empno,
            otbookeddate - weekday + 1 otbookeddate,
            max(
                case weekday
                  when 1 then dayceilinghrs
                end
               ) day1_hrs,
            max(
                case weekday
                  when 2 then dayceilinghrs
                end
               ) day2_hrs,
            max(
                case weekday
                  when 3 then dayceilinghrs
                end
               ) day3_hrs,
            max(
                case weekday
                  when 4 then dayceilinghrs
                end
               ) day4_hrs,
            max(
                case weekday
                  when 5 then dayceilinghrs
                end
               ) day5_hrs,
            max(
                case weekday
                  when 6 then dayceilinghrs
                end
               ) day6_hrs,
            max(
                case weekday
                  when 7 then dayceilinghrs
                end
               ) day7_hrs
      from  otbookingdetails
      group by empno,
               otbookeddate - weekday + 1
      order by otbookeddate,
               empno
    /
    
    EMPNO      OTBOOKEDDA DAY1_HRS   DAY2_HRS   DAY3_HRS   DAY4_HRS   DAY5_HRS   DAY6_HRS   DAY7_HRS
    ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------
    101        03-03-2013 09:00      01:00      01:00      01:00      01:00      01:00      00:00
    102        03-03-2013 09:00      01:00      01:00      02:00      01:00      04:00      01:00
    101        10-03-2013 00:00      01:00      01:00      04:45      01:00      01:00      01:00
    
    SQL> 
    

    SY.

  • validation for each 1,000 records to be inserted in the select statement

    Hi, I have the following INSERTION in the SELECT statement.
    The SELECT statement (who joined) data fo about 6 crores. I need to insert this data into another table.

    Please suggest me the best way to do it.
    I use the INSERT in the SELECT statement, but I want to use the statement commit for each 1,000 records.

    How can I do this...
    insert into emp_dept_master 
     select e.ename ,d.dname ,e.empno ,e.empno ,e.sal 
       from emp e , dept d
      where e.deptno = d.deptno       ------ how to use commit for every 1000 records .
    Thank you

    Method 4 is the best

    You could combine method 3 and 1 (without dynamic SQL)

    Method 2 is the less optimal solution from the list.

  • passing multiple values from the query in the select statement of the procedure

    I am collecting IDS to select education agreement from the date of rental values and then I would pass the result of the query in the statement select to get the result.
    data type for the contract id is of type varchar and date of rental there is more than one id to contract for most of the time. Help, please. Thank you

    CREATE OR REPLACE PROCEDURE abstract_menu (p_letting   IN     VARCHAR2,
                                               p_results      OUT SYS_REFCURSOR)
    IS
       v_contractId   VARCHAR2 (40);
    
    SELECT lcontid
      INTO v_contractId
      FROM letprop
     WHERE datestat IS NOT NULL AND letting = p_letting AND letstat <> 'R';
    
    
    BEGIN
       OPEN p_results FOR
            SELECT DISTINCT
                      SUBSTR (l.letting, 3, 2)
                   || '-'
                   || SUBSTR (l.letting, 5, 2)
                   || '-'
                   || SUBSTR (l.letting, 1, 2)
                      lettingdate,
                   l.lcontid contractid,
                   SUBSTR (q.cprojnum, 1, 10) projectnumber,
                   DECODE (TRIM (MIN (j.route)), NULL, 'N/A', TRIM (MIN (j.route)))
                      routenumber,
                   L.DATESTAT statusdate,
                   L.LETSTAT lettingstatus,
                   (q.cdescr) jobdescription,
                   INITCAP (q.clocat1 || q.clocat2) LOCATION
              FROM vendor v,
                   vendaddr r,
                   letprop l,
                   planhold p,
                   proposal q,
                   project j,
                   propproj k,
                   bidlet bd
             WHERE     v.vendor = r.vendor
                   AND k.contid = q.contid
                   AND k.pcn = j.pcn
                   AND l.lcontid = k.contid
                   AND p.vendor = v.vendor
                   AND l.letting = p.letting
                   AND l.lcontid IN v_contactid  "**************This is where I would like to pass the contract id from the above select statement***********'"
                   AND l.CALL = p.CALL
                   AND r.addrnum = p.billto
                   AND bd.letting = l.letting
          GROUP BY q.cdescr,
                   q.clocat1,
                   q.clocat2,
                   bd.letting,
                   l.letting,
                   l.lcontid,
                   q.cprojnum,
                   L.LETSTAT,
                   L.DATESTAT
          ORDER BY lettingdate;
    
    end;

    user9196150 wrote:
    AND l.lcontid IN v_contactid ' * this is where I would like to pass the id of the select statement above contract * ""»

    CREATE OR REPLACE PROCEDURE abstract_menu (p_letting   IN     VARCHAR2,
                                               p_results      OUT SYS_REFCURSOR)
    IS
    BEGIN
       OPEN p_results FOR
            SELECT DISTINCT
                      SUBSTR (l.letting, 3, 2)
                   || '-'
                   || SUBSTR (l.letting, 5, 2)
                   || '-'
                   || SUBSTR (l.letting, 1, 2)
                      lettingdate,
                   l.lcontid contractid,
                   SUBSTR (q.cprojnum, 1, 10) projectnumber,
                   DECODE (TRIM (MIN (j.route)), NULL, 'N/A', TRIM (MIN (j.route)))
                      routenumber,
                   L.DATESTAT statusdate,
                   L.LETSTAT lettingstatus,
                   (q.cdescr) jobdescription,
                   INITCAP (q.clocat1 || q.clocat2) LOCATION
              FROM vendor v,
                   vendaddr r,
                   letprop l,
                   planhold p,
                   proposal q,
                   project j,
                   propproj k,
                   bidlet bd
             WHERE     v.vendor = r.vendor
                   AND k.contid = q.contid
                   AND k.pcn = j.pcn
                   AND l.lcontid = k.contid
                   AND p.vendor = v.vendor
                   AND l.letting = p.letting
                   AND l.lcontid IN (
                                     SELECT  ll.lcontid
                                       FROM  letprop ll
                                       WHERE ll.datestat IS NOT NULL AND ll.letting = p_letting AND ll.letstat  'R'
                                    )
                   AND l.CALL = p.CALL
                   AND r.addrnum = p.billto
                   AND bd.letting = l.letting
          GROUP BY q.cdescr,
                   q.clocat1,
                   q.clocat2,
                   bd.letting,
                   l.letting,
                   l.lcontid,
                   q.cprojnum,
                   L.LETSTAT,
                   L.DATESTAT
          ORDER BY lettingdate;
    
    end;
    /
    

    SY.

  • to find the number of records retrieved in the select statement in the cursor

    Hi all
    with the cursor, I'm selecting select statement together and writing in the .txt file.
    his worksheet, but it should not open the file, if the cursor returns nothing.
    How to find the number of records returned by the select statement in the cursor.
    pls help me.

    Thank you...

    Don't understand what you're trying to say, but maybe it's...

    DECLARE
       vCounter NUMBER;
       -- Other variables...
    BEGIN
       vCounter:=0;
       FOR .. IN cursor LOOP
        IF vCounter=0 THEN
          -- Here open file...
          -- Here write one time data...
        END IF;
        -- Here write cursor data...
        vCounter:=1;
       END LOOP;
    END;
    

    -Clément

  • Why I can't use the procedure in the select statement

    Why I can't use the procedure in the select statement

    And you may not usa a SQL function if it has out parameters

    SQL> create function myfun(p1 in out number) return number is
      2  begin
      3  p1:=1;
      4  return 2;
      5  end;
      6  /
    
    SQL> select myfun(5) from dual;
    select myfun(5) from dual
           *
    ERRORE alla riga 1:
    ORA-06572: Function MYFUN has out arguments
    

    In fact, the problem is that an output parameter is passed 'ref' and not 'val '...

    Max

  • Update using a function in the select statement

    Hello

    Is it possible to do the follwing.

    I tabele and a custom function, the custome service will update the column (amount) of the table based on the value of going through the function of the select statement.

    SELECT id, stock, where an id = get_update (id);

    Now


    Get_update function will return the same id I'm passing and update the column amount to a value in the
    table a.

    When I run the satament selection I have the updated data in the column amount in my first executtion, but if execute the same statement, again, I see the changes reflected. is it possible to get data updates to the first performance himself.

    the function is of type PRAGMA AUTONOMOUS_TRANSACTION

    Concerning

    Indeed a strange requirement and probably not the way to go in a production environment. But anyway is a way to achieve your goal

    SQL> create table a
    as
       select   12 id, 500 amount from dual
       union all
       select   13 id, 600 amount from dual
    /
    Table created.
    
    SQL> create or replace type a_typ as object (id number, amount number)
    /
    Type created.
    
    SQL> create or replace function get_id (pid number)
       return a_typ
    is
       pragma autonomous_transaction;
       l_a_typ   a_typ := a_typ (null, null);
    begin
          update   a
             set   amount = 800
           where   id = pid
       returning   id, amount      into   l_a_typ.id, l_a_typ.amount;
    
       commit;
    
       return l_a_typ;
    end get_id;
    /
    Function created.
    
    SQL> select   id, d.a_typ.amount amount
      from   a, (select get_id (13) a_typ from dual) d
     where   id = d.a_typ.id
    /
            ID     AMOUNT
    ---------- ----------
            13        800
    1 row selected.
    
  • No data found for the region

    Hello

    I'm kinda new to OA framework and to try to run the Test Page form Jdeveloper himself. I do a query of xxPersonMainPG and press the 'GO' button update the record, I navigate to managePersonPG. Here on this page when I update the record and press the button "Commit Data", I got the following error message:

    Details of the exception.

    oracle.apps.fnd.framework.OAException: no data found for the region (/ oracle/apps/ak/xxPerson/webui/xxPersonMainPG).
    at oracle.apps.fnd.framework.webui.JRAD2AKMapper.getRootMElement(JRAD2AKMapper.java:527)
    at oracle.apps.fnd.framework.webui.OAWebBeanFactoryImpl.getWebBeanTypeDataFromJRAD(OAWebBeanFactoryImpl.java:3718)
    at oracle.apps.fnd.framework.webui.OAWebBeanFactoryImpl.getRootApplicationModuleClass(OAWebBeanFactoryImpl.java:3451)
    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:999)
    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:502)
    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:423)
    in OA. jspService(OA.jsp:40)
    at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
    at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
    at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
    at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
    at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
    at com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:209)
    at com.evermind.server.http.GetParametersRequestDispatcher.forward(GetParametersRequestDispatcher.java:189)
    at com.evermind.server.http.EvermindPageContext.forward(EvermindPageContext.java:199)
    in OA. jspService(OA.jsp:45)
    at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
    at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
    at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
    at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
    at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
    at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
    to EDU.oswego.cs.dl.util.concurrent.PooledExecutor$ Worker.run (PooledExecutor.java:803)
    at java.lang.Thread.run(Thread.java:534)
    # # 0 in detail

    Exception:
    oracle.adf.mds.MetadataDefException: unable to find the component with an absolute reference =

    / Oracle/Apps/AK/xxPerson/WebUI/xxPersonMainPG, XML Path =

    C:\JDevloper\jdevhome\jdev\myclasses\JRADXML; C:\JDevloper\jdevhome\jdev\myprojects; C:\JDevloper\jdevbin\jdev\oamdsxml\fwk.

    Please check that the reference is valid and the definition of the component exists on the file system or in the MDS

    Repository.
    at oracle.adf.mds.internal.MetadataManagerBase.findElement(MetadataManagerBase.java:1350)
    at oracle.adf.mds.MElement.findElement(MElement.java:97)
    at oracle.apps.fnd.framework.webui.JRAD2AKMapper.getRootMElement(JRAD2AKMapper.java:501)
    at oracle.apps.fnd.framework.webui.OAWebBeanFactoryImpl.getWebBeanTypeDataFromJRAD(OAWebBeanFactoryImpl.java:3718)
    at oracle.apps.fnd.framework.webui.OAWebBeanFactoryImpl.getRootApplicationModuleClass(OAWebBeanFactoryImpl.java:3451)
    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:999)
    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:502)
    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:423)
    in OA. jspService(OA.jsp:40)
    at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
    at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
    at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
    at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
    at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
    at com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:209)
    at com.evermind.server.http.GetParametersRequestDispatcher.forward(GetParametersRequestDispatcher.java:189)
    at com.evermind.server.http.EvermindPageContext.forward(EvermindPageContext.java:199)
    in OA. jspService(OA.jsp:45)
    at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
    at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
    at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
    at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
    at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
    at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
    to EDU.oswego.cs.dl.util.concurrent.PooledExecutor$ Worker.run (PooledExecutor.java:803)
    at java.lang.Thread.run(Thread.java:534)


    Exception:
    oracle.adf.mds.MetadataDefException: unable to find the component with an absolute reference =

    / Oracle/Apps/AK/xxPerson/WebUI/xxPersonMainPG, XML Path =

    C:\JDevloper\jdevhome\jdev\myclasses\JRADXML; C:\JDevloper\jdevhome\jdev\myprojects; C:\JDevloper\jdevbin\jdev\oamdsxml\fwk.

    Please check that the reference is valid and the definition of the component exists on the file system or in the MDS

    Repository.
    at oracle.adf.mds.internal.MetadataManagerBase.findElement(MetadataManagerBase.java:1350)
    at oracle.adf.mds.MElement.findElement(MElement.java:97)
    at oracle.apps.fnd.framework.webui.JRAD2AKMapper.getRootMElement(JRAD2AKMapper.java:501)
    at oracle.apps.fnd.framework.webui.OAWebBeanFactoryImpl.getWebBeanTypeDataFromJRAD(OAWebBeanFactoryImpl.java:3718)
    at oracle.apps.fnd.framework.webui.OAWebBeanFactoryImpl.getRootApplicationModuleClass(OAWebBeanFactoryImpl.java:3451)
    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:999)
    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:502)
    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:423)
    in OA. jspService(OA.jsp:40)
    at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
    at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
    at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
    at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
    at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
    at com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:209)
    at com.evermind.server.http.GetParametersRequestDispatcher.forward(GetParametersRequestDispatcher.java:189)
    at com.evermind.server.http.EvermindPageContext.forward(EvermindPageContext.java:199)
    in OA. jspService(OA.jsp:45)
    at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
    at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
    at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
    at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
    at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
    at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
    to EDU.oswego.cs.dl.util.concurrent.PooledExecutor$ Worker.run (PooledExecutor.java:803)
    at java.lang.Thread.run(Thread.java:534)

    Could someone please help me out what why this error is coming?

    Please let me know if any installation do I have to do. Also let me know if any of the steps that I missed.

    Thank you
    Ravi

    Check this xxt.oracle.apps.ak.xxperson. * webui.webui * .managePersonCO, twice "webui", on the Page or somewhere, you gave this bad reference. It should be "xxt.oracle.apps.ak.xxperson.webui.managePersonCO".

    Thank you

  • uniol all in the select statement

    Hi I have a situation where I have to return the value based on the if statement, is it possible to put union all in the select statement

    My use case is

    IN the column State

    If column01 > 0 to condtion 't'

    IF column02 > 0 that the condition of 'Y '.

    Condition IF COLUMN03 > 0 THAN 'w '.

    If COLUMN04 > 0 that the condition of "Z".

    Select 't'

    TableName

    where column01 > 0

    Union of all the

    Select "y".

    TableName

    where column02 > 0

    Union of all the

    Select 'W '.

    TABLENAME

    WHERE COLUMN03 > 0

    I have what it takes to show value as it

    EmpName, condition, empno

    Jerry, T, 0158754585

    TOM, Y, 0054789568

    Am in oracle database 11 g 2

    Yes you can put all THE UNION here

    Select empname, 't' State, empno from tablename where column01 > 0

    Union of all the

    Select empname, 't' State, empno from tablename where column02 > 0

    Union of all the

    Select empname, condition of "W", empno FROM tablename WHERE COLUMN03 > 0

    Union of all the

    Select empname, condition of "Z", empno FROM tablename WHERE COLUMN04 > 0

    and if you are looking for how to remove duplicates because your line might have satisfied all the conditions and my happen 4 times in your result set, you just need to give them an order and filter it.

    For example, you want this

    If column01 > 0 to condtion 't'

    ELSE IF column02 > 0 that the condition of 'Y '.

    Another condition of THAN > 0 IF COLUMN03 'w '.

    otherwise if COLUMN04 > 0 that the condition of "Z".

    Select empname, condition, empno, in

    (

    Select a.*, row_number() over (partition by empno arrested by myorder) rn

    Of

    (

    Select empname, 't' State, empno, 1 myorder tablename where column01 > 0

    Union of all the

    Select empname, 't' State, empno, 2 myorder tablename where column02 > 0

    Union of all the

    Select empname, condition of "W", empno 3 myorder FROM tablename WHERE COLUMN03 > 0

    Union of all the

    Select empname, empno, condition of 'Z', 4 myorder FROM tablename WHERE COLUMN04 > 0

    ) a

    ) where rn = 1

  • function() nested in the select statement

    Oracle 11g. Try to nest a function within the select statement.  Goal: get the average customer rating for each of the qualified user.

    Select user_name, f_get_avg_cust_rating() "Notation.

    of u, OTHER_TABLES o TAB_USER

    where u.id = o.id and another condition matched;

    How Oracle would deal with the sql.  Is it

    (1) first of all display records based on the where clause, then call the f_get_avg_cust_rating() for each of the selected records OR

    (2) for the analysis in tables, the f_get_avg_cust_rating() will be called for each record met?

    Thank you

    Scott

    Words of Frank, I created two functions with dbms_output and used a function in where clause in select another function. See the bottom of the unit tests. Everyone says, where first clause then select...

    -Where function clause

    SQL > CREATE or REPLACE FUNCTION ret_empno

    2 RETURN NUMBER

    3 AS

    4 BEGIN

    5 DBMS_OUTPUT. Put_line (' where Clause Function');

    6 RETURN 7839;

    7 END;

    8.

    The function is created.

    -Select the function

    SQL > CREATE or REPLACE FUNCTION ret_1

    2 RETURN NUMBER

    3 AS

    4 BEGIN

    5 DBMS_OUTPUT. Put_line ('Select function');

    6 RETURN 1;

    7 END;

    8.

    The function is created.

    SQL > SELECT empno, ename,ret_1

    2 FROM emp

    3. WHERE empno = ret_empno;

    EMPNO, ENAME RET_1

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

    7839 KING 1

    Where the function Clause

    Select the function

Maybe you are looking for

  • Compaq Presario CQ61, unable to boot the laptop

    Compaq Presario CQ61 running Windows 7 Home Premium (build 7601) bought about 4 years ago. Computer failed to restart after a period of sleep.  I suspect that it doesn't have an automatic restart after automatic installation of an update - it's only

  • Qosmio X 500-reset of password supervisor HD

    Hello for some reason that I can't not find my supervisor password more and 3 attempts the laptop turns off and you can start all over again. I can set the HDD2 to HDD1 user password, so I am able to start windows, but I would like to remove all pass

  • Problem of single pass,

    Can someone help me please? My Simple Pass stops abruptly on the work. Fingerprint sensor is no longer flashes when I logged on Windows and whenever I clicked register user fingerprints, fingerprint reader is no longer flashes. More when I open the w

  • Pavilion dm4 1006tu: SSD installation on dm4 1006tu

    HelloI want to install the SSD drive on my laptop (pavilion dm4 1006 YOU.)Before installing, I want to confirm by experts which makes my system configuration supports the SSDS?I heard that SSDS have backward compatibility with legacy systems.And my H

  • Question on AnimatedGIFField and affecting

    Hi all Okay, I spent the greater part of the day scouring the forums and other sites trying to find a way very easy to display an AnimatedGIFField while my app gets your location and communicates with the Web server. Everything I've seen so far seems