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

Similar Messages

  • 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

  • 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'?

  • 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?

  • Standar ws ProjectByPartyQueryResponse_In is not returning any values

    Hi gurus,
      I'm trying to use the standar webservice ProjectByPartyQueryResponse_In in our landscape in order to get all the projects related to the person responsible for the project but the web service is not returning any values.
    When I execute the service -using soapui- with the following values (or any other value for that matters):
    <PartyID>20000143</PartyID>
    <PartyRoleCode>ZA</PartyRoleCode>
    The web service always returns :
           <Log>
                <BusinessDocumentProcessingResultCode>5</BusinessDocumentProcessingResultCode>
                <MaximumLogItemSeverityCode>3</MaximumLogItemSeverityCode>
                <Item>
                   <TypeID>002(ECC_SE_COMMON)</TypeID>
                   <SeverityCode>3</SeverityCode>
                   <Note>No records returned for ZA 0020000143</Note>
                </Item>
             </Log>
    The party Id exists and also de party role code and there is at least one project that has that party with that role. I'm sure because I use other web service to find a project by id and in the result the project has the <Party> section with those values.
    I was looking for solutions, notes, threads in forums with no success, then i decided to debug the webservice and I did find the following line in the webservice code.
      SELECT objnr INTO TABLE it_data FROM ihpa
      WHERE  parvw = role_code AND
             parnr = party_id AND
             obtyp = 'PDN'.
    when that line executes the select always returns 0 values, then I look in the table IHPA using the SE16 without any filter and I found that my records exists!! but the select does not get it. I was wondering why the select is not working and then I filter the data in the SE16 using the same values that the query does
    for example:
    PARVW= ZA
    PARNR = 20000143
    OBTYP = PDN
    And I was surprised when the SE16 did not found any value even I was seeing in the previous screen with no filters!!!! And I supouse thats why the webservice is not working. I started making filters one by one, for example firts filtering just de PARVW = ZA and works, but when I filter just the PARNR =  20000143 the SE16 can't find any value, just when I put an * at the end of the number the SE16 returns all the values expected, Im guessing that the fields in the database has blanks at the end but this is a standar table and a standar program.
    Have any of you had the same problem? is there anything that I can do? does anyone knows if this is an unkown bug? becaus I could'n find any note on the marketplace.
    Any help would be appreciated.
    Gustavo Balboa

    Hi!
      The problem were solved but not using the Badi, because the badi only let you change the value of the var party_id and that var is declared as PARNR (of type numeric with length 10), and no mater wat you do the two 00 can´t be removed.
      We solved the problem with an enhancement point in the code at the method "party_get_data", look at the beginin and at the end. We just change the type of var used for party_id.. now we use a CHAR one insted the numeric used by the original code.
    And we repeat the select...
    Thank you very much for the help.
    METHOD party_get_data.
    """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""$"$SE:(1) Class CL_PRS_PROJECTPRJPARTYQR, Method PARTY_GET_DATA, Start                                                                                A
    $$-Start: (1)----
    $$
    ENHANCEMENT 1  ZPARTY_GET_DATA.    "active version
    DATA : WA_PARNR TYPE I_PARNR.
    DATA : WA_CHPAR(10) TYPE C.
    ENDENHANCEMENT.
    $$-End:   (1)----
    $$
      DATA :  temp_object_number TYPE ihpa-objnr,
              field1 TYPE char50,
              field2 TYPE char50,
              field_role TYPE char50,
              field_party TYPE char50,
              st_object_number TYPE TABLE OF bapiprexp.
      DATA : it_data TYPE TABLE OF st_data,
             wa_data LIKE LINE OF it_data,
             itab TYPE TABLE OF st_data,
             wa LIKE LINE OF itab,
             wa_project_details LIKE LINE OF project_details,
             null.
    Select Object number based on input Party and Role
      SELECT objnr INTO TABLE it_data FROM ihpa
      WHERE  parvw = role_code AND
             parnr = party_id AND
             obtyp = 'PDN'.
    Select Project ID based on input Object number
      LOOP AT it_data INTO wa_data.
        SELECT pspid post1 FROM proj INTO CORRESPONDING FIELDS OF wa_data
        WHERE  objnr = wa_data-pspid.                         "#EC CI_NOFIELD
        ENDSELECT.
        MOVE-CORRESPONDING wa_data TO wa.
        APPEND wa TO itab.
      ENDLOOP.
      IF sy-subrc <> 0.
        field_role = cl_wd_utilities=>get_otr_text_by_alias( 'PLM-SE_PRS_XI_PROXY/ROLE_CODE' ) .
        field_party = cl_wd_utilities=>get_otr_text_by_alias( 'PLM-SE_PRS_XI_PROXY/PARTY_ID' ) .
        CONCATENATE  field_role role_code_external INTO field1.
        CONCATENATE  field_party party_id INTO field2.
        MESSAGE e002(ecc_se_common) WITH field1 field2 INTO null.
        CALL FUNCTION 'PS_BAPI_MESSAGE_APPEND'
          TABLES
            return = party_return.
      ELSE.
        MESSAGE s082(ops_se_prs) INTO null.
        CALL FUNCTION 'PS_BAPI_MESSAGE_APPEND'
          TABLES
            return = party_return.
      ENDIF.
      LOOP AT itab INTO wa.
        MOVE-CORRESPONDING wa TO wa_project_details.
        APPEND wa_project_details TO project_details.
      ENDLOOP.
    """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""$"$SE:(2) Class CL_PRS_PROJECTPRJPARTYQR, Method PARTY_GET_DATA, End                                                                                A
    $$-Start: (2)----
    $$
    ENHANCEMENT 2  ZPARTY_GET_DATA.    "active version
      WA_CHPAR = party_id.
      SHIFT WA_CHPAR BY 2 PLACES.
      CLEAR party_return.
      REFRESH party_return.
      SELECT objnr INTO TABLE it_data FROM ihpa
      WHERE  parvw = role_code AND
             parnr = WA_CHPAR AND
             obtyp = 'PDN'.
    Select Project ID based on input Object number
      LOOP AT it_data INTO wa_data.
        SELECT pspid post1 FROM proj INTO CORRESPONDING FIELDS OF wa_data
        WHERE  objnr = wa_data-pspid.                         "#EC CI_NOFIELD
        ENDSELECT.
        MOVE-CORRESPONDING wa_data TO wa.
        APPEND wa TO itab.
      ENDLOOP.
      IF sy-subrc <> 0.
        field_role = cl_wd_utilities=>get_otr_text_by_alias( 'PLM-SE_PRS_XI_PROXY/ROLE_CODE' ) .
        field_party = cl_wd_utilities=>get_otr_text_by_alias( 'PLM-SE_PRS_XI_PROXY/PARTY_ID' ) .
        CONCATENATE  field_role role_code_external INTO field1.
        CONCATENATE  field_party party_id INTO field2.
        MESSAGE e002(ecc_se_common) WITH field1 field2 INTO null.
        CALL FUNCTION 'PS_BAPI_MESSAGE_APPEND'
          TABLES
            return = party_return.
      ELSE.
        MESSAGE s082(ops_se_prs) INTO null.
        CALL FUNCTION 'PS_BAPI_MESSAGE_APPEND'
          TABLES
            return = party_return.
      ENDIF.
      LOOP AT itab INTO wa.
        MOVE-CORRESPONDING wa TO wa_project_details.
        APPEND wa_project_details TO project_details.
      ENDLOOP.
    ENDENHANCEMENT.
    $$-End:   (2)----
    $$
    ENDMETHOD.

  • 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

  • IE/ExternalInterface do not return any value if movie added with appendChild

    There is a problem with IE/ExternalInterface if movie is added to DOM f.ex appendChild. JavaScript functions are called but they do not return any value.
    MS first response was that this is 3rd party/Adobe problem.
    Fixing this with innerHTML is not the solution. Using here Any suggestions ?
    Simplified test case has
              var flashMovie = '<OBJECT id="testId" codeBase="http://fpdownload..
              // Works in IE and FF
              document.getElementById("testdiv").innerHTML = flashMovie;
              // ExternalInterface.call calls JS but does not return value in IE. Works in FF
              var tempDiv = document.createElement("div");   
              tempDiv.innerHTML = flashMovie;
              document.body.appendChild(tempDiv);
    Here is complete code
    http://pastebin.com/fbc0aa9a
    Here is AS3 code in for ajax.swf
    http://pastebin.com/d4efd47b
    -H

    You are right about that duplicate id of the movie in this example, but that is not case here.
    I appreciate if you try this and confirm that problem exist or any work-around.
    Here is more explanation to original post:
    In HTML is JavaScipt
    function fromJs()
         return "text from js..";
    that is called from AS3
    var s = ExternalInterface.call("fromJs");
    This "s" value and also ExternalInterface.objectID are null in AS3.
    Here example again only with non-working case without that duplicate id with innerHTML
    http://pastebin.com/f4e33af93
    and also movie with AS3 code is attached.
    Using plain innerHTML this case works
    document.getElementById("testdiv").innerHTML = '<OBJECT..
    and with appendChild does not work
    var tempDiv = document.createElement("div");
    tempDiv.innerHTML = "<OBJECT ..
    document.body.appendChild(tempDiv);

  • Mapping is done ....but it is not inserting any rows

    hi,
    Mapping is validated successfully.
    We will deploy the code in the backend by generating the code.
    When the package is created and executed It.It shows me procedure completed succesfully...But it will not insert any rows.
    I am unable to find the reason for it.Please help me in solving this.
    Thanks,
    kiran

    what is your owb version
    how many rows are there in source
    what is your filter criteria and are any rows returned through simple sql but using that filter criteria.
    what is the loading type of your target table
    the ebst way is to debug the map and find out, i wouldnt recomment using backend code to debug as the ebst option since debug facility is availabe in owb, if that doesnt work then probably you can try using the package code.
    Edited by: Darthvader-647181 on Nov 18, 2008 1:54 AM

Maybe you are looking for