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
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