Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

SQL Query, Lenel Onguard

Posted on 2013-06-04
7
Medium Priority
?
2,994 Views
Last Modified: 2013-11-15
good day.

can someone please help me with simple queries running against a Lenel, Onguard database?

I would like to perform the following (data reading only):

1.  retrieve a list of users and their badge number (last name, first name, badge #)
2.  find out if the badge # is currently active

your help would be greatly appreciated.

i did find this article, however, it isn't exactly what i need (especially finding out if the badge is active):

http://forums.securityinfowatch.com/showthread.php?10054-Integrating-with-Lenel-OnGuard-via-SQL-or-Other


thanks.
0
Comment
Question by:freezingHot
  • 4
  • 3
7 Comments
 
LVL 40

Expert Comment

by:lcohan
ID: 39219960
Before providing any query support what database are you using to support your product - SQL or ORACLE? As far as I'm aware OnGuard 2010 supports SQL 2008, and Oracle 11.

Actualy on bothe DBs you would need to run a query like below and that would give you bothe answers in one shot:


select e.lastname, e.firstname, b.id as badge_num, b.active
from emp e inner join badge b  on b.empid = e.id


You could also subscribe and post questions about speciffic queries at the forum you mentioned above.

http://forums.securityinfowatch.com/showthread.php?10054-Integrating-with-Lenel-OnGuard-via-SQL-or-Other
0
 
LVL 1

Author Comment

by:freezingHot
ID: 39223300
it is a microsoft sql d/b with onguard 2010.

thanks.
0
 
LVL 40

Accepted Solution

by:
lcohan earned 2000 total points
ID: 39223481
Then the query above must work in SQL - just please double check to make sure I got the active field right from badge table (sorry - I currently do not have the OnGuard environment up and running.)

if you need the two record sets exactly like in your posting please run:

--1.
select e.lastname, e.firstname, b.id as badge_num
from emp e inner join badge b  on b.empid = e.id

--2.
select b.id as badge_num, b.active from badge b where b.active = 1


--to get a list of emp names with active badges:

select e.lastname, e.firstname, b.id as badge_num, b.active
from emp e inner join badge b  on b.empid = e.id and b.active = 1

--to get a list with inactive badges:

select e.lastname, e.firstname, b.id as badge_num, b.active
from emp e inner join badge b  on b.empid = e.id and b.active = 0

--to get a full list run:


select e.lastname, e.firstname, b.id as badge_num,
      case when b.active = 0 then 'Inactive'
            when b.active = 1 then 'Active'
            else 'unknown' end as badge_status
from emp e inner join badge b  on b.empid = e.id


Just please double check my logic against badge table in the SQL database to make sure I remembered active column correctly
0
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 
LVL 1

Author Closing Comment

by:freezingHot
ID: 39223531
thanks for the prompt response - I don't have access to the badge table either; however, i should be able to return the table schema, if needed.

have a good one.
0
 
LVL 1

Author Comment

by:freezingHot
ID: 39223642
i think the field name for the badge status is "Status."  Active = 1 like you said.

i found a dataConduIT document on Onguard.  if anyone needs something like this in the future, this document seems to have the field names:

http://cdn.lenel.com/oaap/DataConduIT.pdf


thanks again.
0
 
LVL 40

Expert Comment

by:lcohan
ID: 39223722
"Status" indeed - sorry I missed (forgot) that...

<<
Find all active badges that are APB exempt:
select * from Lnl_Badge where Status=1 and APBExempt = TRUE
>>
0
 
LVL 1

Author Comment

by:freezingHot
ID: 39247909
i was able to view a Lenel database (onguard 2013).  the data conduit document is fine; however, the tables name are a bit different.

the table for badges:

badge
  ID
  EMPID
  Status
  PIN (varbinary(50)) <- i'm assuming they encrypt the PIN somehow

table for employees:

emp
  ID
  lastName
  firstName
  midName

thought i would post in case anyone else needs the info.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Eseutil Hard Recovery is part of exchange tool and ensures Exchange mailbox data recovery when mailbox gets corrupt due to some problem on Exchange server.
There can be many situations demanding the conversion of Outlook OST files to PST format and as such, there is no shortage of automated tools to perform this conversion. However, what makes Stellar OST to PST converter stand above the rest? Let us e…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…

876 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question