2 Replies Latest reply on Sep 14, 2008 5:58 PM by ozsun

    FRM-10764

    ozsun
      Hello, I created a table and procedure for inserting large objects (images, documents..)into table and it works fine,
      but now I want to create a form based on that procedure so that I can insert data with it.... but I am getting error FRM-10764,
      I simplu do not understand how to add an argument of type TABLE or REFCURSOR to the procedure...below is the code for table and procedure :

      CREATE TABLE MY_DOCS
      (
      DOC_ID NUMBER,
      BFILE_LOC BFILE,
      DOC_TITLE VARCHAR2(255 BYTE),
      DOC_BLOB BLOB DEFAULT EMPTY_BLOB()
      )




      CREATE OR REPLACE PROCEDURE TESTFORMS.load (in_doc IN VARCHAR2, in_id IN NUMBER) IS

      temp_blob BLOB := empty_blob();

      bfile_loc BFILE;


      BEGIN
      bfile_loc := BFILENAME('DOC_DIR', in_doc);
      INSERT INTO my_docs (doc_id, bfile_loc, doc_title) VALUES (in_id, bfile_loc, in_doc);
      SELECT doc_blob INTO temp_blob FROM my_docs WHERE doc_id = in_id FOR UPDATE;
      DBMS_LOB.OPEN(bfile_loc, DBMS_LOB.LOB_READONLY);
      DBMS_LOB.OPEN(temp_blob, DBMS_LOB.LOB_READWRITE);
      DBMS_LOB.LOADFROMFILE(temp_blob, bfile_loc, dbms_lob.getlength(bfile_loc));

      DBMS_LOB.CLOSE(temp_blob);

      DBMS_LOB.CLOSE(bfile_loc);

      COMMIT;
      END load;
      /


      regards,

      edo
        • 1. Re: FRM-10764
          sgalaxy
          Your procedure should use as one at least parameter of ref cursor(rc_empdept , in the example below).....or of table of records(t_empdept , in the example below)...
          For example:
           create or replace package empdept_maint
          as
             type emp_t is record(empno emp.empno%type , ename emp.ename%type ,job emp.job%type ,
                                  hiredate emp.hiredate%type ,
                                  e_deptno emp.deptno%type ,d_deptno dept.deptno%type,
                                  dname dept.dname%type);
            
             type rc_empdept is ref cursor return emp_t;

             type t_empdept is table of emp_t
                  index by binary_integer;

            function fnc_deptno_check(deptno_var in dept.deptno%type)
              return varchar2;

            procedure slct(*p_empquery in out rc_empdept* , job_var in emp.job%type);

            procedure ins(*p_emprec in out t_empdept*);

            procedure upd(*p_emprec in out t_empdept*);

            procedure del(*p_emprec in out t_empdept*);

            procedure lck(*p_emprec in out t_empdept*);
          end empdept_maint; 
          You can find multiple examples .....
          Greetings,
          Sim
          • 2. Re: FRM-10764
            ozsun
            Hello Simm,
            I olready tried options which you sugest but without success,
            I would like to see how would code look like with my procedure..

            regards,

            edo