Can not call procedure

Moderator: crythias

Locked
ndhvu275
Znuny advanced
Posts: 139
Joined: 06 Nov 2012, 09:02
Znuny Version: 3.x, 4.x and 5.x
Real Name: Vu Nguyen
Company: INFOdation
Location: Netherlands
Contact:

Can not call procedure

Post by ndhvu275 »

Dear all,

I'm trying to call a procedure. But I got an error: PROCEDURE otrs.proTimeUnit can't return a result set in the given context, SQL: 'call proTimeUnit('2012-10-30','2012-11-30','All')'

And here is my code to call proTimeUnit

Code: Select all

my $StartDate = $Param{FromYear}.'-'.$Param{FromMonth}.'-'.$Param{FromDay};
			my $EndDate = $Param{ToYear}.'-'.$Param{ToMonth}.'-'.$Param{ToDay};
			
            # fetch database and add row blocks
            if ( $Self->{DBObject}->Prepare( SQL => 'call proTimeUnit(\''.$StartDate.'\',\''.$EndDate.'\',\''.$Param{TicketStatus}.'\')',  ) )
However, I run with SQL call proTimeUnit('2012-10-30','2012-11-30','All') direct on MYSQL. That is OK.
Please help me for this

Thanks
Hoang Vu
OTRS 3.x, 4.x on CentOS/Windows
MySQL database
External customer backend with MySQL, MSSQL
Customization
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: Can not call procedure

Post by reneeb »

You can try to change this line in your Kernel/Config.pm:

Code: Select all

$Self->{DatabaseDSN} = "DBI:mysql:database=$Self->{Database};host=$Self->{DatabaseHost};";
to

Code: Select all

$Self->{DatabaseDSN} = "DBI:mysql:database=$Self->{Database};host=$Self->{DatabaseHost};mysql_multi_statement=true";
I haven't used it yet, so I don't know if that works...
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
ndhvu275
Znuny advanced
Posts: 139
Joined: 06 Nov 2012, 09:02
Znuny Version: 3.x, 4.x and 5.x
Real Name: Vu Nguyen
Company: INFOdation
Location: Netherlands
Contact:

Re: Can not call procedure

Post by ndhvu275 »

reneeb wrote:You can try to change this line in your Kernel/Config.pm:

Code: Select all

$Self->{DatabaseDSN} = "DBI:mysql:database=$Self->{Database};host=$Self->{DatabaseHost};";
to

Code: Select all

$Self->{DatabaseDSN} = "DBI:mysql:database=$Self->{Database};host=$Self->{DatabaseHost};mysql_multi_statement=true";
I haven't used it yet, so I don't know if that works...
Dear reneeb,

I already update like your suggestion , but it is still not run. However, searching on google, some suggestions told me that seems an error around the version of MySQL and CentOS. Then, I also upgraded and not still working.

Or I have to create a new sub to call a procedure?

Looking for your any suggestion.

Thanks a lot
Hoang Vu
OTRS 3.x, 4.x on CentOS/Windows
MySQL database
External customer backend with MySQL, MSSQL
Customization
Locked