-
Are you ever calling the procedure to set the variable in that package??? As I said, you need to call it when the person logs in.
Also, why are you now grabbing the date as well, since you're not using it anywhere?
Also, please use the [ C O D E ] and [ / C O D E ] (without the spaces) markers around your code blocks so they're readable.
CREATE OR REPLACE PACKAGE BODY global_package
AS
PROCEDURE SetCTUT_ID
IS
BEGIN
SELECT
CTUT_ID,sysdate
INTO
g_CTUT_ID,g_cdate
FROM
ORA_SYSTEM_USER
WHERE
CURRENT_USER_ID = USER;
END;
Also, what is USER above?
You need to get this package working to set the g_CTUT_ID attribute correctly. Once you are sure of that, make sure it is being called in the app and set correctly. Once you are sure of that, make sure the triggers are working properly. This is simple debugging now.
- Chris
-
i JUST DID SOME DEBUGGING
SQL> CREATE OR REPLACE TRIGGER ORA_SYSTEM_USER_BIR_TR
2 BEFORE
3 INSERT
4 ON
5 ORA_SYSTEM_USER
6 FOR
7 EACH ROW
8 BEGIN
9 :NEW.CREATED_BY := GLOBAL_PACKAGE.G_CTUT_ID;
10 :NEW.CREATED_DATE := SYSDATE ;
11
12 DBMS_OUTPUT.PUT_LINE(:NEW.CREATED_BY);
13 DBMS_OUTPUT.PUT_LINE(:NEW.CREATED_DATE);
14
15 END ORA_SYSTEM_USER_BIR_TR;
16 /
Trigger created.
SQL>
SQL>
SQL> INSERT INTO ORA_SYSTEM_USER(CTUT_ID,CURRENT_USER_ID)
2 VALUES(6,'EXAMPLE6');
15-MAY-03
1 row created.
SEE IN THE ABOVE MESSAGE IT CAME ONLY CREATED_DATE NOT CREATED_BY15-MAY-03
-
*sigh*
Please read my previous post again.
- Are you even populating the package variable correctly?
- What is USER?
- Use the [ C O D E ] and [ / C O D E ] tags around any code you post
etc.
You didn't address a single issue in my previous post except to tell me 'I did some debugging'.
- Chris