saquery.com
a web developer' s kung fu…

To get a distinct dataset in MySql and embed it into Javascript in JSON format with PHP we need 3 Steps. SQL Source Code 1st. A SQL query to get a unique domain-name list.

See how smart we can handle Web Requests in SQL Anywhere with a few lines of SQL Code. [inline] Specify HTTP Web service protocol and Port in SQL Anywhere The Database Start Parameter -xs specifies server-side Web service communication protocols. With the internal Webserver we can handle web requests within a SQL Anywhere Server. Simply [...]
Categories: more skills, Sql | Add a Comment
SAQ_DESCRIBE_FOREIGNKEYIn the development environment of a Sybase SQL Anywhere Database, it is simple to analyze and describe the rules of foreign keys. All necessary informations are stored in the system tables of the database. The information can be combined into a useful view.
Categories: Sql | Add a Comment
The following short sql funtions show how to get the root directory within a Sybase Sql Anywhere Database. Note that these methods work on all operating systems. call sa_make_object ('function','SAQ_PATHSEPERATOR'); alter function SAQ_PATHSEPERATOR() returns char(1) begin return(if left(property('platform'),7) = 'Windows' then '\\' else '/' endif); end ; call sa_make_object( 'function', 'SAQ_ROOT_DIR' ); alter function SAQ_ROOT_DIR() [...]
Categories: Sql | Add a Comment
This short procedure shows a way to disconect all clients with an open connection to a Sql Anywhere Database.
Categories: Sql | Add a Comment
largest-possible-value-int32Everybody knows the min and max value properties in .Net. Dim i As Int32 = Int32.MaxValue The values represents the smallest and the largest value for a datatype. For some of us it might be interesting to get this information within a stored procedure.
Categories: Sql | Add a Comment
If you want to code platform-independ stored procedures, it is important to know the path seperator character to build some path strings while working with files and directories on different operating systems. It is possible to determine the operating system the database server is running on. So far we know that Windows is the only platform using [...]
Categories: english | Add a Comment
Display Date/Time as GMT in Sql Anywhere select cast('1995-12-15 04:58:08.000' as dateTime) as _d, DATEFORMAT('1995-12-15 04:58:08.000', 'Ddd, DD Mmm YYYY HH:MM:SS') || ' GMT' DATE_LNG, CASE DATEPART(cdw, _d) WHEN 1 then 'Mon' WHEN 2 then 'Tue' WHEN 3 then 'Wed' WHEN 4 then 'Thu' WHEN 5 then 'Fri' WHEN 6 then 'Sat' WHEN 7 then [...]
Categories: english | Add a Comment
Read XML with BOM Data from GZ file in a SQL Anywhere Database. select cast ( CSCONVERT(decompress(xp_read_file('c:\x.gz')), 'char_charset', 'utf-8', 'read_bom=on' ) as XML)
Categories: english, Sql | Add a Comment
With this statement you can select the database methodes currently in use by a connection in a Sql Anywhere database. select isnull(connection_property ('CurrentProcedure',number),'') currentProc, * from sa_conn_info(); The select statement returns the following result where currently no procedure is in use. currentProcNumberNameUseridDBNumberLastReqTimeReqTypeCommLinkNodeAddrClientPortServerPortBlockedOnLockRowIDLockIndexIDLockTableUncommitOps 2SQL_DBC_1972bfe8DBA02010-10-05 19:34:58.765FETCHlocal00000 1Sybase Central 3DBA02010-10-05 19:34:57.229CLOSElocal00000