Informix Stored Procedures...HELP

Informix Stored Procedures...HELP

Post by ashl.. » Sat, 03 Feb 1996 04:00:00

Hi, I've been programming and struggling with PowerBuilder with regards
to the Informix backend.  I can get my stored procedures to run fine
using DBACCESS, but I can't get a DataWindow to use a stored procedure
as its source and pass it parameters.  I keep getting 201 errors...they
don't help a thing... I have tried a gazillion methods.

Please help!!!

Ashley Harms




I'm having a problem using stored priocedures with PB4.0 & my
Informix databse.

heres the ifx stored proc:

CREATE PROCEDURE sp_iscidok( q_cid char(6)) returning int;

   define xcid char(6);
   define sqlerr int;

   ON EXCEPTION set sqlerr;
   if sqlerr = 100 then
      return 0;
      return 1;
   end if

   select unique cid into xcid from client where cid = q_cid;

this creates a valid sp in my ifx db that shows up in PB4.

Now I try to create a fundtion in PB4 that executes that sp so I can
validate if a client exists.

int f_check_client(string cid)

when in the function painter, I go to edit/paste sql/procedure/declare -
this brings up a dialog box that allows me to select my sp. My sp is
shown and the source shows up down below in the source section. I select
my proc & then get a "save stored procedure" dialog that wants me to
enter an alias name. I do this & am returned to the function painter.

The problem is that my sp needs to be passed a parameter & there is no
syntax created here for that. At this point my function looks like:

int r

DECLARE isok PROCEDURE for dbt.sp_iscidok;

if sqlca.sqlcode = 0 then
   FETCH isok into :r;
end if

return r

This is no good as no arg gets passed to the sp. I tried altering the
declare statement as described in the PB manual for Powerscript language
page 104. As follows:

int r
string thecid

return r;

this gives me a 201 error when compiling (201 is the ifx code for
general syntax error).

In addition when I use edit/paste sql/procedure/fetch - I get no
reference to my sp ihn the dialog - it doesn't show up.

Can anybody help me?

Thanks in advance - Mike


RPCG, Inc.  70 Hudson St.  Hoboken, NJ  07030
All opinions expressed herein belong to me - not RPCG.

2. really slow solidworks98plus

3. Has anyone implemented a LCS algorithm in a stored procedure or extended stored procedure?

4. Minix on a Goupil

5. Stored Procedures using an Informix Database

6. wheel-mouse

7. Executing Informix Stored procedure from PB

8. SGI - Flashing windows V17

9. Writing Informix Stored Procedures

10. Stored Procedures in INFORMIX: Why cant I do a DECLARE CURSOR !!!!

11. Stored Procedure + Informix

12. Stored procedures in Informix

13. fetch store Procedure from sybase store Prodcedure