Skip to Content

SYBASE IQ - Caching service or being able to set Session Variables

I would like to be able to set some application level configuration static data at the session level or global variables so that this data is available to any stored proc and eliminate some database access for these static data.

Is there a way of achieving this?

Thank you.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Feb 22 at 04:26 PM

    If you want to pass information within a session from procedure to procedure or one batch to another you can use temporary table(s).

    Make sure that you create temprary table with name specific to session with date and time stamp and then drop them when you disconnect.

    Tables can be with columns and column types totally to suite your requirements.

    In ASE (SAP/Sybase RDBMS) temporary tables created with # (hash/pound) sign are dropped by housekeeper task.

    Not sure if SAP/Sybase IQ follows similar practice.

    HTH

    Avinash

    Add comment
    10|10000 characters needed characters exceeded

    • Thank you Avinash.

      I do not wish to pass data from one procedure to the other. I would like create some data and make it available to all the procedure very similar to 'Global Variables' or cached data. I am trying to avoid accessing database for very static data.

      Regards

  • Feb 26 at 02:15 PM

    >In ASE (SAP/Sybase RDBMS) temporary tables created with # (hash/pound) sign are dropped by housekeeper task.

    Same syntax works in SAP IQ. It creates local temporary tables. Once user connection ended, the local temp table is dropped.

    https://help.sap.com/viewer/a8937bea84f21015a80bc776cf758d50/16.1.1.0/en-US/a619764084f21015b8039a8346dc622c.html

    Be aware of this create temporary table option:

    ON COMMIT {Delete | preserve} Rows: By default, the rows of a temporary table are deleted on COMMIT.

    Add comment
    10|10000 characters needed characters exceeded