Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2010
    Posts
    3

    Unanswered: Ref cursor help nedded

    Hi all,

    I want to have ref cursor to return value so that i can use it on my front end php. the procedure works fine but without returning ref cursor value as paramter. Please help me with this issue i'm stuck with this from 3 days now.

    DECLARE
    id NUMBER;
    img_score NUMBER;
    t_img ORDSYS.ORDImage;
    query_signature ORDSYS.ORDImageSignature;

    CURSOR getphotos IS
    SELECT product_id, ORDSYS.IMGScore(123), product_photo
    FROM pm.online_media WHERE
    ORDSYS.IMGSimilar(product_photo_signature, query_signature,
    'color="0.2" texture="0.1" shape="0.5" location="0.2"', 20, 123) = 1;

    BEGIN
    SELECT product_photo_signature INTO query_signature
    FROM pm.online_media
    WHERE product_id = 1910;
    OPEN getphotos;
    LOOP
    FETCH getphotos INTO id, img_score, t_img;
    EXIT WHEN getphotos%NOTFOUND;
    DBMS_OUTPUT.PUT_LINE('Image with ID '|| id ||
    ' matches query image with score ' ||
    img_score ||'.');
    END LOOP;
    CLOSE getphotos;
    END;
    /

    Many thanks in advance.

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    FUNCTION returns a value
    First make it work, then make it fancy.
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

Tags for this Thread

Posting Permissions

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