[SR-Users] db_extra fields cannot be integer

Benoit Panizzon benoit.panizzon at imp.ch
Thu Nov 24 09:37:51 CET 2022


Hi

> I haven't checked the code, nor remember why the developer did it like
> that, but probably it is still the case. It can be changed, should
> anyone needs it and want to work on it.

I also stumbled over that issue but circumvented it by converting the
integers to a string.

MySQL als Database then converts the string containing a valid
representation of an integer, back to an integer.

Use-case: Counting Call-Legs with same $ci:

Initialize the dialog var you will be using as a string:

$dlg_var(legcounter) = "1";

Put call in a DLG Profile:

set_dlg_profile("legcounter","$ci");

Pull Integer Variable containing number of calls:

get_profile_size("legcounter","$ci","$var(legcounter)");

$var(legcounter) is an integer now but when you assign it to a string dlg_var it is being converted to string:

$dlg_var(legcounter) = $var(legcounter);

Or to forcefully convert an integer to a string you could always do:

$dlg_var(legcounter) = "" + $var(legcounter);

PS: this was determined by try and error. So maybe there are better
solutions out there.

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G    -    Leiter Commerce Kunden
______________________________________________________

Zurlindenstrasse 29             Tel  +41 61 826 93 00
CH-4133 Pratteln                Fax  +41 61 826 93 01
Schweiz                         Web  http://www.imp.ch
______________________________________________________



More information about the sr-users mailing list