in reply to ENV Object?

Others have replied with useful solutions, however, from your message it's not clear if you are using Sybase::CTlib or DBD::Sybase. My guess is that it's Sybase::CTlib. It doesn't really make that much difference, but you need to make sure that the SYBASE env. variable is set correctly when the "use Sybase::CTlib" statement is executed.

If you are using Apache the easiest way to do this is to add a SetEnv directive to your httpd.conf file.

You can also rebuild Sybase::CTlib and enable the EMBED_SYBASE option (see the CONFIG file). This option adds a hard-coded $ENV{SYBASE} setting in the CTlib.pm file, which is usefull in some situations.

Michael

Replies are listed 'Best First'.
Re: Re: ENV Object?
by Warped (Initiate) on Oct 30, 2001 at 21:24 UTC
    I am using Sybase::Ctlib on SunOS 5.6.It's a corporate machine so I can't touch the CONFIG file or the CTlib.pm file. I am using your documentation for my calls.I set my first statement (after defining the perl path ) to BEGIN{$ENV{SYBASE}='/sybase';}and it worked. I have another question which you would be the best person to answer since sybhelp is telling me that it can't load .CTlibHelptextMsgs (and I can only find *TextMsgs files for desedit_dce,sqlupgrade,sqlloc,srvbuild and sybsetup). I am getting the following error:

    Open Client Message: Message number: Layer=(1) ORIGIN=(1) SEVERITY=(1) NUMBER=(159)
    Message String: ct_cmd_drop():user api layer: external error: This routine can be called only if the command structure is idle.

    I can not find any documentation on ct_cmd_drop(). What type of logic error should I be looking for in my code?

      ct_cmd_drop is usually only called when you close your connection (i.e. when the database handle is destroyed). The error message means that when ct_cmd_drop() was called there were still results pending, which usually points to an incorrect fetch loop in your code.

      So I suggest that you take a look at your code and make sure that you process all the data that is returned by the server, or that you call ct_cancel() if you want to throw the remainder of the results away.

      Michael

        Thanks.