Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2004
    Posts
    30

    Arrow Unanswered: CALLING a function inside "where" clause

    I want to put a condition in the where clause of my block, the condistion is like this:

    c_id=pkg.get_id

    where get_id is a function inside the package pkg. But in the runtime
    it tells that 'Query caused no records to be retrieved'.
    I don't know the reason of it, even I did call the function the same previous way in other
    part of the form and it worked, but in here it doesn't work.

    if anyone knows why and how to make it work, plz tell me.
    thankxxxxx

  2. #2
    Join Date
    Feb 2004
    Location
    Dublin, Ireland
    Posts
    212
    make shure what returns your function and if there are
    some records for which c_id is equal to value returned by function.

    maybe I should help you more If I knew what are the attributes
    of function and what this function should does

  3. #3
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    for your query to return anything the values of c_id and pkg.get_id must be an exact match, otherwise your query will return no rows.
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

  4. #4
    Join Date
    Jul 2004
    Posts
    30
    thank you madafaka and beilstwh

    well, the pacjage as as follows:

    PACKAGE BODY PKG IS

    LMN Varchar2(4) := Null;

    Code:
    PROCEDURE TAKE ( FLAG IN VARCHAR2)
    IS 
    BEGIN
     PKG.LMN := FLAG;
     	
    END;
     
    FUNCTION GET RETURN VARCHAR2
    IS
    BEGIN
    	RETURN (PKG.LMN);
    END;
    
      
    END;
    and I make sure of the matching data type. and to make sure that there's a record that matches the value been sent I make LMN equals to an existing ID.
    I really this WHERE CLAUSE to work effeciently, cause my whole project depends on it.

    thanks for any advice.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •