Re: mssql_execute(): stored procedure execution failed

Robert Gonzalez <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <[email protected]>
If possible, take the return from mssql_init() and check it for boolean
false. If it is, try to trap the error returned from the server with
mssql_get_last_message(). All of the errors you see after the mssql_init()
failure are because you are trying to pass a boolean value (in this case, a
FALSE) to functions that expect an initialized stored proc resource handle.



On Fri, May 21, 2010 at 8:11 AM, Sylvain Viart - Gmail <
[email protected]> wrote:

> Hi,
>
>
> > It's unlikely anyone unfamiliar with your environment can help you
> > without a much more detailed definition of "works".
>
> Sorry about that, our problem is that its legacy php code.
>
> I've errors like :
>
> mssql_init(): unable to init stored procedure
>
> But the same page may work if I hit reload.
>
> >> Does it give any error messages when it doesn't work?
>
> PHP Warning:  mssql_init(): unable to init stored procedure in
> read_msg.php on line 46
> PHP Warning:  mssql_execute() expects parameter 1 to be resource,
> boolean given in read_msg.php on line 47
> PHP Warning:  mssql_free_statement() expects parameter 1 to be resource,
> boolean given in read_msg.php on line 48
>
> PHP Warning:  mssql_init(): unable to init stored procedure in
> read_msg.php on line 126
> PHP Warning:  mssql_bind() expects parameter 1 to be resource, boolean
> given in read_msg.php on line 129
> PHP Warning:  mssql_execute() expects parameter 1 to be resource,
> boolean given in read_msg.php on line 131
> PHP Warning:  mssql_free_statement() expects parameter 1 to be resource,
> boolean given in read_msg.php on line 132
> PHP Warning:  mssql_num_rows() expects parameter 1 to be resource, null
> given in read_msg.php on line 133
>
> >> Does it run but return incorrect  results?
>
> not really:
> all is dependent of the previous error failing to init the stored
> procedure.
>
>
> >> What exact differences are there in a server-side trace for
> >> the case where it works compared to the case where it doesn't?
> >>
> Sorry I'm not able to extract part of the log, because I can see where
> it match the failing php statement.
> could you give me clue about setting a less verbose freetds log?
>
>     dump file = /tmp/freetds.log
>     debug flags = 0x2006
>
> Or any help to isolate the error? (URL ?)
> I'm not freetds familiar, can I restrict logging to a specific vhost?
>
> It's on a production server, if I set debug flags 0x4fff. I got a lot of
> output that I can't use for the moment.
>
> > What exact differences are there in the log between the case that
> > doesn't work and the one that does, or between your old FreeTDS
> > version and the new one?
> >
> I don't know how to do that.
>
>
> We have supposed a problem with encoding, or persistent connection.
> do you have any URL where I can learn about how to trace the error more
> precisely?
>
> Regards
> Sylvain.
>
> _______________________________________________
> FreeTDS mailing list
> [email protected]
> http://lists.ibiblio.org/mailman/listinfo/freetds
>



-- 
Robert Gonzalez
http://www.robert-gonzalez.com
http://twitter.com/RobertGonzalez
http://www.linkedin.com/in/robertanthonygonzalez
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.