Mahesh
Mahesh

Reputation: 35

Encountered the symbol "TABLE" when expecting one of the following: := . ( @ % ; The symbol ":= was inserted before "TABLE" to continue.

I had written a function, looks like everything is fine but still I am getting the errors,

Below is my function:

create or replace FUNCTION TRANSFERQTYBTNDATES 
(
  v_startDate IN DATE,
  v_endDate IN DATE,
  v_storeid IN NUMBER,
  v_areaid IN NUMBER
)
RETURN TransferQtyBtnDates_pkg.tt_TransferQtyBtnDates_type PIPELINED
AS
   v_temp SYS_REFCURSOR;
   v_temp_1 TT_TRANSFERQTYBTNDATES%ROWTYPE;

BEGIN
   TRUNCATE TABLE tt_TransferQtyBtnDates;

   INSERT INTO tt_TransferQtyBtnDates
      SELECT isb.ItemId ,
             SUM(isb.Quantity) TransQty  ,
             isb.ExpiryDate TransExpDates  
        FROM Issues iss
               JOIN IssuedBatches isb
                ON iss.IssueRegisterId = isb.IssueRegisterId
        WHERE iss.IssueType = 'TRANSFER ACCOUNT'
                AND iss.IssuedDate BETWEEN v_startDate AND v_endDate
                AND iss.AreaId = v_areaid
                AND iss.StoreId = v_storeid
        GROUP BY isb.ItemId,isb.Quantity,isb.ExpiryDate;

      OPEN v_temp FOR
      SELECT * 
        FROM tt_TransferQtyBtnDates;

   LOOP
      FETCH v_temp INTO v_temp_1;
      EXIT WHEN v_temp%NOTFOUND;
      PIPE ROW ( v_temp_1 );
   END LOOP;
END;

and in this I am getting these errors

Error(14,13): PLS-00103: Encountered the symbol "TABLE" when expecting one of the following:     := . ( @ % ; The symbol ":= was inserted before "TABLE" to continue. 
Error(21,16): PLS-00103: Encountered the symbol "JOIN" when expecting one of the following:     , ; return returning group having intersect minus start union    where connect 

please help me out... Thanks

Upvotes: 3

Views: 9072

Answers (1)

meadlai
meadlai

Reputation: 935

Replace the DDL using following SQL: EXECUTE IMMEDIATE 'TRUNCATE TABLE tt_TransferQtyBtnDates';

Upvotes: 8

Related Questions