Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2012
    Posts
    4

    Unanswered: ORDimage problem

    I created id, pictures and sygnature column in "Pictures" table. I have copied some pictures to "Pictures" table (I used stored procedure which generated sygnatures). When tried compile other stored procedure I received this message :

    Error(12,4): PL/SQL: SQL Statement ignored;
    Error(12,39): PL/SQL: ORA-00904: "ORDSYS"."IMGSIMILAR": incorrect identifier

    This stored procedure you can find below:

    create or replace
    procedure find (color varchar2, texture varchar2, shape varchar2, location varchar2, sensitivity number) is
    scale varchar2(200);
    number number;
    idd NUMBER;
    image ORDSYS.ORDIMAGE;
    query_signature ORDSYS.ORDIMAGESIGNATURE;
    query_image ORDSYS.ORDIMAGE;
    ctx raw(64) := null;


    CURSOR getphotos (c_scale varchar2) IS
    SELECT id, picture FROM pictures WHERE


    ordsys.imgsimilar(sygnature, query_image, c_scale, sensitivity) =1 order by id;

    BEGIN
    SELECT picture INTO query_image FROM tab_obr WHERE id = (select max(id) from tab_obr ) ;
    -- Initialize signature object
    query_signature := ORDSYS.ORDIMAGESIGNATURE.init();
    -- Create temporary storage for the LOB in the signature object
    DBMS_LOB.CREATETEMPORARY(query_signature.signature , TRUE);
    query_signature.generateSignature(query_image);
    scale := 'color='||color||' texture='||texture||' shape='||shape||' location='||location||'';
    OPEN getphotos (scale);
    LOOP
    FETCH getphotos INTO idd, image;
    EXIT WHEN getphotos%NOTFOUND;
    DBMS_OUTPUT.PUT_LINE('Image with ID ' || idd || ' matches query image');
    insert into tab_obr2 (select * from picture where id=idd);
    image.export(ctx, 'FILE', 'PICTURE_KAT_EKSS', image.getSourceName());
    END LOOP;
    CLOSE getphotos;
    DBMS_LOB.FREETEMPORARY(query_signature.signature);
    END;

    Can you help me and tell me why I cannot compile this procedure? I have generated sygnatures before I tried compile procedure above...

    I'm so sorry for my bad English

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    >number number;
    consider to NOT used Reserved Word like "NUMBER" as variable name.

    Code:
    CREATE OR replace PROCEDURE Find (color       VARCHAR2, 
                                      texture     VARCHAR2, 
                                      shape       VARCHAR2, 
                                      location    VARCHAR2, 
                                      sensitivity NUMBER) 
    IS 
      scale           VARCHAR2(200); 
      number1         NUMBER; 
      idd             NUMBER; 
      image           ordsys.ordimage; 
      query_signature ordsys.ordimagesignature; 
      query_image     ordsys.ordimage; 
      ctx             RAW(64) := NULL; 
      CURSOR getphotos ( 
        c_scale VARCHAR2) IS 
        SELECT id, 
               picture 
        FROM   pictures 
        WHERE  ordsys.Imgsimilar(sygnature, query_image, c_scale, sensitivity) = 1 
        ORDER  BY id; 
    BEGIN 
        SELECT picture 
        INTO   query_image 
        FROM   tab_obr 
        WHERE  id = (SELECT Max(id) 
                     FROM   tab_obr); 
    
        -- Initialize signature object  
        query_signature := ordsys.ordimagesignature.Init(); 
    
        -- Create temporary storage for the LOB in the signature object  
        dbms_lob.Createtemporary(query_signature.signature, TRUE); 
    
        query_signature.Generatesignature(query_image); 
    
        scale := 'color=' 
                 ||color 
                 ||' texture=' 
                 ||texture 
                 ||' shape=' 
                 ||shape 
                 ||' location=' 
                 ||location 
                 ||''; 
    
        OPEN getphotos (scale); 
    
        LOOP 
            FETCH getphotos INTO idd, image; 
    
            EXIT WHEN getphotos%NOTFOUND; 
    
            dbms_output.Put_line('Image with ID ' 
                                 || idd 
                                 || ' matches query image'); 
    
            INSERT INTO tab_obr2 
            (SELECT * 
             FROM   picture 
             WHERE  id = idd); 
    
            image.Export(ctx, 'FILE', 'PICTURE_KAT_EKSS', image.Getsourcename()); 
        END LOOP; 
    
        CLOSE getphotos; 
    
        dbms_lob.Freetemporary(query_signature.signature); 
    END;
    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.

  3. #3
    Join Date
    Jun 2012
    Posts
    4
    It was some example (I translate from my language ). Problem is with this part of procedure:

    SELECT id, picture FROM pictures WHERE
    ordsys.imgsimilar(sygnature, query_image, c_scale, sensitivity) =1 order by id;

  4. #4
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    What version of the database do you have. ordsys.imgsimilar is only available in the enterprise edition.
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

  5. #5
    Join Date
    Jun 2012
    Posts
    4
    I have 11.2.0.1.0 Enterprise Edition.

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
  •