Dynamically setting environment variables
Answered: green (solid confidence) — SET ENVIRONMENT does not support DBDATE, PSORT_NPROCS or PSORT_DBTEMP; the asker accepted this and filed an RFE for the feature.
Advisory only.
Posted in 2026
Jacob Salomon tried to set PSORT_NPROCS, PSORT_FBTEMP and DBDATE inside an SQL script and got error 19840, invalid session environment variable. Mike Walker said SET ENVIRONMENT does not support those variables. Jacob entered the idea as RFE INFX-I-709 and will keep setting them in the shell. Not possible currently.
Topics: Server Administration
Greeting y'all, an especially to Jose Manuel, who started the thread "
Dynamically setting PDQPRIORITY and OPTCOMPIND
for a session within a Procedure".
I have run a few SQL scripts and forgotten to set environment variables like PSORT_NPROCS, PSORT_FBTEMP, and DBDATE. I have to remember to set these at the shell level before starting dbaccess. Wouldn't it be great if I could set these in the SQL script? So Jose's question put the idea into my head: Lemmy try that with env variables I listed above. It didn't go as hoped:
$ dbaccess whatever -Database selected.
> set environment PSORT_NPROCS '4';19840: Invalid session environment variable.
Error in line 1Near character position 31
> set environment optcompind '0';Environment set.
> set environment DBDATE 'Y4MD';19840: Invalid session environment variable.
Error in line 1Near character position 28
One difference I see is that
OPTCOMPIND is an onconfig parameter, while PSORT_NPROCS and DBDATE are not. BTW, I've tried it with and without the quote and I have tried "set DBDATE Y4MD".
It would be nice if I could indeed set my environment variables
within my SQL session. I woud not be forced to embed my SQL sessions inside a shell script.
Your thoughts, all?
------------------------------
+-----------------------------------------------------------+
| I am pleased to report that I had no problems today. |
| I had only issues, opportunities, challenges and valuable |
| learning experiences. |
+------------------------------------------ Jacob S --------+
------------------------------
The documentation shows a number of env variables that you can change with the "SET ENVIRONMENT" statement.
SET ENVIRONMENT statement - IBM Documentation
Unfortunately, this does NOT include DBDATE, PSORT_NPROCS, or PSORT_DBTEMP.
------------------------------Mike Walker
xDB Systems, Inc
www.xdbsystems.com
------------------------------
Thanks, Mike; I needed that. But now that Jose Manuel has released that Djinni for me, it won't just go back in its bottle. I'm still living in the past, where Informix kept an internal FRDB database in-house, to record user requested new features. (Feature Request DataBase) I recall a button to click in this forum, to make a new feature request. This a a great (IMHO) candidate for such a request. Anybody wanna point me in the right direction? Thanks. ------------------------------ +-----------------------------------------------------------+ | I am pleased to report that I had no problems today. | | I had only issues, opportunities, challenges and valuable | | learning experiences. | +------------------------------------------ Jacob S --------+ ------------------------------
There's a handy dandy link to the RFE portal in the Informix Insider newsletter. IBM Data Platform Ideas Portal for Customers ------------------------------ Mike Walker xDB Systems, Inc www.xdbsystems.com ------------------------------
Thanks, Mike. I've bookmarked that. I just entered it as an RFE: INFX-I-709 But, in the meantime, I will just do what I've always done: Forget to set these and remember when I get the error. ------------------------------ +-----------------------------------------------------------+ | I am pleased to report that I had no problems today. | | I had only issues, opportunities, challenges and valuable | | learning experiences. | +------------------------------------------ Jacob S --------+ ------------------------------