★ wanayoo — archive 1999 http://www.php.net/manual/function.sybase-query.phpNouvelle recherche | Portail wanayoo

PHP Home Page

Manual Table of Contents
Up to Sybase
Quick Reference
German version of this pageJapanese version of this pageItalian version of this pageFrench version of this pageHungarian version of this page
Sybase
* sybase_affected_rows
* sybase_close
* sybase_connect
* sybase_data_seek
* sybase_fetch_array
* sybase_fetch_field
* sybase_fetch_object
* sybase_fetch_row
* sybase_field_seek
* sybase_free_result
* sybase_num_fields
* sybase_num_rows
* sybase_pconnect
* sybase_query
* sybase_result
* sybase_select_db
Manual: sybase_query
View the source code for this pageSearch the site



Previous page
 sybase_pconnect
 Updated
Sat, 12 Aug 2000
sybase_result 
Next page


sybase_query

(PHP3 , PHP4 )

sybase_query -- send Sybase query

Description

int sybase_query (string query, int link_identifier)

Returns: A positive Sybase result identifier on success, or false on error.

sybase_query() sends a query to the currently active database on the server that's associated with the specified link identifier. If the link identifier isn't specified, the last opened link is assumed. If no link is open, the function tries to establish a link as if sybase_connect() was called, and use it.

See also: sybase_db_query(), sybase_select_db(), and sybase_connect().


User Contributed Notes: sybase_query


verdy_p@wanadoo.fr
24-Jul-1999 03:00
This function can be used to call stored procedures, or to process multiple queries in the same call in the same "batch". However there's a limit on the kind of stored procedures you can call, because Sybase allows a stored procedure or "batch" to return multiple result sets, and because the surrent implementation of sybase support in PHP3 has no provision to process each result set, one after one. If your stored procedure or batch has multiple result sets returned, you will only be able to retrieved the first result set in you PHP3 script. Note that other result sets won't be processed by the SQL server until you close the current result set. So this may suspend the execution of a stored procedure or batch on the SQL Server. Note also that if a stored procedure or batch uses "print" or "raiserror" SQL statements, you won't be able to collect the returned messages in the result set, because these statements do not generate a result set but instead return asynchronous server messages which currently have no support in the sybase PHP3 set of functions.
It would be a good idea for someone to add the support for queries that return multiple result sets and server messages, so that any kind of Sybase SQL queries can be used in PHP3 scripts.
This would require adding a function to go to the next results set, and a function to retrieve server messages generated before, between, and after each result sets. Note also that server messages could be sent within a result set, this won't be from "print" or "raiserror" SQL statements but internal server errors while processing a result set returned by a SELECT statement, or messages generated by triggers. There could also exist asynchronous client messages while processing any kind of return (result set or server messages), and there's for now no function to return them. Such client messages mainly signal connection status and data conversion errors.



ilya@vtrails.com
21-Feb-2000 06:42
This is true for stored procedures' execution results, too. If you have a result set and a status returned, you will only be able to access the result set. Argh.


 About Notes


Previous page
 sybase_pconnect
 Updated
Sat, 12 Aug 2000
sybase_result 
Next page





Who's responsible for this?
Top of this page

Site
Hosting:



Located in
United States
Elements of this website are subject to copyright.
Questions about installing or using PHP should be directed to one of the mailing lists.
Only questions about the website should be directed to webmaster@php.net.