Passing DSQUERY as parameter when opening exclusive urouter connection in SYBASE

Author: lalitpct@gmail.com (lalitpct)

We are opening an exclusive connection by below command and then on server asn we have hardcoded the servername (server1 in below example) for database connection (SYBASE) , at present we have 14 different servers (server1 to server14 ) . Exclusive connection ------------------------- open "|%%ID|%%$PINFO$|%%$$SERVER /ex", "$LOG/NET" server.asn ---------------- [PATHS] $DEF SYB:server1.database1|?|? because we have hardcoded server1 i need to create 14 different asn files for each server , is it possible I can pass this as parameter from open statement . In the uniface documnetation i checked that if i dont provide server name then it will connect to server specified to variable DSQUERY , but not sure how do i set that as for that . In short below things will be helpful 1)if servername can be passed from open connection 2)if we can set DSQUERY the momment we can connect to server. 3)Any other way i can avoid for 14 differetnt asn file.

9 Comments

  1. Hi lalit, if your database runs on your client machine, you may use $setting (from the 9.6.01 X103 documenation:) ENVDATA Get or set an environment variable, logical, or data area. Wildcards are not allowed. The maximum length that can be assigned to an environment variable is 4096 bytes I'm a bit confused because your open example looks more like a network, but not a database open. But under an exclusive connection, setting environment variables with a service on the server may do the job as well. setting environment variables in windows may be a bit complicated, so you have to experiment a little bit in the first place. Uli P.S. it's not so complicate to maintain the 14 ASN files if you use the #FILE option to include all settings but your database line.


    Author: ulrich-merkel (ulrichmerkel@web.de)
  2. Hi Uli, Thanks for the response , Yes this is open network and the asn used on server side to open that has got database details(server and database) , can you please give more details about how I can set environment variables on sever side (running on unix) using services. Client is on windows but once user opens application after that user will get option to select server (which is specific to database) , once the server is selected I need to set the database using DSQUERY variable. Regards Lalit


    Author: lalitpct (lalitpct@gmail.com)
  3. Hi Lalit, AFAIK (long ago) you can use the UNIX ".profile" or ".cshrc" to set variables etc. depending on the user you use to open up the network connection. So when you log in to the network as UserA, a different autoexec.bat (as in good old DOS times) is executed as if you log in to the network as UserB. Never been a real UNIX man, but this may help you looking for clues (perhaps you can google about Environmenvariables and UNix). Uli


    Author: ulrich-merkel (ulrichmerkel@web.de)
  4. Hi Uli, Thanks yes u r right at present we are setting using .profile but .cshrc , but that is set while opening the connection itself so we default to one database server . Once the screen comes to select database server I should be able to change the database server as well , which I am not sure how to set new one . I tried setting using osunix (os related commands on server ) but I think it doesnt keep ot for session ..


    Author: lalitpct (lalitpct@gmail.com)
  5. Hi lalit, you have 14 different users on the unix box, each setting a different server as DSQUERY. The rest of the scripts are the same for all 14 users. Depending on the open "|%%ID| where ID specifies the network user, you get a selection of the databases.


    Author: ulrich-merkel (ulrichmerkel@web.de)
  6. we use only one id to login so profile can set only one , below is sequence 1)There is a router running on asn which takes the request it points to server specific asn files and startup.asn files. 2)Click on client which has port number and server details, it will connect to urouter and use startup.asn. 3)At this time because of shell profile we set default DSQUERY to one server. 4)Now the screen appears which has list of servers. 5)Here if the users uses the default server it is ok , but if he chooses some other server It still points to the default one. changing DSQUERY after logging seems difficult as I tried setting it again using os level commands in uniface without sucess.


    Author: lalitpct (lalitpct@gmail.com)
  7. Maybe I completely misunderstand the problem, but if I do not it is very simple: Define 14 extra paths is your asn file. When the user selects something other than your default path: - use the close statement to close the database connection - issue a new open statement with the chosen path in the PathString (where you currently use "$LOG/net") Theo


    Author: Theo Neeskens (tneeskens@itblockz.nl)
  8. You'd have to pass which path they wanted to use to each operation of shared servers, or have an operation on a service which allowed you to set the current path in the case of exclusive services.


    Author: Iain Sharp (i.sharp@pcisystems.co.uk)
  9. Hi Iain Thanks for the response , I didnt get how in the operation of a servce i will set the database server. If i could do that it in the service why not set it when I am opening exclusive connection to network itself (not sure how to do that). I have the database server name when opening exclusive connection for network as shown below ($$SERVER is same as database server) open "|%%ID|%%$PINFO$|%%$$SERVER /ex", "$LOG/NET"


    Author: lalitpct (lalitpct@gmail.com)