sybase-ase

Is there any function like REPLACE?

不羁岁月 提交于 2019-12-05 12:20:31
Is there any function to replace words in ASE? deepak Try this: SELECT str_replace( 'impossible', 'im',':)' ) select str_replace(original,search,replacement) ASE does not have 'REPLACE' but 'str_replace' This will return varchar(LONG), you may have use cast to shrink it back down. REPLACE ( original-string, search-string, replace-string ) SELECT REPLACE( 'abc,def,ghi,jkl', 'abc', 'xx' ) FROM products 来源: https://stackoverflow.com/questions/6547383/is-there-any-function-like-replace

Using Sybase ASE 12.5.4 with jTDS drivers with JRuby

谁说胖子不能爱 提交于 2019-12-05 02:07:56
问题 Problem I am trying to build a small ruby script - which will be run using jruby once a day - to connect to a Sybase ASE 12.5.4 database and perform a complex query. Ultimately I intend to do some processing on the data and insert the new data in a MySQL table for use within a rails application. Environment jruby v1.4.0 java v1.6.0_15 on Ubuntu Karmic JRuby Installed Gems activerecord-jdbc-adapter (0.9.1) activerecord-2.3.4 Jruby Lib Directory jtds-1.2.5 Query SET rowcount 10 SELECT * FROM

Windows 8 OLEDB / ADO.NET drivers for Sybase ASE?

半腔热情 提交于 2019-12-04 15:50:37
Has anyone successfully installed Sybase OLEDB drivers and Sybase Central on a Windows 8 (64 bit) system? I've tried the installers on the Sybase website but they fail. Searches for "Windows 8" on the Sybase site and "Sybase Windows 8" on Google are bringing up nothing. We have a developer here who installed them on a Windows 7 system and then did an OS upgrade to Windows 8 so I know they will work. I would rather not uninstall Windows 8 and go that route if I can help it though. I managed to solve this! It seems like the actual GUI (written in Java) doesn't work in Windows 8, but there is a

Cannot register Sybase 15 ASE OLE DB driver on Windows 7

白昼怎懂夜的黑 提交于 2019-12-04 12:49:36
I am trying to get the Sybase 15 ASE OLE DB driver set up on my Windows 7 machine. I already have the Adaptive Server Enterprise driver listed in the Drivers tab of my 32-bit ODBC Data Source Administrator (C:\Windows\SysWOW64\odbcad32.exe). I tried to re-register the DLL with the command regsvr32 sybdrvoledb.dll and with C:\Windows\SysWOW64\regsvr32.exe sybdrvoledb.dll from a command prompt running as admin, and in both cases I get back "DllRegisterServer in sybdrvoledb.dll succeeded" but when I check in the ODBC administrator the driver is still not listed. Is there another way to get the

How to simulate GREATEST() in Sybase ASE?

拟墨画扇 提交于 2019-12-04 10:41:59
Most databases have something like a GREATEST function, which can be useful some times. At least these databases don't have such a function: Derby SQL Server Sybase ASE Sybase SQL Anywhere For SQL Server and Sybase SQL Anywhere, the function can be simulated using subqueries and UNION ALL , as can be seen in this question here . An example: -- SELECT GREATEST(field1, field2, field3) FROM my_table SELECT (SELECT MAX(c) FROM (SELECT my_table.field1 AS c UNION ALL SELECT my_table.field2 UNION ALL SELECT my_table.field3) T) AS greatest FROM my_table But this doesn't work in Sybase ASE. Apparently,

Is there a good way to do this in SQL?

此生再无相见时 提交于 2019-12-04 10:21:06
I am trying to solve the following problem entirely in SQL (ANSI or TSQL, in Sybase ASE 12), without relying on cursors or loop-based row-by-row processing. NOTE: I already created a solution that accomplishes the same goal in application layer (therefore please refrain from "answering" with "don't do this in SQL"), but as a matter of principle (and hopefully improved performance) I would like to know if there is an efficient (e.g. no cursors) pure SQL solution. Setup : I have a table T with the following 3 columns (all NOT NULL): ---- Table T ----------------------------- | item | tag | value

Sybase BCP vs MS SQL BCP

Deadly 提交于 2019-12-04 05:14:02
问题 I have a multi-database setup that I need to work with and both have their own bcp versions that do not act the same way. Plus both are in my %PATH% and the Sybase one is listed before the MS SQL exe so calling "bcp" from the command line always hits the Sybase exe. First, the versions are "different": Sybase BCP: Sybase CTBCP Utility/15.0/P-EBF17890 ESD #24/PC Intel/BUILD1500-123/OPT/Thu May 13 02:45:43 2010 (for Adaptive Server Enterprise/15.7/EBF 23008 SMP SP130 /P/RS6000/AIX 6.1

Upsert (update or insert) in Sybase ASE?

谁说胖子不能爱 提交于 2019-12-04 02:10:17
I'm writing an application to move data from Oracle to Sybase and need to perform update / insert operations. In Oracle, I'd use MERGE INTO, but it doesn't seem to be available in Sybase (not in ASE, anyway). I know this can be done with multiple statements, but for a couple of reasons, I'm really trying to get this into a single statement. Any suggestions? Ritter ASE 15.7 has this feature. Find the docs here: http://infocenter.sybase.com/help/topic/com.sybase.infocenter.dc36272.1570/html/commands/commands84.htm unfortunately, it is impossible to insert and update a table in one statement

Using Sybase ASE 12.5.4 with jTDS drivers with JRuby

£可爱£侵袭症+ 提交于 2019-12-03 20:19:58
Problem I am trying to build a small ruby script - which will be run using jruby once a day - to connect to a Sybase ASE 12.5.4 database and perform a complex query. Ultimately I intend to do some processing on the data and insert the new data in a MySQL table for use within a rails application. Environment jruby v1.4.0 java v1.6.0_15 on Ubuntu Karmic JRuby Installed Gems activerecord-jdbc-adapter (0.9.1) activerecord-2.3.4 Jruby Lib Directory jtds-1.2.5 Query SET rowcount 10 SELECT * FROM TEST_TABLE Code Snippet require 'java' require 'jtds-1.2.5.jar' require 'rubygems' require 'active_record

How Do I Generate Sybase BCP Fmt file?

你离开我真会死。 提交于 2019-12-02 06:20:43
问题 I have a huge database which I want to dump out using BCP and then load it up elsewhere. I have done quite a bit of research on the Sybase version of BCP (being more familiar with the MSSQL one) and I see how to USE an Import file but I can't figure out for the life of me how to create one. I am currently making my Sybase bcp out files of data like this: bcp mytester.dbo.XTABLE out XTABLE.bcp -U sa -P mypass -T -n and trying to import them back in like this: bcp mytester.dbo.XTABLE in XTABLE