Informix

Informix

Connect with Db2, Informix, Netezza, open source, and other data experts to gain value from your data, share insights, and solve problems.

 View Only
  • 1.  Dynamically setting environment variables

    Posted 20 days ago

    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 1
    Near character position 31
    > set environment optcompind '0';

    Environment set.

    > set environment DBDATE 'Y4MD';

    19840: Invalid session environment variable.
    Error in line 1
    Near 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 --------+
    ------------------------------


  • 2.  RE: Dynamically setting environment variables

    Posted 20 days ago

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



  • 3.  RE: Dynamically setting environment variables

    Posted 20 days ago

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



  • 4.  RE: Dynamically setting environment variables

    Posted 20 days ago

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



  • 5.  RE: Dynamically setting environment variables

    Posted 20 days ago

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