Re: Closing OnLine session
Posted in 1997
}Date: Thu, 1 May 1997 13:33:28 +0300 (GMT) }From: Rudy Fernandes <rferdy@kuwait.net> } }Thanks for your information. } }I've just discovered that there is supposed to be a built-in 4GL }function called SQLEXIT in v6 (Reference Volume 2 Pg 4-83). }This is exactly the function we need. Unfortunately, there's a }small hitch - it doesn't work. A runtime error - function does }not exist - is all one gets instead. The documentation is at fault, in this case. The function documented is the ESQL/C function and does not satisfy the I4GL calling conventions. Consequently, you get errors when you use it. If, instead, you use the i4gl_sqlexit() function I posted, then it works. Since you get a runtime error and not a link-time error, you must be using the p-code system. You'd have to add the i4gl_sqlexit() function to your custom p-code runner, using a declaration such as: extern int i4gl_sqlexit(int); [...] { "i4gl_sqlexit", i4gl_sqlexit, 0 }, [...] in the userfunc.c file or it's equivalent. }Now what? Apply for a refund? Maestro(?), can you check }whether this function works for you? } }With reference to your suggestions, Jonathan, I'm not very clear - }does it mean that without the ESQL/C product, I'm still up the }creek without a paddle? (I don't find fglsys.h in $INFORMIXDIR or }sub-directories) The sqlexit() function is available to the I4GL user -- the libraries that come with I4GL contain it. If you don't have fglsys.h, it means you should probably be upgrading your I4GL. It was first distributed with the 4.14 and 6.02 versions of I4GL, and should be found in incl/tools, along with fglusr.h which documents the user-callable I4GL functions. Yours, Jonathan Leffler (johnl@informix.com) #include <disclaimer.h> }At 09:29 AM 4/30/97 -0700, you wrote: }> }>Several pieces of information: }> }>(1) Version 6.0x I4GL understands precisely the same SQL syntax as 4.1x }> I4GL, the 4.10 engine syntax. CONNECT is too recent (6.00 upwards) to }> be part of the SQL it understands, despite what the version numbers }> suggest. }> }>(2) I posted some ESQL/C code to allow I4GL program to use CONNECT and }> friends via a set of function calls. Check in the IIUG archives }> (http://www.iiug.org) for the source code. }> }>(3) There is another function, sqlexit(), which can be used to terminate }> database connections. It is, however, an ESQL/C function, not an I4GL }> function. You'd have to have some C code in your I4GL to use it: }> }> /* uncompiled, but should be OK! */ }> #include "fglsys.h" /* declares fgl_fatal() */ }> int i4gl_sqlexit(int n) }> { }> if (n != 0) }> fgl_fatal("i4gl_sqlexit", 1, -1318); }> sqlexit(); }> return(0); }> } }> }>(4) DISCONNECT only works with 6.00 and later servers, whereas sqlexit() }> works with earlier versions too.