ORA-00904: "TIMESTAMP": invalid identifier on perl script - oracle

DBI->connect using 'old-style' syntax is deprecated and will be an error in future
versions at /home/dbadmin/perl/adm_audit_mhs line 43
Can't prepare SQL statement: ORA-00904: "TIMESTAMP": invalid identifier (DBD ERROR:
error possibly near <*> indicator at char 281 in
'SELECT OS_USERNAME, USERNAME, TERMINAL, TIMESTAMP,
SQL_TEX,0,'Successful','Failed') RETURNCODE
FROM unified_audit_trail
WHERE action IN (43,51,53)
AND <*>timestamp between Trunc(SYSDATE-1) AND Trunc(SYSDATE)')
Please help I'm getting this error while running a perl script to pull information from unified_audit_trail view. Thanks in advance

As the error indicates, there is no timestamp column in unified_audit_trail. There is an event_timestamp column which is what I'm guessing you meant to reference.

Related

select all statement in Oracle not working as expected?

I learnt SQL in SSMS, but I'm using Oracle (Version 21.4.3.063) and have written a standard select ALL statement, which is surprisingly giving me an error!
Does anyone know why this query would produce an error?
The table name definitely exists!
Select * from TTLS532100;
The error I get is this (the code is preceded by comments):
Error starting at line : 5 in command -
select *
from TTLS532100
Error at Command Line : 6 Column : 6
Error report -
SQL Error: ORA-00942: table or view does not exist
00942. 00000 - "table or view does not exist"
*Cause:
*Action:

Plsql Error handling does line number comes with user error code

hi guys I wrote a code on plsql in error handling I used the
raise _application_error function in toad tool I got the error as output but I also got a sys error and line no of error it is general output or I there any mistake in the code..
error output
[72000][20001] ORA-20001: Loop Done -user output
ORA-06512: at line 14 - sys error
Position: 0 - sys error
is line no common
if any solution pls help..
It would probably help if you posted piece of code that illustrates what you did and how Oracle responded (or, at least, screenshot).
This is how error stack usually looks like:
SQL> begin
2 raise_application_error(-20001, 'My error message');
3 end;
4 /
begin
*
ERROR at line 1:
ORA-20001: My error message
ORA-06512: at line 2
SQL>
So - yes, line number is displayed (if that answers your question).

Problem execute procedure in oracle ORA-06550

I try to execute a package in oracle that it works when call him with software, but in sql developer no
show me the following error:
ORA-06550: Line 2 column 11
PLS-00103 Encountered the symbol "package name" when expection one the following
:= . ( # % ; was substituted form "package name" to continue.
06550. 000000 - "line%s column %s:\n%s"
*Cause: Usually a PL/SQL compilation error.
*Action
Vendor code 6550 Error at Line:1
the line 11 start of name package
begin
execute packageName.procedureName(parameter1,parameter2,parameter3,...);
end
Remove EXECUTE. It is used when you want to run a procedure at SQL*Plus prompt. In PL/SQL, you don't use it.
Code that should work is:
begin
packageName.procedureName(parameter1,parameter2,parameter3,...);
end;
/

Oracle: call to a function fails weirdly

If being called under owner account, the following syntax works just fine:
SELECT "MY_OWNER"."MY_PACKAGE".Convert(t.Value) FROM My_Table t
but when called from under another user I get the following error:
ORA-00904: : invalid identifier
00904. 00000 - "%s: invalid identifier"
*Cause:
*Action:
Error at Line: 1 Column: ??
Where Column: ?? points to
SELECT "MY_OWNER"."MY_PACKAGE".Convert(t.Value) FROM My_Table t
⇑
What am I doing wrong?
UPDATE. It's a function that is being called:
FUNCTION Convert ...
You need to grant privileges on this package to the other user
GRANT EXECUTE ON MY_OWNER.MY_PACKAGE TO the_other_user;
You should also check to see whether a_horse_with_no_name is correct. Is this a function that you can call in the way you specify or a procedure which should be called in this way
DECLARE
v_value VARCHAR2(10);
BEGIN
MY_OWNER.MY_PACKAGE.CONVERT(v_value);
END;
Also check the package to see what rights are defined. Current User or package owner. More details can be found here

Oracle triggers error on sqldeveloper export script

I had built a few tables with sequences and triggers, since I need to share the script with my team at uni I did an export with sqldeveloper, now when I try to import/execute the resulted .sql I'm getting errors with triggers.
This is the error message:
"Error starting at line 250 in command:
CREATE OR REPLACE EDITIONABLE TRIGGER "TRG_ACCOUNTS"
BEFORE INSERT ON ACCOUNTS
FOR EACH ROW
BEGIN
SELECT SEQ_ACCOUNTS.NEXTVAL INTO :NEW.ACCOUNT_ID FROM DUAL
Error report:
SQL Command: editionable TRIGGER
Failed: Warning: execution completed with warning
Error starting at line 258 in command:
END
Error report:
Unknown Command
trigger "TRG_ACCOUNTS" altered."
This is the part of the script it's complaining about. I have a few other triggers and it's giving me the same error on all of them. I've checked how the triggers are created after executing the script, and all of them seem to be missing a semi colon and the "END;" at the end.
Example:
create or replace
TRIGGER "TRG_FL_AR"
BEFORE INSERT ON FLOOR_AREAS
FOR EACH ROW
BEGIN
SELECT SEQ_FL_AR.NEXTVAL INTO :NEW.FLOOR_AREA_ID FROM DUAL <-- missing ";" here
<missing "END;" here>
Could you please help me?
Thank you.
Try to put a back slash / after line 258 and check again

Resources