Date function not returning any rows

I am trying to pull back rows for data of people who were born in the 90s
     a.birthday >= to_date('01/01/90','dd/mm/yy')
     and     
          a.birthday <= to_date('31/12/90','dd/mm/yy')
I know that there is definately users born in the 90s in my database but it returns 0 rows with the above ouptut Date format is like "05-FEB-93", have tried using dd/mon/yy but that gives an error

user8652681 wrote:
I am trying to pull back rows for data of people who were born in the 90s
     a.birthday >= to_date('01/01/90','dd/mm/yy')
     and     
          a.birthday <= to_date('31/12/90','dd/mm/yy')
I know that there is definately users born in the 90s in my database but it returns 0 rows with the above ouptut Date format is like "05-FEB-93", have tried using dd/mon/yy but that gives an errorFirst off to_date('01/01/90','dd/mm/yy') is Jan 1, 2090. You need to use a four digit year.
Secondly a.birthday >= to_date('01/01/1990','dd/mm/yyyy') and a.birthday <= to_date('31/12/1990','dd/mm/yyyy')
is not everyone born in the 90's, it's everyone born in 1990. If you want everyone born in the 90's you need:
a.birthday between to_date('01/01/1990','dd/mm/yyyy') and to_date('31/12/1999 23:59:59','dd/mm/yyyy hh24:mi:ss')I realize your birthdays are most likely trunc'ed so the time portion probably isn't necessary but I included it just to be safe.
Edited by: kendenny on Jul 22, 2009 6:13 AM

Similar Messages

  • Function not returning any rows

    If I run this code with a standard SQL statement it will return (1) row - which is correct. But when I try to use a function it is not returning any records. Could someone point what I'm doing wrong?
    Also, if a use BindByName if get Oracle error: ORA-06550: line 1, column 50: PLS-00103: Encountered the symbol ">". If I comment out BindByName I will not get this error . Thanks!
    C# code:
    string domainuser = 'brockj';
    string ConnectString = ConfigurationSettings.AppSettings["ConnectString"];
    OracleConnection dbconn = new OracleConnection(ConnectString);
    OracleCommand cmd = new OracleCommand("access_admin",dbconn);
    cmd.CommandType = CommandType.StoredProcedure;
    //cmd.BindByName = true;
    OracleParameter p_username = new OracleParameter();
    OracleParameter p_retval = new OracleParameter();
    p_username.OracleDbType = OracleDbType.Varchar2;
    p_retval.OracleDbType = OracleDbType.Int16;
    p_username.Direction = ParameterDirection.Input;
    p_retval.Direction = ParameterDirection.ReturnValue;
    p_username.Value = domainuser;
    cmd.Parameters.Add(p_username);
    cmd.Parameters.Add(p_retval);
    dbconn.Open();
    cmd.ExecuteScalar();
    lblResponse.Text = p_retval.Value.ToString(); -- prints '0', should print '3'
    ********FUNCTION************
    Function access_admin
    p_username IN varchar2
    RETURN number
    IS
    l_accesscode users.access_admin%TYPE; -- number(1)
    cursor c1 IS
         SELECT access_admin
         FROM users
         WHERE username = p_username
         AND active=1
         AND rownum=1;
    BEGIN
    open c1;
    fetch c1 into l_accesscode;
    if c1%NOTFOUND then
         l_accesscode := 0;
    end if;
    close c1;
    RETURN l_accesscode;
    END access_admin;

    Turn the function call into a standard SQL statement:
    SELECT access_admin FROM dual;
    Here's how you use BindByName:
    adapter = new OracleDataAdapter();
    adapter.SelectCommand = new OracleCommand("SELECT * FROM emp WHERE sal >= :SAL OR empno = :EMPNO", conn);
    adapter.SelectCommand.BindByName = true;
    adapter.SelectCommand.Parameters.Add(new OracleParameter("EMPNO", OracleDbType.Int32, 0));
    adapter.SelectCommand.Parameters["EMPNO"].Value = 7788;
    adapter.SelectCommand.Parameters.Add(new OracleParameter("SAL", OracleDbType.Int32, 0));
    adapter.SelectCommand.Parameters["SAL"].Value = 2000;
    -- Tom

  • XMLTABLE function not returning any values if xml has attribute "xmlns"

    Hi,
    XMLTABLE function not returning any values if xml has attribute "xmlns". Is there way to get the values if xml has attribute as "xmlns".
    create table xmltest (id number(2), xml xmltype);
    insert into xmltest values(1,
    '<?xml version="1.0"?>
    <emps>
    <emp empno="1" deptno="10" ename="John" salary="21000"/>
    <emp empno="2" deptno="10" ename="Jack" salary="310000"/>
    <emp empno="3" deptno="20" ename="Jill" salary="100001"/>
    </emps>');
    insert into xmltest values(2,
    '<?xml version="1.0"?>
    <emps xmlns="http://emp.com">
    <emp empno="1" deptno="10" ename="John" salary="21000"/>
    <emp empno="2" deptno="10" ename="Jack" salary="310000"/>
    <emp empno="3" deptno="20" ename="Jill" salary="100001"/>
    </emps>');
    commit;
    SELECT a.*
    FROM xmltest,
    XMLTABLE (
    'for $i in /emps/emp
    return $i'
    PASSING xml
    COLUMNS empno NUMBER (2) PATH '@empno',
    deptno NUMBER (3) PATH '@deptno',
    ename VARCHAR2 (10) PATH '@ename',
    salary NUMBER (10) PATH '@salary') a
    WHERE id = 1;
    The above query returning results but below query is not returning any results because of xmlns attribute.
    SELECT a.*
    FROM xmltest,
    XMLTABLE (
    'for $i in /emps/emp
    return $i'
    PASSING xml
    COLUMNS empno NUMBER (2) PATH '@empno',
    deptno NUMBER (3) PATH '@deptno',
    ename VARCHAR2 (10) PATH '@ename',
    salary NUMBER (10) PATH '@salary') a
    WHERE id = 1;
    how to get rid out of this problem.
    Thanks,
    -Mani

    Added below one in xmltable, its working now.
    XmlNamespaces(DEFAULT 'http://emp.com')

  • How to Create a record if vo.executequery does not return any rows

    I would like to update a single record on adf form. However if the record does not exist would like to create a row and save it in the table.
    The user does not want to add a "create" button on the screen. Hence would need to add the create code if vo.execute does not return any rows...
    How to add this and where to add?

    you can have a TF router for for exists and does not exist and based on that execute transient VO and other VO.
    Add a method call activity like below to create a row in transient VO
    public Row createRow()
    ViewObjectImpl tVO = (ViewObjectImpl)getTVO();
    tVO.executeEmptyRowSet();
    Row newRow = tVO.createRow();
    tVO.setCurrentRow(newRow);
    tVO.insertRow(newRow);
    return newRow;
    }

  • Query not returning any rows?

    hi experts,
    My query running long but not returning any result. i have data , no locks on the tables.
    i have bigger ( hardware ) database on different server , where I can get results with same query.
    Can you tell me what are the DB settings i have to look at to resolve this issue?
    ( any sql query that can monitor these parameters ?)
    (the tabels involved in this query has 33milliions, 2millions, 7 milllions )
    Thanks ..
    Edited by: 642877 on Sep 21, 2011 6:46 PM

    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    PL/SQL Release 11.2.0.2.0 - Production
    "CORE     11.2.0.2.0     Production"
    TNS for Solaris: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - Production
    ==========================================================
    Plan hash value: 3185710999
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | Pstart| Pstop |
    | 0 | SELECT STATEMENT | | 3 | 423 | 24592 (2)| 00:05:45 | | |
    | 1 | HASH GROUP BY | | 3 | 423 | 24592 (2)| 00:05:45 | | |
    | 2 | NESTED LOOPS | | | | | | | |
    | 3 | NESTED LOOPS | | 3 | 423 | 24591 (2)| 00:05:45 | | |
    | 4 | NESTED LOOPS | | 3 | 345 | 24585 (2)| 00:05:45 | | |
    | 5 | NESTED LOOPS | | 1 | 84 | 21916 (2)| 00:05:07 | | |
    | 6 | NESTED LOOPS | | 1 | 67 | 21915 (2)| 00:05:07 | | |
    | 7 | PARTITION LIST ALL | | 2 | 60 | 21913 (2)| 00:05:07 | 1 | 11 |
    |* 8 | TABLE ACCESS FULL | ART_CRDT_ACCT_FACT | 2 | 60 | 21913 (2)| 00:05:07 | 1 | 11 |
    |* 9 | TABLE ACCESS BY INDEX ROWID| ART_PRTFOL_GRP_DIM | 1 | 37 | 1 (0)| 00:00:01 | | |
    |* 10 | INDEX UNIQUE SCAN | ART_PRTFOL_GRP_DIM_INDEX1 | 1 | | 0 (0)| 00:00:01 | | |
    | 11 | TABLE ACCESS BY INDEX ROWID | W_MONTH_D | 1 | 17 | 1 (0)| 00:00:01 | | |
    |* 12 | INDEX UNIQUE SCAN | UQ_W_MONTH_D | 1 | | 0 (0)| 00:00:01 | | |
    | 13 | PARTITION LIST ITERATOR | | 3 | 93 | 2669 (2)| 00:00:38 | KEY | KEY |
    |* 14 | TABLE ACCESS FULL | ACCT_CLTRL_RLTNP | 3 | 93 | 2669 (2)| 00:00:38 | KEY | KEY |
    |* 15 | INDEX UNIQUE SCAN | UQ_ART_CLTRL_DIM | 1 | | 1 (0)| 00:00:01 | | |
    | 16 | TABLE ACCESS BY INDEX ROWID | CLTRL_DIM | 1 | 26 | 2 (0)| 00:00:01 | | |
    -------------------------------------------------------------------------------------------------------------------------------

  • Table-Valued Function not returning any results

    ALTER FUNCTION [dbo].[fGetVendorInfo]
    @VendorAddr char(30),
    @RemitAddr char(100),
    @PmntAddr char(100)
    RETURNS
    @VendorInfo TABLE
    vengroup char(25),
    vendnum char(9),
    remit char(10),
    payment char(10)
    AS
    BEGIN
    insert into @VendorInfo (vengroup,vendnum)
    select ks183, ks178
    from hsi.keysetdata115
    where ks184 like ltrim(@VendorAddr) + '%'
    update @VendorInfo
    set remit = r.remit
    from
    @VendorInfo ven
    INNER JOIN
    (Select ksd.ks188 as remit, ksd.ks183 as vengroup, ksd.ks178 as vendnum
    from hsi.keysetdata117 ksd
    inner join @VendorInfo ven
    on ven.vengroup = ksd.ks183 and ven.vendnum = ksd.ks178
    where ksd.ks192 like ltrim(@RemitAddr) + '%'
    and ks189 = 'R') r
    on ven.vengroup = r.vengroup and ven.vendnum = r.vendnum
    update @VendorInfo
    set payment = p.payment
    from
    @VendorInfo ven
    INNER JOIN
    (Select ksd.ks188 as payment, ksd.ks183 as vengroup, ksd.ks178 as vendnum
    from hsi.keysetdata117 ksd
    inner join @VendorInfo ven
    on ven.vengroup = ksd.ks183 and ven.vendnum = ksd.ks178
    where ksd.ks192 like ltrim(@PmntAddr) + '%'
    and ks189 = 'P') p
    on ven.vengroup = p.vengroup and ven.vendnum = p.vendnum
    RETURN
    END
    GO
    Hi all,
    I'm having an issue where my Table-Valued Function is not returning any results.
    When I break it out into a select statement (creating a table, and replacing the passed in parameters with the actual values) it works fine, but with passing in the same exact values (copy and pasted them) it just retuns an empty table.
    The odd thing is I could have SWORN this worked on Friday, but not 100% sure.
    The attached code is my function.
    Here is how I'm calling it:
    SELECT * from dbo.fGetVendorInfo('AUDIO DIGEST', '123 SESAME ST', 'TOP OF OAK MOUNTAIN')
    I tried removing the "+ '%'" and passing it in, but it doesn't work.
    Like I said if I break it out and run it as T-SQL, it works just fine.
    Any assistance would be appreciated.

    Why did you use a proprietary user function instead of a VIEW?  I know the answer is that your mindset does not use sets. You want procedural code. In fact, I see you use an “f-” prefix to mimic the old FORTRAN II convention for in-line functions! 
    Did you know that the old Sybase UPDATE.. FROM.. syntax does not work? It gives the wrong answers! Google it. 
    Your data element names make no sense. What is “KSD.ks188”?? Well, it is a “payment_<something>”, “KSD.ks183” is “vendor_group” and “KSD.ks178” is “vendor_nbr” in your magical world where names mean different things from table to table! 
    An SQL programmer might have a VIEW with the information, something like:
    CREATE VIEW Vendor_Addresses
    AS
    SELECT vendor_group, vendor_nbr, vendor_addr, remit_addr, pmnt_addr
      FROM ..
     WHERE ..;
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • Function not returning database rows properly in non-database item

    Hi,
    I have 3 database items that I'd like to concatenate into one field and display it in a non-database item. I have setup two different methods to do this for testing purposes. First, I created three separate database items (SECTION, ROW, & SEAT_NUM) and a non-database item (SEAT). I created a formula (in SEAT) to do the concatenation and this way works fine. For my second method, I created a function where I selected the 3 fields and performed a concatenation into a single value to be returned in a seperate non-database item (SEAT_TEST).
    Here's my function:
    FUNCTION SeatLocation(p_id IN event.id%TYPE)
    RETURN VARCHAR2 IS
    CURSOR a IS
    (SELECT ltrim(rtrim(event.section,' '),' ')||' '||
    ltrim(rtrim(event.row,' '),' ')||' '||
    ltrim(rtrim(event.seat_num,' '),' ') seat
    FROM event
    WHERE event.id = p_id);
    BEGIN
    FOR rec IN a LOOP
    IF rec.seat IS NOT NULL THEN
    RETURN rec.seat;
    ELSE
    RETURN ' ';
    END IF;
    END LOOP;
    END SeatLocation;
    And I'm calling it in a POST_QUERY trigger with the following: :event.seat_test := SeatLocation(:event.id);
    I put both non-database items side-by-side, run the form, and the first method works fine. I doesn't quite work for the function to display in SEAT_TEST. For my program, an ID can have multiple seat locations and I'd like to display all those seats as I scroll through the form (for a given ID). What the function is returning is only the first records seat location even though there are two more locations (from the remaining two records) that need to be displayed, but are not. It works fine for the formula method. Is there a work around this within my function code and/or the SEAT_TEST item? I'd like to keep my function instead because I could use the code elsewhere. I thought that since there is more than one record retrieved for a particular ID, the for loop would return one value each loop iteration and display the different value seat locations as I scroll/arrow down through the form. I didn't know if you had to call the POST-QUERY trigger multiple times for the number or records you retrieve in the cursor. I hope this makes sense.
    Any advice would be greatly appreciated.
    Thank you,
    Eric

    Even though your function is written to loop through multiple records, as soon as it hits the first one inside the FOR loop, it returns that value. The Return command is an exit, so the function is done, and you cannot expect it to magically run a second time just because the cursor found more than one row.
    You need to pass the function all the parameters to form a unique key into the row you are looking up. ID is not unique.

  • Toplink generate the SQL statement correctly but it does not return any row

    Hi
    I faced an strange problem when using Toplink as JPA provider. Following snippet shows how I create and execute a query using Toplink JPA:
    q = em.createQuery("SELECT B FROM Branch B WHERE B.street LIKE :street");
    q.setParameter("street", "'%a%'");
       List<Branch> l = q.getResultList();
      System.out.println("List Size: " + l.size());The SQL statement resulted by this query is as follow (according to the generated log file)
    SELECT ID, STREET FROM BRANCH WHERE (STREET LIKE CAST (? AS VARCHAR(32672) ))
      bind => [%a%]Problem is that List size is always 0, independent of what I provide as parameter. I tried and executed the generated SQL statement in the SQL manager and I got some tens of record as the result. The SQL statement i tested in the SQL manager is like:
    SELECT ID, STREET FROM BRANCH WHERE (STREET LIKE CAST ('%a%' AS VARCHAR(32672) ))Can someone please let me know what I am missing and how I can fix this problem?
    Thanks.

    Hi,
    Thank you for reply.
    All data are stored in lower case so, the case sensitivity is not a problem. I am wondering how the generated query works fine when I execute it in the sql manager but it return no result when it is executed by the JPA.
    Thanks for looking into my problem.

  • Why does my function not return anything when I create as a schema object

    I have user ABC who owns several tables some of which have foreign key constraints.
    I have user XYZ that has been granted access to all tables owned by user ABC.
    When I create a function as user XYZ using following I get no return when I issue:
    select XYZ.ztm_tables_depended_on('ABC', 'A_TABLE_OWNED_BY_ABC') from dual :
    Please see after function definition.
    CREATE OR REPLACE FUNCTION ZTM_TABLES_DEPENDED_ON(p_Owner VARCHAR2, p_Table_Name VARCHAR2) RETURN VARCHAR2 IS
      CURSOR C1 IS
      SELECT OWNER, CONSTRAINT_NAME, R_OWNER, R_CONSTRAINT_NAME
      FROM   ALL_CONSTRAINTS
      WHERE  OWNER           = p_Owner
      AND    TABLE_NAME      = p_Table_Name
      AND    CONSTRAINT_TYPE = 'R'
      ORDER  BY OWNER, CONSTRAINT_NAME, R_OWNER, R_CONSTRAINT_NAME;
      v_Referenced_Owner       VARCHAR2(31);
      v_Ret_Val                VARCHAR2(4000);
      FUNCTION CONSTRAINT_TABLE_NAME(p_Owner VARCHAR2, p_Constraint_Name VARCHAR2) RETURN VARCHAR2 IS
        CURSOR C1 IS
        SELECT TABLE_NAME
        FROM   ALL_CONSTRAINTS
        WHERE  OWNER           = p_Owner
        AND    CONSTRAINT_NAME = p_Constraint_Name;
        v_Ret_Val ALL_CONSTRAINTS.TABLE_NAME%TYPE;
      BEGIN
        OPEN  C1;
        FETCH C1 INTO v_Ret_Val;
        CLOSE C1;
        RETURN v_Ret_Val;
      END;
    BEGIN
      FOR R IN C1 LOOP
        IF (R.OWNER <> R.R_OWNER) THEN v_Referenced_Owner := R.R_OWNER || '.';
        ELSE                           v_Referenced_Owner := NULL;
        END IF;
        v_Ret_Val := v_Ret_Val || ', ' || v_Referenced_Owner || CONSTRAINT_TABLE_NAME (R.R_OWNER, R.R_CONSTRAINT_NAME);
      END LOOP;
      RETURN LTRIM(v_Ret_Val, ', ');
    END;
    But, if I embed the function within an anonymous block as follows, I get results:
    DECLARE
      CURSOR C1 IS
      select owner, table_name
      FROM   all_tables where owner = 'ABC';
      FUNCTION ZTM_TABLES_DEPENDED_ON(p_Owner VARCHAR2, p_Table_Name VARCHAR2) RETURN VARCHAR2 IS
        CURSOR C1 IS
        SELECT OWNER, CONSTRAINT_NAME, R_OWNER, R_CONSTRAINT_NAME
        FROM   ALL_CONSTRAINTS
        WHERE  OWNER           = p_Owner
        AND    TABLE_NAME      = p_Table_Name
        AND    CONSTRAINT_TYPE = 'R'
        ORDER  BY OWNER, CONSTRAINT_NAME, R_OWNER, R_CONSTRAINT_NAME;
        v_Referenced_Owner       VARCHAR2(31);
        v_Ret_Val                VARCHAR2(4000);
        FUNCTION CONSTRAINT_TABLE_NAME(p_Owner VARCHAR2, p_Constraint_Name VARCHAR2) RETURN VARCHAR2 IS
          CURSOR C1 IS
          SELECT TABLE_NAME
          FROM   ALL_CONSTRAINTS
          WHERE  OWNER           = p_Owner
          AND    CONSTRAINT_NAME = p_Constraint_Name;
          v_Ret_Val ALL_CONSTRAINTS.TABLE_NAME%TYPE;
        BEGIN
          OPEN  C1;
          FETCH C1 INTO v_Ret_Val;
          CLOSE C1;
          RETURN v_Ret_Val;
        END;
      BEGIN
        FOR R IN C1 LOOP
          IF (R.OWNER <> R.R_OWNER) THEN v_Referenced_Owner := R.R_OWNER || '.';
          ELSE                           v_Referenced_Owner := NULL;
          END IF;
          v_Ret_Val := v_Ret_Val || ', ' || v_Referenced_Owner || CONSTRAINT_TABLE_NAME (R.R_OWNER, R.R_CONSTRAINT_NAME);
        END LOOP;
        RETURN LTRIM(v_Ret_Val, ', ');
      END;
    BEGIN
      FOR R IN C1 LOOP
        DBMS_OUTPUT.PUT_LINE(ztm_tables_depended_on(R.Owner, R.Table_Name));
      END LOOP;
    END;
    Any ideas what is happening here?

    Any ideas what is happening here?
    Justin explained the probable reason.
    See the 'How Roles Work in PL/SQL Blocks' section of the database security doc for the details
    http://docs.oracle.com/cd/E25054_01/network.1111/e16543/authorization.htm#i1007304
    How Roles Work in PL/SQL Blocks
    The use of roles in a PL/SQL block depends on whether it is an anonymous block or a named block (stored procedure, function, or trigger), and whether it executes with definer's rights or invoker's rights.
    Roles Used in Named Blocks with Definer's Rights
    All roles are disabled in any named PL/SQL block (stored procedure, function, or trigger) that executes with definer's rights. Roles are not used for privilege checking and you cannot set roles within a definer's rights procedure.
    The SESSION_ROLES view shows all roles that are currently enabled. If a named PL/SQL block that executes with definer's rights queries SESSION_ROLES, then the query does not return any rows.
    Roles Used in Named Blocks with Invoker's Rights and Anonymous PL/SQL Blocks
    Named PL/SQL blocks that execute with invoker's rights and anonymous PL/SQL blocks are executed based on privileges granted through enabled roles. Current roles are used for privilege checking within an invoker's rights PL/SQL block. You can use dynamic SQL to set a role in the session.
    See that line starting with 'All roles are disables in any named PL/SQL block'?

  • Why between for date is not returning data for this query ?

    Hello,
    i have a table with this structure and i am writing this query for fetching some rows based on some condition , but this query is not returning any data . Can you please tell why ?
    ID     DT
    003     11/8/2011
    002     10/8/2011
    001     9/8/2011
    And the query is :
    SELECT * FROM TABLE_NAME WHERE DT BETWEEN TO_DATE('08/08/2011','dd/mm/yyyy') AND TO_DATE('12/08/2011','dd/mm/yyyy');
    Edited by: bootstrap on Aug 13, 2011 7:10 AM

    >
    >
    but what is the problem with that, why that date is not matched when i am providing the date format ?Which part don't you understand? You did not use TO_DATE while inserting data and default date format was mm/dd/yyyy, right? Same default date format is used if you issue:
    SELECT * FROM TABLE_NAME Your original post states the above select returns:
    ID     DT
    003     11/8/2011
    002     10/8/2011
    001     9/8/2011So dates you inserted are November 8, 2011, October 8 2011 and September 8 2011. Now TO_DATE('08/08/2011','dd/mm/yyyy') is August 8 2011 and TO_DATE('12/08/2011','dd/mm/yyyy') is August 12 2011. So obviously:
    SELECT * FROM TABLE_NAME WHERE DT BETWEEN TO_DATE('08/08/2011','dd/mm/yyyy') AND TO_DATE('12/08/2011','dd/mm/yyyy');will not return any rows. Bottome line - never write code that uses implicit date conversions since your code becomes client NLS settings dependent and might work for one client and fail or produce wrong results for other client.
    SY.

  • SQL Query (PL/SQL Function Body returning SQL query) doesn't return any row

    I have a region with the following type:
    SQL Query (PL/SQL Function Body returning SQL query).
    In a search screen the users can enter different numbers, separated by an ENTER.
    I want to check these numbers by replacing the ENTER, which is CHR(13) || CHR(10) I believe, with commas. And then I can use it like this: POD IN (<<text>>).
    It's something like this:
    If (:P30_POD Is Not Null) Then
    v_where := v_where || v_condition || 'POD IN (''''''''||REPLACE(''' || :P30_POD || ''', CHR(13) || CHR(10), '','')||'''''''''')';
    v_condition := ' AND ';
    End If;
    But the query doesn't return any rows.
    I tried to reproduce it in Toad:
    select * from asx_worklistitem
    where
    POD IN (''''||REPLACE('541449200000171813'||CHR(13) || CHR(10)||'541449206006341366', CHR(13) || CHR(10), ''',''')||'''')
    ==> This is the query that does't return any rows
    select (''''||REPLACE('541449200000171813'||CHR(13) || CHR(10)||'541449206006341366', CHR(13) || CHR(10), ''',''')||'''')
    from dual;
    ==> This returns '541449200000171813','541449206006341366'
    select * from asx_worklistitem
    where pod in ('541449200000171813','541449206006341366');
    ==> and when I copy/paste this in the above query, it does return my rows.
    So why does my first query doesn't work?
    Doe anyone have any idea?
    Kind regards,
    Geert
    Message was edited by:
    Zorry

    Thanks for the help.
    I made it work, but via the following code:
    If (:P30_POD Is Not Null) Then
    v_pods := REPLACE(:P30_POD, CHR(13) || CHR(10));
    v_where := v_where || v_condition || 'POD IN (';
    v_counter := 1;
    WHILE (v_counter < LENGTH(v_pods)) LOOP
    v_pod := SUBSTR(v_pods, v_counter, 18);
    IF (v_counter <> 1) THEN
    v_where := v_where || ',';
    END IF;
    v_where := v_where || '''' || v_pod || '''';
    v_counter := v_counter + 18;
    END LOOP;
    v_where := v_where || ')';
    v_condition := ' AND ';
    End If;But now I want to make an update of all the records that correspond to this search criteria. I can give in a status via a dropdownlist and that I want to update all the records that correspond to one of these POD's with that status.
    For a region you can build an SQL query via PL/SQL, but for a process you only have a PL/SQL block. Is the only way to update all these records by making a loop and make an update for every POD that is specified.
    Because I think this will have a lot of overhead.
    I would like to make something like a multi row update in an updateable report, but I want to specify the status from somewhere else. Is this possible?

  • Ibots not returning any data

    Hi,
    I have some ibots that I scheduled to run on a daily basis and which were working perfectly.
    Suddenly the same ibots, they run but the content of the attachment says "The specified criteria did not return any data".
    I checked the log files and could not see any relavant error.
    If I go back in the report that I am sending through the ibot, it runs without any problem.
    I tried to send it in different formats and run as different users, but the results are still the same!
    Any idea what else I could check?
    Type: Warning
    Severity: 50
    Time: Wed May 15 14:10:19 2013
    File: project/webodbcaccess/odbcconnectionimpl.cpp Line: 199
    Properties: RptPath-/shared/MICROS/giuliano/cube_build_verification;SID-btilnnapkfo2omg91a71b9m6n2;bindID-1;connID-31;ThreadID-4640;statementID-364;RSP-o:go~r:report
    Location:
         saw.odbc.statement.fetch
         saw.subsystem.portal.pdf
         saw.delivers.rpc.getDeviceContent
         saw.rpc.server.responder
         saw.rpc.server
         saw.rpc.server.handleConnection
         saw.rpc.server.dispatch
         saw.threadPool
         saw.threads
    SQLFetchScroll returned code SQL_NO_DATA_FOUND

    Thanks it solved the issue.
    But One more thing Now I have placed the parameters in the where clause of the query
    Query-
    select field1,field2,field3,field4,field5,job_name,candidate_name,interview_date from etc.ethr_irc_int_details
    where field1 is not null
    and job_name = :1
    and candidate_name = :2
    and interview_date = :3
    in the VO I am executing
    public void iniQuery(String S1, String S2,String S3)
    System.out.println("insdie ini query of the VO");
    System.out.println("S1 "+S1);
    System.out.println("S2 "+S2);
    System.out.println("S3 "+S3);
    this.setWhereClauseParams(null);
    this.setWhereClauseParam(0,S1);
    this.setWhereClauseParam(1,S2);
    this.setWhereClauseParam(2,S2);
    executeQuery();
    and in AM
    ETHRIntDetailsVOImpl IDVO = (ETHRIntDetailsVOImpl)this.getETHRIntDetailsVO();
    // IDVO.executeQuery();
    // OAViewObject IDVO = (OAViewObject)findViewObject("ETHRIntDetailsVO");
    IDVO.iniQuery(S1,S2,S3);
    Row row = IDVO.first();
    again I am not getting any data in the row??
    Any idea if I am doing any thing wrong..
    Please help urgently.
    Thanks
    Ashish

  • Custom reports in R12 not returning any data

    I'm seeing an issue of custom reports in R12 not returning any data. So far what I've been able to dig into is that the report query itself is referring to APPS synonyms that are secured under MOAC. What I am able to do is run the query in SQL Developer after having run mo_global.set_policy_context and I receive the data I'm looking for. This is not the case when running the report through the concurrent programs request.
    Secondly, I've also configured the concurrent program request to run as single operating unit mode. This aided in fixing any issues with LOVs on the parameter form. However, still no results from the report itself. I've also searched around quite extensively and added a P_CONC_PROGRAM_ID user parameter in reports developer, as well as adding SRW.USER_EXIT('FND SRWINIT') to the before report trigger and SRW.USER_EXIT('FND SRWEXIT') to the after report trigger as well. No luck. I've also tried running mo_global.set_policy_context on the before report trigger and no such luck.
    Has anyone seen similar issues with this and could shed some light? At this point, the workaround I would see is to just change the query to use respective all tables and match up against the orgid, but I'd rather not do that.

    I am facing exactly the same issue with 2 of my custom Reports in R12.1.3. We did our level best to find out the issue. It was always a hit and trial fix.
    But the following were our observations and workarounds
    0) The reports Conc Prog were in MOAC - Single mode. Both the reports had SRW INIT, EXIT and P_CONC_REQUEST_ID
    1) The reports which caused the issues[NO data fetched for MOAC] had multiple Queries in the data model and one Query fetches data and the 2nd one doesnt. Both the queries when run from SQL developer after setting the org gave results.
    Workaround for Report1
    a) We deleted the data link connecting the 2 columns in both the queries and added a bind variable instead in the 2nd /child query to refer to the column in the parent query and linked the 2 groups.
    Workaround for Report 2
    a) In report 2 the queries were not linked to each other. Only one query used to return results and the 2nd one returned 0 rows. The workaround was to use the "where" conditions as lexical parameters after having set the value for the same in before report trigger.
    Both the work around looks illogical. Still It worked..!
    Thanks
    Biju Radhakrishnan

  • How to know if the data model qry is not returning any data

    Hi
    If my report doesn't have data (meaning if the data model qry doesn't retreive any data), I wan't to show this text: "There is no data returned."
    My question is how would I know that the qry is not returning any data. I know I can create a text field, and write a trigger on it, to set it True or False depending on the fact that data is being returned or not.
    Thanks
    Shalu

    Hi,
    In Data Model create a summary column for function=count on one of your columns.
    Then for BeforeReport trigger you can write
    function BeforeReport return boolean is
    begin
    if :CS_RPT_NODATA > 0 then
    return (TRUE);
    end if;
    SRW.MESSAGE(300,'There is no data');
    return (FALSE);
    end;
    Regards, Gicu

  • Very Very Urgent Issue: Restricted Key Figure does not return any data

    Hi all,
    Please help me solving this urgent issue.
    created customer exit variable on characterstics version and also
    other customer exit variable on Value type.
    I coded that in variable exit. Problem is when I include these in
    restrickted keyfigure My query does not return me any data.
    But if I remove from restrickted key firgure and put it as normal
    charaterstics I see the variable is getting populated.
    Also in RSRT the SQl generated when these are included in RKF is not
    correct.
    I debugged and know they are getting populated. As when included in RKF
    I can also see the values of customer exit variables from information
    tab.
    I also know that there is data in cube for those restrictions.
    I posted one OSS Notes regarding this urgent issue. But got no reply from SAP.
    FYI: We are using BEx 3.5 Browser SAP GUI 6.4 Patch 20 BW Patch 11
    Thanks
    SAP BW
    **Please do not post the same question twice: Very Urgent Issue: Restricted Key Figure does not return any data

    Hi,
    Everyone out there this is very urgent. If someone can help me solving this problem.
    We are using BEx 3.5 Browser SAP GUI 6.4 Patch 20 BW Patch 11.
    I posted one oss notes also regarding this issue. But got no reply from SAP.
    So, Please help me solving this issue.
    Thanks
    SAP BW

Maybe you are looking for