" /> DB Query on Config DB - Genesys CTI User Forum

Author Topic: DB Query on Config DB  (Read 2441 times)

Offline zwerg82

  • Newbie
  • *
  • Posts: 30
  • Karma: 2
DB Query on Config DB
« on: June 22, 2016, 11:40:16 AM »
Advertisement
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,

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7641
  • Karma: 56330
Re: DB Query on Config DB
« Reply #1 on: June 22, 2016, 12:28:32 PM »
What location?

Enviado de meu E6633 usando Tapatalk


Offline Tambo

  • Sr. Member
  • ****
  • Posts: 456
  • Karma: 5
Re: DB Query on Config DB
« Reply #2 on: June 22, 2016, 01:22:37 PM »
folder structure has no meaning, only for visualisation

Offline zwerg82

  • Newbie
  • *
  • Posts: 30
  • Karma: 2
Re: DB Query on Config DB
« Reply #3 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]
« Last Edit: June 22, 2016, 02:28:52 PM by zwerg82 »

Offline Kubig

  • Hero Member
  • *****
  • Posts: 2755
  • Karma: 44
Re: DB Query on Config DB
« Reply #4 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