Author Topic: Read AllAttributes column (image type) in UCS db?  (Read 9197 times)

Offline catanirex

  • Sr. Member
  • ****
  • Posts: 272
  • Karma: 11
Read AllAttributes column (image type) in UCS db?
« on: October 18, 2013, 10:41:36 AM »
Does anybody know how to read the content of Interaction table, AllAttributes column (image type) in Genesys UCS main database on Microsoft SQL server 2008?

We do not want to change any data - just read it! We need to look into that column via SQL code.

Thanks in advance!

Offline Kubig

  • Hero Member
  • *****
  • Posts: 2752
  • Karma: 44
Re: Read AllAttributes column (image type) in UCS db?
« Reply #1 on: October 18, 2013, 10:51:20 AM »
I do not know why do you have posted this topic here, because it is not problem/issue related to Genesys platform, but to the MSSQL in general. So,on google you can find a lot of answers and way how to achieve it. Why do you need read the column via database? You can check it currently:

1. In applications logs
2. Via some app using PSDK

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7641
  • Karma: 56330
Re: Read AllAttributes column (image type) in UCS db?
« Reply #2 on: October 18, 2013, 01:00:07 PM »
Check the docs on UCS and IXN Tables catarinex, it specifies the keys and each table meaning

Offline smile

  • Sr. Member
  • ****
  • Posts: 286
  • Karma: 6
Re: Read AllAttributes column (image type) in UCS db?
« Reply #3 on: October 18, 2013, 01:14:51 PM »
catanirex, i've tried, but without success. looks like standard solutions for decoding blob data doesn't work with ucs db. don't waste time with it. better way that i found is using Contact SDK for requesting interactions and their content.

Offline catanirex

  • Sr. Member
  • ****
  • Posts: 272
  • Karma: 11
Re: Read AllAttributes column (image type) in UCS db?
« Reply #4 on: October 24, 2013, 12:02:15 PM »
Thanx smile,

We also tried standard SQL commands without success for that column. IxnContent table we managed to view using standard conver methods - but not the AllAttributes.

We really would need to read it, since developing a sdk application is a bit to much work just for this :(

cavagnaro & Kubig - I know the ucs db structure since long time. But Genesys have done something non-SQL standard in the AllAttributes Image/blob column :( Thats why I posted the question here.


Offline Kubig

  • Hero Member
  • *****
  • Posts: 2752
  • Karma: 44
Re: Read AllAttributes column (image type) in UCS db?
« Reply #5 on: October 24, 2013, 01:28:58 PM »
I do not about some non-standard using. In SQL world is image type using for example saving of string field. Whole procedure how to read image type column from SQL database took me approx 5 minutes. What did you do for solution?
You can just read the column's value and encode it from bytes to the string (how simple) - There are many ways how to achieve it and is at your decision what solution you will choose.

Offline smile

  • Sr. Member
  • ****
  • Posts: 286
  • Karma: 6
Re: Read AllAttributes column (image type) in UCS db?
« Reply #6 on: October 24, 2013, 01:55:34 PM »

Ha-ha, Kubig ;)

I bet you can't decode AllAttributes field (in case of ucs 8.1 & ms sql 2008). Would you try?

[quote author=Kubig link=topic=8050.msg35446#msg35446 date=1382621338]
I do not about some non-standard using. In SQL world is image type using for example saving of string field. Whole procedure how to read image type column from SQL database took me approx 5 minutes. What did you do for solution?
You can just read the column's value and encode it from bytes to the string (how simple) - There are many ways how to achieve it and is at your decision what solution you will choose.
[/quote]

Offline Kubig

  • Hero Member
  • *****
  • Posts: 2752
  • Karma: 44
Re: Read AllAttributes column (image type) in UCS db?
« Reply #7 on: October 24, 2013, 01:59:00 PM »
Of course I can and you can too, all what want can :-) And of course I have tried it before write the post. What will you bet, smile?:-)

I have tried to encode AllAttributes column value from some InboundNew email and see email headers for example (X-Header-...) etc.

Do you mean, that I have a time to write false post or make fun of you? Calm down man, please.
« Last Edit: October 24, 2013, 02:00:51 PM by Kubig »

Offline smile

  • Sr. Member
  • ****
  • Posts: 286
  • Karma: 6
Re: Read AllAttributes column (image type) in UCS db?
« Reply #8 on: October 24, 2013, 02:01:56 PM »
[quote author=Kubig link=topic=8050.msg35450#msg35450 date=1382623140]
Of course I can and you can too, all what want can :-) And of course I have tried it before write the post. What will you bet, smile?:-)
[/quote]

it depends of your location ;)
i really spent a huge time trying to extract data from this field. and i know it was possible in case of ucs 7.6 and ms sql 2005. don't know what is changed, but can't do this in latest version.

Offline Kubig

  • Hero Member
  • *****
  • Posts: 2752
  • Karma: 44
Re: Read AllAttributes column (image type) in UCS db?
« Reply #9 on: October 24, 2013, 02:03:29 PM »
I have tried it on UCS 8.1.2 and MSSQL2008. So, you are not right, unfortunately. Simple test, copy the value from the column and put in into some on-line converter from hex to string, check yourself what will be the result

Offline smile

  • Sr. Member
  • ****
  • Posts: 286
  • Karma: 6
Re: Read AllAttributes column (image type) in UCS db?
« Reply #10 on: October 24, 2013, 02:07:53 PM »
cool. have you tried to do same thing using standard sql functions like Convert?

Offline Kubig

  • Hero Member
  • *****
  • Posts: 2752
  • Karma: 44
Re: Read AllAttributes column (image type) in UCS db?
« Reply #11 on: October 24, 2013, 02:17:41 PM »
Not yet,but on web are Some hints for creating procedure. Other Option Is via Some application which can Connect to The database and convert The bytes to The String. I have not time to develope working code for sql, I just want to correct information about unreadable column,because it is not true. For explain, I hate the words "it is not possible" or something else. Other thing is Genesys must be able to read this column,so the data MUST be readable via std function.
« Last Edit: October 24, 2013, 02:21:54 PM by Kubig »

Offline smile

  • Sr. Member
  • ****
  • Posts: 286
  • Karma: 6
Re: Read AllAttributes column (image type) in UCS db?
« Reply #12 on: October 24, 2013, 02:32:57 PM »
Good position, Kubig, thank you!
live and learn ;)

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7641
  • Karma: 56330
Re: Read AllAttributes column (image type) in UCS db?
« Reply #13 on: October 24, 2013, 03:24:29 PM »
Idea:
Run SQL Profiler while Genesys queries the UCS and you will see the SQL query it launches.
Not sure if will work but deserves a try

Offline Kubig

  • Hero Member
  • *****
  • Posts: 2752
  • Karma: 44
Re: Read AllAttributes column (image type) in UCS db?
« Reply #14 on: October 24, 2013, 04:25:29 PM »
It should be the one of the ways, but I think that Genesys read the value in byte format and then convert it in own code(stack). If anybody have time to test/try trace via SQL profiler, it will be interesting for others here :-)