Question : Problem with creating Oracle Stored procedure (source does not have runnable target)

I am trying to do a simple stored procedure. Eventually this will be run as a timed procedure.
 It works fine as pl/sql but when I compile it, appropriately modified (see code snippet) it gives me a "source does not have runnable target" compile message.
When I run this as a pl/SQL block it works fine:

SET SERVEROUTPUT ON;
DECLARE
 count_records  integer;
 username_var varchar2(100);
 fee_var integer;
 BEGIN
 select count(*) into count_records
FROM LNK_REG_TOURS_IL
  WHERE (USERNAME NOT IN
    (SELECT USERNAME FROM ILTER_REGISTRATION_TRACKING
    ));
   
   
   
   SELECT USERNAME
  INTO username_var
  FROM LNK_REG_TOURS_IL
  WHERE (USERNAME NOT IN
    (SELECT USERNAME FROM ILTER_REGISTRATION_TRACKING
    ));
  SELECT SUM(FEE)
  INTO fee_var
  FROM LNK_REG_TOURS_IL
  WHERE (USERNAME NOT IN
    (SELECT USERNAME FROM ILTER_REGISTRATION_TRACKING
    ));
     DBMS_OUTPUT.PUT_LINE ('New Registrations:  ' || count_records || '  username: ' || username_var || '    fee:  ' || FEE_VAR);
    END;
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
CREATE OR REPLACE
PROCEDURE sp_insert_regtracking(

    username_var OUT VARCHAR2,
    fee_var OUT NUMBER,
    count_records out integer
    
  )
AS

BEGIN
select count(*) into count_records
FROM LNK_REGISTRATION_TOUR
  WHERE (USERNAME NOT IN
    (SELECT USERNAME FROM ILTER_REGISTRATION_TRACKING
    ));
return count_records;
  

SELECT USERNAME
  INTO username_var
  FROM LNK_REGISTRATION_TOUR
  WHERE (USERNAME NOT IN
    (SELECT USERNAME FROM ILTER_REGISTRATION_TRACKING
    ));
  SELECT SUM(FEE)
  INTO fee_var
  FROM LNK_REGISTRATION_TOUR
  WHERE (USERNAME NOT IN
    (SELECT USERNAME FROM ILTER_REGISTRATION_TRACKING
    ));
  INSERT
  INTO ilter_registration_tracking
    (
      username,
      total_fee,
      currency
    )
    VALUES
    (
      username_var,
      fee_var,
      'Dollars'
    );;

Answer : Problem with creating Oracle Stored procedure (source does not have runnable target)

This error message usually points to the email editor that you are using and is not set properly. Please do the following steps...

- Click Start, click Run, type regedit in the Open box, and then click OK.
- Locate and then click the following registry subkey:
HKEY_CURRENT_USER\Software\Microsoft\Shared Tools\Proofing Tools\Custom Dictionaries

- Set the value of CUSTOM.DIC to 1.
- Exit Registry Editor

Hope this helps~!
Random Solutions  
 
programming4us programming4us