Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Accessing ingres variables from embedded C/4GL and abf programs

12 views
Skip to first unread message

Priyesh Patel

unread,
Jan 22, 2000, 3:00:00 AM1/22/00
to
Hi,

Anyone know of an elegant way of access ingres variables (ones defined by
ingsetenv) from programs written in C, 4GL or abf.

Regards
Priyesh Patel
www.london-uk.co.uk

Julian Sharp

unread,
Feb 7, 2000, 3:00:00 AM2/7/00
to
Priyesh Patel <pri...@mercurie.co.uk> wrote in message
news:86bqjr$8qc$1...@ayers.ftech.net...

> Hi,
>
> Anyone know of an elegant way of access ingres variables (ones defined by
> ingsetenv) from programs written in C, 4GL or abf.
>

There isn't one.

You could write some C to read $II_SYSTEM/ingres/files/symbol.tbl
or
You could write a shell script that copies all variables set using ingsetenv
that exports the variables using the ingprsym utility e.g.,
export II_TIMEZONE_NAME=`ingprsym II_TIMEZONE_NAME`
This could be built into the system profile ot whereever
and then use the genenv C funtion to write a C routine in your ABF app
e.g.,

int get_env (env_var_name, env_var_value)
char *env_var_name;
char *env_var_value;
{
char *getenv();
char *h_envvar;

h_envvar = getenv (env_var_name);
if (h_envvar == (char *) 0)
{
strcpy (env_var_value, "");
return (0);
}
else
{
strcpy (env_var_value,h_envvar);
return (1);
}
}

and from ABF

h_env_var=varchar(20);
..
h_status = get_env('II_TIMEZONE_NAME',byref(h_env_var))

Julian

0 new messages