Genesys CTI User Forum

Genesys CTI User Forum => Genesys CTI Technical Discussion => Topic started by: zwerg82 on June 22, 2016, 11:40:16 AM

Title: DB Query on Config DB
Post by: zwerg82 on June 22, 2016, 11:40:16 AM
Hi all,

I'm trying to get an extract of the ConfigDB where I can see the following:

-----------------------------------------------------------------------------
| Employee ID | Actual Folder | Parent Folder (1up) | Parent Folder (2up) |
-----------------------------------------------------------------------------
| Test_0001    | Test              | Berlin                      | Persons                  |
-----------------------------------------------------------------------------

I want to get that information because we have a good folder structure,
but especially for Admin or Supervisor accounts we don't have a good naming
convention. So I cannot get the location where a person belongs to based on the Employee ID.

Does anybody know how an easy way would look like?

Thank you,
Best regards,
Title: Re: DB Query on Config DB
Post by: cavagnaro on June 22, 2016, 12:28:32 PM
What location?

Enviado de meu E6633 usando Tapatalk

Title: Re: DB Query on Config DB
Post by: Tambo on June 22, 2016, 01:22:37 PM
folder structure has no meaning, only for visualisation
Title: Re: DB Query on Config DB
Post by: zwerg82 on June 22, 2016, 01:49:19 PM
I know that there is no real meaning of the folder structure.

But looking at the tables CFG_FOLDER and CFG_OBJ_FOLDER I thought that might be a possibility to use it.

Edit.
I've solved it now, for everybody who is interested:

[quote]
SELECT
  PERSON.EMPLOYEE_ID, FOLDER.NAME AS FOLDER, FOLDER2.NAME AS ONEUP, FOLDER3.NAME AS ONEUP
FROM
  CFG_PERSON PERSON
-- MAIN FOLDER 
JOIN CFG_OBJ_FOLDER OBJ
  ON OBJ.OBJECT_DBID = PERSON.DBID AND OBJ.OBJECT_TYPE = 3
JOIN CFG_FOLDER FOLDER
  ON OBJ.FOLDER_DBID = FOLDER.DBID
-- ONE UP 
JOIN CFG_OBJ_FOLDER OBJ2
  ON OBJ2.OBJECT_DBID = OBJ.FOLDER_DBID AND OBJ2.OBJECT_TYPE = 22
JOIN CFG_FOLDER FOLDER2
  ON OBJ2.FOLDER_DBID = FOLDER2.DBID
-- TWO UP
JOIN CFG_OBJ_FOLDER OBJ3
  ON OBJ3.OBJECT_DBID = OBJ2.FOLDER_DBID AND OBJ3.OBJECT_TYPE = 22
JOIN CFG_FOLDER FOLDER3
  ON OBJ3.FOLDER_DBID = FOLDER3.DBID
[/quote]
Title: Re: DB Query on Config DB
Post by: Kubig on June 22, 2016, 02:25:31 PM
Try to check this thread http://www.sggu.com/smf/index.php/topic,9136.msg41059.html#msg41059 if there is script like you need/wanrt