sybase

Selecting the first row from each group, with ORDER BY more than one column

笑着哭i 提交于 2019-12-05 17:19:57
I have a table T with columns x , y , a , b such that SELECT x,y,a,b FROM T ORDER BY x,y,a,b gives me the following table x | y | a | b x1 | y1 | a1 | b1 x1 | y1 | a1 | b2 x1 | y1 | a2 | b1 x1 | y2 | a1 | b1 x1 | y2 | a1 | b2 x1 | y2 | a2 | b1 How would I get the first row of each x,y group? That is, how would I get the following table x | y | a | b x1 | y1 | a1 | b1 x1 | y2 | a1 | b1 Here is a second example: For a table T such that x | y | a | b x1 | y1 | a1 | b3 x1 | y1 | a1 | b4 x1 | y1 | a2 | b1 x1 | y1 | a2 | b2 x1 | y2 | a1 | b3 x1 | y2 | a1 | b4 x1 | y2 | a2 | b1 x1 | y2 | a2 | b2 I am

Sybase Development IDE

陌路散爱 提交于 2019-12-05 17:14:16
Is there a Toad type application for Sybase? I can't seem to find a single one! I've tried using VS 2008 but can't see the sproc source. Am assuming Sybase ASE. Ships with Sybase Central and SQL Advantage as part of the client tools. Sybase Central lets you manage and create tables, views, sprocs etc. SQL Advantage lets you run SQL... Sybase Workspace is a new tool for ASE, I've never tried it. http://www.sybase.com/products/modelingdevelopment/workspace ASE ISQL is a free tool that is also useful for running sql, but is less useful for modifiying stored procedures etc. (More of a SQL

Is there a way to communicate application context to a DB connection in non-Sybase DB servers (similar to set_appcontext in Sybase)?

ぐ巨炮叔叔 提交于 2019-12-05 16:33:31
Sybase has a way for the application to communicate "context" data - such as application's end-user name, etc.. - to the database connection session. Context data is basically just a set of key-value pairs which is stored/retrieved via set_appcontext / get_appcontext stored procs. QUESTION : Do other major DB servers (MSSQL/Oracle/MySQL) have a facility for communicating app context to the session similar to Sybase's set_appcontext ? Details : One specific practical use of app context is when you have an application with middle tier connecting to the database as a very specific generic

How to escape single quotes in Sybase

蓝咒 提交于 2019-12-05 12:31:03
问题 I come from MySQL and the below query doesn't work in Sybase. How should I escape single quotes? UPDATE Animals SET NAME = 'Dog\'s friends' WHERE uid = 12 回答1: If working with Sybase, having got used to MySQL which more database users have experience you may soon discover you are unable to escape single quotes with backslash in. So how do you escape quotes in Sybase? In fact, in Sybase SQL the single quote acts as the escape character. See below for an example UPDATE statement in both

Oracle equivalent to SQL Server/Sybase DateDiff

一笑奈何 提交于 2019-12-05 10:46:42
We are now using NHibernate to connect to different database base on where our software is installed. So I am porting many SQL Procedures to Oracle. SQL Server has a nice function called DateDiff which takes a date part, startdate and enddate. Date parts examples are day, week, month, year, etc. . . What is the Oracle equivalent? I have not found one do I have to create my own version of it? (update by Mark Harrison) there are several nice answers that explain Oracle date arithmetic. If you need an Oracle datediff() see Einstein's answer. (I need this to keep spme SQL scripts compatible

Does sybase 15 support the bcp api in java?

狂风中的少年 提交于 2019-12-05 06:10:09
A long time ago I figured out that bcp is just a little C program that calls the special bit of the sybase client api to do mass data moving into the database. It lies cheats and steals and skips check constraints all in the name of speed. Great, I'm all for it. In sybase 12 I noticed that the api was exposed in the C client library, but not the java one. I've been looking but I haven't found anything that says they've yet implemented it in the sybase 15 java client library. Does anybody know if this is available or not in sybase 15? I disagree with your comments on Java using a BCP api.

python sybase安装

谁都会走 提交于 2019-12-05 03:52:07
一开始不是很了解python-sybase怎么有那么多不同的client啊,ase client,open_client,freetds,真让人迷惑。 最初,当我费了九牛二虎之力,把open_client和python都成功后,却发现,要链接远程主机,还需要使用制定在$SYBASE/interfaces中的名字服务,大怒,于是放弃之。总结一下,只单独安装sybase client的方法,sybase的linux全部包有800M不到,如果只是按照open client的话,其实之需要100M左右就好了:即只按照archives下边的lang和open client,当然了locales下边的那些语言包,要自己从ase的服务器拷贝了。 Grails跟Hibernate和Mongodb的组合 既然oc的那么难用,于是就尝试一下freetds,发现这个东西确实很方便,只需要主机/端口就可以了,而且其安装后也不是很大,才几M而已,如果是red hat,还有现成的rpm可以下载。总之,这个freetds确实挺不错。但是如果用dsql或者python来访问比较新的sybase,会出现: 引用 TDS: unexpected token 45 异常提示,其实这只是sybase服务器发回的locale信息而已,不影响正常的使用,但是如果在python中,却是throw一个异常

sybase 进程状态

删除回忆录丶 提交于 2019-12-05 03:11:26
进程状态及状态含义 alarm sleep 等待警报唤醒进程(用户执行了 waitfor delay 命令) background 由 Adaptive Server 而不是用户进程运行的进程,例如阈值进程 infected 服务器已检测到严重的错误情况;极其少见 latch sleep 等待获取闩锁 lock sleep 等待获取锁 PLC sleep 等待访问用户日志高速缓存 recv sleep 等待网络读取 remote i/o 使用远程服务器执行 I/O runnable 在可运行的进程队列中 running 当前在一个服务器引擎上运行 send sleep 等待网络发送 sleeping 等待磁盘 I/O 或某些其它资源(通常表示正在运行但执行大量磁盘 I/O 的进程) stopped 已停止的进程 sync sleep 等待系列中另一进程的同步消息 来源: https://www.cnblogs.com/ShuT10/p/11901630.html

PHP PDO installation on windows (xampp)

感情迁移 提交于 2019-12-05 03:06:45
I am trying to develop a web app that can connect to as many different databases as possible on PHP. PDO ( http://www.php.net/manual/en/book.pdo.php ) seems to be the right interface for it but I am having trouble installing all the extentions needed for all the different PDO database drivers that I need. Please note that I use xampp on a windows 7 machine. PHP Version 5.3.8. PDO drivers enabled mysql, odbc, sqlite, sqlite2, sqlsrv. I have successfully connected with the following: MySQL using PDO_MYSQL [MySQL (PDO) ] (extension seemed to be installed on xampp by default) Microsoft SQL Server

Cannot insert into table because the table already exists?

二次信任 提交于 2019-12-05 00:07:10
I have a user table. I want to insert data into my user table. I have a statement: SELECT columna, columnb, INTO my_table FROM my_other_table WHERE (... conditions ...) I get the following error: SQL Server Error on (myserver) Error:2714 at Line:1 Message:There is already an object named 'my_table' in the database. Yes, thanks Sybase. I know this. I know the table exists. I want to insert data into it. Why is Sybase not playing nicely? :( (Sybase isn't my forte, Oracle is. This may just be an understanding issue, or lack there of. This would never happen in Oracle...) SELECT ... INTO is for