sybase-asa

Why will WHERE statement not work in sqlQuery in RODBC?

。_饼干妹妹 提交于 2020-01-25 08:04:49
问题 We keep all our laboratory data in a Sybase database. When I want to do data manipulation and analysis I read the data into R with RODBC. library(RODBC) channellab <- odbcConnect("Labdata") indivs <-sqlQuery(channellab,'SELECT * from CGS.Specimen') So far so good, except that CGS.Specimen is a table for our entire lab holdings. There are almost 40000 specimens (rows) with 66 variables. It takes an unnecessary amount of time to read especially when I am only interested in the holdings of one

convert int to datetime in sybase

眉间皱痕 提交于 2019-12-25 04:29:22
问题 This works perfectly on the server (sql server 2012) for a julian date of 5 digits select cast (column1 as DATETIME) FROM mytable How to cast an int to datetime in sybase? And which would be the best way, since I have a large table and I have to minimize the time i'm going to be using the server under the query. I saw here: http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc32300.1570/html/sqlug/sqlug645.htm that it is allowed to convert from int to varchar and from

Sybase SQL - Remove “semi-duplicates” from query results

元气小坏坏 提交于 2019-12-25 01:35:07
问题 I have a query that uses two SELECT statements that are combined using a UNION ALL . Both statements pull data from similar tables to populate the query results. I am attempting to remove the "semi-duplicate" rows from the query, but am having issues doing so. My query is the following: SELECT DISTINCT * FROM ( SELECT TeamNum = CASE WHEN T.TeamName = 'Alpha Team' THEN '1' WHEN T.TeamName IN ('Bravo Team', 'Charlie Team') THEN '2' WHEN T.TeamName = 'Delta Team' THEN '3' ELSE '<Undefined>' END,

Select TOP 1 * from Table Fails in Sybase Procedure

大兔子大兔子 提交于 2019-12-23 12:33:40
问题 Am trying to Fetch Only one record from the Sybase Table without using the RowCount Function, even though "WHERE Condition" returns multiple results. SELECT TOP 1 EMPLOYEE_NAME FROM EMPLOYEES WHERE EMPLOYEEID > 50 Runs Successfully with one Record Only, However SELECT TOP 1 EMPLOYEE_NAME FROM EMPLOYEES WHERE EMPLOYEEID > 50 fails, when written inside a Sybase Procedure as a Sub Query 回答1: Top is supported only in outer query only, here is the link For ordered data I am using having cause

Encrypting ODBC DSN login password programmatically

我怕爱的太早我们不能终老 提交于 2019-12-13 04:18:57
问题 I am using file DSN for connecting to Sybase database. Login password is encrypted and is stored with EncryptedPassword keyword in the .dsn file. I have the requirement to change the database password and update the DSN accordingly. I am using SQLDriverConnect to connect to the database and SQLWriteFileDSN to modify the .dsn file. Is there any way to encrypt the new given password same way Sybase does(keyword or special tag or some thing?).? Some limitation: I know its not recommended to

DSN-less ODBC connect string for legacy Sybase Adaptive Server Anywhere

一个人想着一个人 提交于 2019-12-10 17:53:00
问题 This is a failed response to this article: Sybase, VB and ADO I just did a VB6 project connecting to a legacy ASA 7 database. After failing to use ASAProv OLEDB provider altogether (for one reason or another) and much research, here is the connect string for OLEDB Provider for ODBC shim for a DSN-less ODBC driver connection: Provider=MSDASQL.1;Driver={Adaptive Server Anywhere 7.0};CommLinks=TCPIP,SharedMemory;EngineName=<database_name>;UID=DBA;PWD=SQL where <database_name> is the instance

Get records from last hour

放肆的年华 提交于 2019-11-30 08:27:17
I have this query: SELECT Field1, OrderFor, Writeback, Actshipdate, Orderstatus, receivedate, receivetime FROM orderinfo, shippinginfo WHERE orderinfo.orderid = shippinginfo.orderid AND shippinginfo.custid = '37782' AND receivedate = DATE(NOW()) AND receivetime = ??????? I am using Sybase adaptive server anywhere and trying to get records for the last hour. try this !! SELECT Field1, OrderFor, Writeback, Actshipdate, Orderstatus, receivedate, receivetime FROM orderinfo, shippinginfo WHERE orderinfo.orderid = shippinginfo.orderid AND shippinginfo.custid = '37782' AND receivedate = DATE(NOW())

Get records from last hour

北战南征 提交于 2019-11-29 06:12:57
问题 I have this query: SELECT Field1, OrderFor, Writeback, Actshipdate, Orderstatus, receivedate, receivetime FROM orderinfo, shippinginfo WHERE orderinfo.orderid = shippinginfo.orderid AND shippinginfo.custid = '37782' AND receivedate = DATE(NOW()) AND receivetime = ??????? I am using Sybase adaptive server anywhere and trying to get records for the last hour. 回答1: try this !! SELECT Field1, OrderFor, Writeback, Actshipdate, Orderstatus, receivedate, receivetime FROM orderinfo, shippinginfo