Help Error 675 on stored procedure.
Posted in 2000
Friends,
I need some help here to figure out some problem that I am stuck with.
Environment:
OS : HP/UX 10.20 with Patch level 48.
Informix : Universal Server 9.14UC7
Datablade: Web Datablade 4.00.UC1
Web Server: Netscape Enterprise Server 3.51
I have a stored procedure that works perfectly well as I test it from
dbaccess. However when I issue the call to the stored procedure from
within the web datablade 4.00 I get the error -675.
-675 Illegal SQL statement in stored procedure.
on the trace file of the stored procedure and a Dynamic Page Generation
Error:Illegal SQL statement in stored procedure on the web server.
The stored procedure checks for the user, institution to be present in
a table email_stats. If present it updates a counter on the table other
wise it inserts a new row in the table email_stats.
The stored procedure is (Some code commented for debugging purposes):
drop function "stardba".sendGroupMail;
create function "stardba".sendGroupMail(FILE varchar(255), TO varchar
(64),
UsrLogon varchar(32), IstInstId integer, GROUPNAME varchar(64),
CREATEDBY varchar(64))
returning integer;
define reccount int;
define ONE int;
define ZERO int;
define U varchar(32);
define I int;
define C int;
define mailcall varchar(255);
define makegrp varchar(255);
set debug file to "/tmp/ram.log";
trace on;
let ONE=1;
let ZERO=0;
-- let makegrp = '/clients/star/mail/bin/cmdutils/addlistshort'
|| ' ' || GROUPNAME || ' ' || CREATEDBY;
-- system makegrp;
-- let mailcall
= '/clients/star/content/private/bin/star_sendmail.sh' || ' ' || FILE;
-- system mailcall;
select count(*)::int into reccount from email_stats
where ems_usr_logon = UsrLogon
and ems_ist_inst_id = IstInstId;
if reccount == 0 then
insert into email_stats (ems_usr_logon, ems_ist_inst_id,
ems_total_sent, ems_total_received)
values (UsrLogon,IstInstId,ONE,ZERO); else
update email_stats set ems_total_sent=ems_total_sent+1
where ems_usr_logon = UsrLogon
and ems_ist_inst_id = IstInstId; end if;
trace off;
return 1;
end function;
The trace Output is:
trace on
let one = 1
let zero = 0
expression:
(select (count *)::INT
from email_stats
where (and (= ems_usr_logon, usrlogon), (= ems_ist_inst_id,
istinstid)))
evaluates to 1 ;
let reccount = 1
expression:(= reccount, 0)
evaluates to f
update email_stats set
(ems_total_sent) = ((+ ems_total_sent, 1))
where (and (= ems_usr_logon, usrlogon), (= ems_ist_inst_id,istinstid));
exception : looking for handler
SQL error = -675 ISAM error = 0 error string = = ""exception : no appropriate handler
Any help is much appreciated.
Thanks
Ram S.
Sent via Deja.com http://www.deja.com/
Before you buy.