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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

adding employee using sql

Status
Not open for further replies.

mittal2014

IS-IT--Management
Apr 23, 2014
1
CA
Is there a way to addimport employees into Micros 3700 using sql?

How do we generate the obj_num for emp_def table? where is it stored?

any insight is appreciated.
 
Employees are in micros.employee_def

How you generate the object number is up to you; it just can't be a repeat or null. I wouldn't recommend doing a MAX(obj_num) + 1 because if you have object number 9999999999 or whatever used to space things out, it will blow your script up.

You can use this to find the next free object number after a specific sequence:

SQL:
SELECT FIRST o.obj_num + 1
FROM MICROS.emp_def as o
WHERE o.obj_num >= (SELECT obj_num FROM MICROS.emp_def WHERE emp_seq = {some seq num}) AND
(
    SELECT i.obj_num
    FROM MICROS.emp_def as i
    WHERE i.obj_num = o.obj_num +1
) IS NULL
ORDER BY obj_num
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top