Re: pf_getval problem
Posted in 1996
In article <Dq9wpt.I4J@world.std.com>,
Robert Brass <bbrass@world.std.com> wrote:
>Hi,
> This is a long and sticky mess but this is the jist of it...
>I had a solaris 2.3 system on a sun sparc. It had Informix SE 5.x and
>isql 4.x and esql 4.x. We upgraded to solaris 2.4 and upgraded our informix to the recommended versions for 2.4(still using 5.x engine). Unfortunately the
>isql and esql did not work together. You could not use forms that calli
>C functions. The isql and esql libs can not be linked together.
In other words, you changed your ESQL to 5.X, right? This makes creating
ESQL/C customized Ace/Perform runners impossible.
> I restored the whole
>OS from tape including the old informix. The forms still do not work they
>core dump when they call pf_getval.
Did you try reinstalling the old products from original media?
>Program received signal SIGSEGV (11), Segmentation fault
>0x28d00 in pf_getval ()
>(gdb) where
>#0 0x28d00 in pf_getval ()
This could be because you have the parameters backwards.
>The code I am testing with looks like this ...
>
>#include "ctools.h"
>#include "acct.h"
>$include sqlca;
>
>valueptr bob();
>
>$ int id_num;
>$ char col_name[7];>
>/**********************************************************************
> ALL functions must be listed here!
>*****************************/
>struct ufunc userfuncs[] =
>{
> "bob", bob,
> 0,0
>};
>
>valueptr bob()
>{
> pf_getval("lc",col_name, CCHARTYPE,8);
> strcpy(col_name, "status");
> pf_putval("bob", CCHARTYPE, col_name);
Here's your problem. The third parm is supposed to be your tag name.
col_name should be the *first* parm, and you need a field tagged "bob"
in the form.
>}
>The form looks like the following...
>database cpmmdl
>
>screen
>{
> TABLES: (1) cust_pros
>
> ID # [cid ] Last Contact [lc ]
>}
>end
...
This works using the demo with 4.1 ESQL/C and 4.16 ISQL:
(bob.ec)
#include "ctools.h"
/* #include "acct.h" */
$include sqlca;
valueptr bob();
$ int id_num;
$ char col_name[7];
/**********************************************************************
ALL functions must be listed here!
*****************************/
struct ufunc userfuncs[] =
{
"bob", bob,
0,0
};
valueptr bob()
{
pf_getval("lc",col_name, CCHARTYPE,8);
strcpy(col_name, "status");
pf_putval(col_name, CCHARTYPE,"bob");
}
(bob.per)
DATABASE stores
SCREEN
{
------------------------------------------------------------------------------
ORDER FORM
------------------------------------------------------------------------------
Customer Number:[f000 ] Contact Name:[lc ][f002 ]
Output from bob:[bob ]
}
TABLES
customer
ATTRIBUTES
f000 = customer.customer_num;
lc = customer.fname;
f002 = customer.lname;
bob = customer.address1;
INSTRUCTIONS
after editadd editupdate of fname
call bob()
end