Re: sqlexit()
Posted in 1997
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL, Security, Permissions & Auditing
I think two seperate questions are being discussed below... Firstly, you can make a 4gl "disconnect" from the engine by a 'close database' and then a 'call sqlexit()'. For example, you could load all your menu items into an array and then "disconnect" from the engine. The benefit of this is that users who constantly leave their sessions sitting at the menu won't be connected to the database. But... secondly, I don't think thats the question Rich is asking. If I'm reading it correctly I think he's looking for a way to run a program whether it be a 4gl or whatever to "disconnect all the users" in one clean swoop to bring the server down for maintenance. (right?) Thinking off the top of my head you could revoke connect permission from public. This would prevent more users from connecting and any connected users would be able to commit their transactions before exiting cleanly. This then leaves you with a diminishing number of users who were still "connected" at the time you revoked to chase off the system before you can bring it down. By revoking the connect privilege the users can't sneak back in once you get them off. ... just an idea. Cheers, Sandy Work: Sandy_Speirs@csg.mot.com Home: sspeirs@iconnect.net = All opinions are my own and not those of my employer = On Sep 3, 1:41pm, Mike Segel wrote: } Subject: Re: sqlexit() } Art S. Kagel wrote: } > } > Rich Sedman wrote: } > > } > > Hi, I havn't been following this group so sorry if this has already been } > > covered or is in the faq. Anyway, I need to disconnect from a database } > > and server in 4gl 6.0 and above (online and SE) so that I can bring the } > > server down. I've found reference to a function sqlexit() but this } > > doesn't seem to exist. 'close database' doesn't quit the sql process } > > either. Anybody come across this before or got any better ideas how I } > > can do the equivalent of a 'disconnect all' in 4gl. } > } > The 6.0 4GL libraries do indeed have both sqlexit() and sqldetach() } > (do: nm $INFORMIXDIR/lib/tools/*.a | fgrep sqlexit to search). But, } > both are "C" functions which take no arguments and returns an integer } > (0 if successful <0 if not successful). You will have to write 4GL } > callable wrappers for these. } > } > Art S. Kagel } This kinda falls into the "Whydcha wanto dothat" (Why do you want to } do that) catagory. } } Implicitly, you want to connect to the informix engine if you } have a 4gl Program. So why would you want to have a 4GL program } without a connection to the engine? } } IMHO, I don't think that it is possible. Anyone take the time } to walk through the C code generated by the 4GL preprocessor? } It would give you a clue how you could hack a way to do this. } (And it would be a nasty hack!) } } -Mikey }-- End of excerpt from Mike Segel