Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Return a message if no records found

Status
Not open for further replies.

Dohhh

MIS
Mar 27, 2002
3
0
0
US
Is it possible to return a "No records matched your query" message or something similar if no records are found? I have a query that pulls failed authentications from log files, but there is not always data. It would be nice to see a message instead of just 0 to know that the query did in fact run (obviously this is a request from management). Any ideas? Thanks.

Jim
 
Could you provide more details:
1) What is the DB?
2) Are you planning to just run the Query in the prompt?

 
The database is in a product from Addamark Technologies. Basically it is just a log collecting and correlating tool. They use a some proprietary SQL commands, but for the most part it is standard SQL. I'm not sure what you mean by running the query in the prompt, but here is the query if that helps:

WITH TIMEZONE "PST"

select user_app_local_userid AS "user name",
_timef("%m/%d/%y", TS, "PST")AS date,
_timef("%r", TS, "PST")AS time,
USER_APP_LOCAL_NAMESPACE AS "Group",
EVENT_RPTR_ID AS "Event Classification",
EVENT_RPTR_RULE AS "Event Rule",
NP_src_actual_ip as "Source IP",
NP_relay_actual_ip as "Relay IP",
NP_relay_port_actual as "Relay Port",
PAYLOAD_TXT AS "Other Event Info"

FROM acs
WHERE _strstr(CLASS_RPTR_COMPONENT,"Failed") > -1
Order By 1,2,3

DURING ALL;

Thanks for the help.

Jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top