Re: sybase function for MS-SQL Server

From: Date: Fri, 29 Jun 2001 21:45:59 +0000
Subject: Re: sybase function for MS-SQL Server
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-9988@lists.php.net to get a copy of this message
I am almost crazy now after playing with these codes over 10 hours. I don't expect to call sybase_query() one by one for executing sql batch. It just doesn't work for me like what I said yesterday. Now I try to make a stored procedure for these sql batch. So I can call sybase_query() only once. But sometimes it works and sometimes not, it depends on what is in the stored procedure. And I am sure that every stored procedure I put into sybase_query() can be run on "SQL Server Query Analyzer" perfectly. e.g. SP1: (works) CREATE PROCEDURE SP1 AS insert into mytable values(...) select * from mytable SP2: (doesn't work) CREATE PROCEDURE SP2 AS select * from mytable select * from mytable SP3: (doesn't work) CREATE PROCEDURE SP3 AS insert into mytable values(...) insert into mytable values(...) It looks that the sybase_query() is not stable. I am not the person doing freetds setup on this Unix machine. Do you think this is a freetds related problem? --- olinux o <olnx@yahoo.com> wrote: > test > > --- jong jong <jxu158@yahoo.com> wrote: > > Hi, > > > > I am working on Unix(Solaris 2.8) with Apache 1.3 > > and > > php4. I need to connect MS-SQL Server without > ODBC. > > Someone told me that sybase functions can work > with > > MS-SQL Server. So I called sybase_xxx() > > instead of mssql_xxx(). I was surprised that most > of > > them really work! But the problem is that > > sybase_query() seems only work for "select ..." > > statement. When I tried to pass > > "insert...","update..." or "delete...", this > > function > > returned "false", but the database was actually > > updated. And the following sybase_query() would > > always > > return "false" even it is for "select...". > > > > Here is an example: > > $conn=sybase_connect("MS-SQL > > Server","login","password"); //successful > > sybase_select_db("db",$conn); //return true > > $result=@sybase_query("select ...",$conn); > //Great! > > That's what I want. > > sybase_free_result($result); //no problem so far > > $result=@sybase_query("insert ...",$conn); > //return > > false, but I did insert a new record into SQL > > Server. > > sybase_free_result($result); //successful > > $result=@sybase_query("select...",$conn); //return > > false, can't work with "select..." any more. > > ... > > > > Anybody had same experience before? I will > > appriecate > > any information from you. > > > > Wen > > > > > > __________________________________________________ > > Do You Yahoo!? > > Get personalized email addresses from Yahoo! Mail > > http://personal.mail.yahoo.com/ > > > > -- > > PHP Database Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: > > php-db-unsubscribe@lists.php.net > > For additional commands, e-mail: > > php-db-help@lists.php.net > > To contact the list administrators, e-mail: > > php-list-admin@lists.php.net > > > > > __________________________________________________ > Do You Yahoo!? > Get personalized email addresses from Yahoo! Mail > http://personal.mail.yahoo.com/ __________________________________________________ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail http://personal.mail.yahoo.com/

« previous php.db (#9988) next »