Informix

 View Only
  • 1.  dbaccess: Connect to Servers

    Posted Thu May 14, 2020 09:19 AM
    Hi All,
    In dbaccess when we traverse to 'Connection' tab, it lists a set of Informix Servers available.
    From where does dbaccess picks up this available servers?

    #Informix


  • 2.  RE: dbaccess: Connect to Servers

    IBM Champion
    Posted Thu May 14, 2020 09:21 AM
    AFAIR sqlhosts 

    Paul Watson
    Oninit LLC
    +1-913-387-7529
    www.oninit.com
    Oninit®️ is a registered trademark of Oninit LLC





  • 3.  RE: dbaccess: Connect to Servers

    IBM Champion
    Posted Thu May 14, 2020 09:25 AM
    It reads the sqlhosts file in the etc directory or the file indicated in
    the $INFORMIXSQLHOSTS environment variable if that is set

    --
    Cordialement, Regards,

    Khaled Bentebal

    Email: khaled.bentebal@consult-ix.fr
    Site Web: www.consult-ix.fr




  • 4.  RE: dbaccess: Connect to Servers

    IBM Champion
    Posted Thu May 14, 2020 02:02 PM
    Saradhi:

    SELECT * FROM sysmaster:syssqlhosts;

    Art

    Art S. Kagel, President and Principal Consultant
    ASK Database Management


    Disclaimer: Please keep in mind that my own opinions are my own opinions and do not reflect on the IIUG, nor any other organization with which I am associated either explicitly, implicitly, or by inference.  Neither do those opinions reflect those of other individuals affiliated with any entity with which I am affiliated nor those of the entities themselves.








  • 5.  RE: dbaccess: Connect to Servers

    Posted Fri May 15, 2020 03:56 AM
    Hi Paul, Khaled and Art,
    Thank you.





  • 6.  RE: dbaccess: Connect to Servers

    IBM Champion
    Posted Fri May 15, 2020 10:49 AM

    Art:

    The Connection menu option of dbaccess does not use the query:

    SELECT * FROM sysmaster:syssqlhosts;

    The connection menu option uses the sqlhosts file since there is no connection yet at that point. Once you establish a connection(SID and TID), you can use an SQL query that will be analyzed by the sqlexec parser.

    You need to first have a session in the SCB and a thread in the TCB in order for the sqlexec thread to execute an SQL instruction. The connection menu option always reads the sqlhosts file directly. Even if you do not have the sysmaster:syssqlhosts pseudo table (possible sometimes if the sysmaster is not there), the connection menu option works and lists the contents of the sqlhosts file.

    It is true that the SELECT * FROM sysmaster:syssqlhosts; reads the contents of the sqlhosts file after the connection is performed

    --    Khaled Bentebal  Email: khaled.bentebal@consult-ix.fr Site Web:  www.consult-ix.fr  





  • 7.  RE: dbaccess: Connect to Servers

    IBM Champion
    Posted Fri May 15, 2020 11:19 AM
    Khaled:

    Your point in valid and well taken, dbaccess menus do not use sysmaster but read in sqlhosts file itself. However, I think that Saradhi's question went to how he could get the same information and it is far easier to read sysmaster:syssqlhosts than to parse the file directly.

    Art

    Art S. Kagel, President and Principal Consultant
    ASK Database Management


    Disclaimer: Please keep in mind that my own opinions are my own opinions and do not reflect on the IIUG, nor any other organization with which I am associated either explicitly, implicitly, or by inference.  Neither do those opinions reflect those of other individuals affiliated with any entity with which I am affiliated nor those of the entities themselves.