sqlanywhere

SQL subselect filtering based on multiple sub-rows

守給你的承諾、 提交于 2019-12-12 04:17:30
问题 I have two tables, and want to extract certain columns from the first, based on 'child' data from the second. I'm using SQL Anywhere 12 Table 1) Lets call it Projects proj_id | Name --------+--------- 10 | Proj_1 20 | Proj_2 30 | Proj_3 40 | Proj_4 Table 2) Lets call this one tasks proj_id | task_id | Status --------+---------+----------- 10 | 1 | Ready 10 | 2 | Cancelled 10 | 3 | Ready 20 | 1 | Complete 20 | 2 | Ready 30 | 1 | Ready 30 | 2 | Not Ready 30 | 3 | Complete 40 | 1 | Ready 40 | 2

How to query a remote SQLAnywhere16 db using Rails?

夙愿已清 提交于 2019-12-12 04:16:41
问题 I am trying to set up a Rails app to query a remotely hosted SQLAnywhere 16 db and to display some query information as HTML. I'm using current versions of Ruby and Rails on Mac El Capitan. The remote server is running Windows. The server is located in my building and I am on the same LAN, so if there's a simpler solution that involves accessing the box itself physically I'm open to that. On my Windows machine I am able to connect to the server and do queries on the db using a SQL client. I

isql (sql anywhere) trigger gives error

淺唱寂寞╮ 提交于 2019-12-12 01:52:40
问题 got strange error "Correlation name 'Club' not found" but the table Club is in the DB. I think the problem is after inserting the values: ALTER TRIGGER "tg_add_club" AFTER INSERT, UPDATE ON Club REFERENCING NEW AS item FOR EACH ROW WHEN (item.address NOT IN (SELECT name FROM Place)) BEGIN //DECLARE i_id INTEGER; INSERT INTO Place(name) VALUES (item.address); //SELECT @@identity INTO i_id; UPDATE Club SET place = (SELECT id FROM Place WHERE name=item.address) WHERE Name = item.name; //AND

Database first with EF6 SqlAnywhere provider in VS2017

孤街浪徒 提交于 2019-12-11 23:46:36
问题 Having already followed the advice in the SAP website documentation and installed the developer edition of SQLAnywhere 17, and also having manually run the installer for VS integration that is provided by this installation I still could not see any providers other than the MSSQL ones while creating an EF6 model in Visual Studio 2017. I found this https://www.nuget.org/packages/Sap.Data.SQLAnywhere.EF6/17.0.7.3399 Does anyone know where to find documentation on how to use it? Nuget provides no

get the days between the dates [duplicate]

耗尽温柔 提交于 2019-12-11 18:41:52
问题 This question already has answers here : Count days in date range? (5 answers) Closed 5 years ago . When i execute this sql code: SELECT ROW_NUMBER() OVER (ORDER BY schdate), ACCT , SCHDATE AS DATES, NULL AS ORS FROM AMORT WHERE ACCT = '0000360' AND CYCLE = '0001' AND principal <> '0.00' UNION ALL SELECT ROW_NUMBER() OVER (ORDER BY ddate), ACCT, DDATE AS DATES, OR_NO AS ORS FROM LEDGER WHERE (ACCT = '0000360' AND CYCLE = '0001') AND (t_code = '10' OR t_code = '11' OR t_code = '12' OR t_code =

Multiple Sybase dlls are loaded when using entity framework

被刻印的时光 ゝ 提交于 2019-12-11 16:50:49
问题 I am using SQL Anywhere 17 and entity framework 6. When I try to get some data from the database I get this exception. An exception of type 'System.InvalidCastException' occurred in EntityFramework.dll but was not handled in user code Additional information: [A]Sap.Data.SQLAnywhere.SAConnection cannot be cast to [B]Sap.Data.SQLAnywhere.SAConnection. Type A originates from 'Sap.Data.SQLAnywhere.v4.5, Version=17.0.0.10624, Culture=neutral, PublicKeyToken=f222fc4333e0d400' in the context

WAMP php ODBC Connection 'Warning'

巧了我就是萌 提交于 2019-12-11 13:44:16
问题 I have a problem with ODBC in php (WAMP Server 2.5, PHP 5.5.12). When I try to run: $conn = odbc_connect("odbc_dsn", "user", "pwd"); if ($conn) { echo "Connection established."; } else { exit("Connection could not be established."); } I get a Warning: Warning: odbc_connect(): in C:\wamp\www\Concepts\index.php on line 29 Connection could not be established. If I change the "odbc_dsn" to something else (that doesn't exist) like "fdbasdf" then I get: Warning: odbc_connect(): SQL error:

Could not find encryption dll dbfips16.dll with Sql Anywhere 16

痞子三分冷 提交于 2019-12-11 10:09:37
问题 I have the problem, that if i deploy my 64bit application on a customer computer, i get the error message: encryption dll "dbfips16.dll" could not be loaded. The curious thing is, that on my notebook and some other computers it's working pretty well. I tried to add the dll's to our deployment, but could not find it in the Sybase 16 directory, do i have to download the seperatly? (I currently i did not want to use any encryption) P.S. i use simple file based deployment. EDIT I use the sybase

Import backed-up SQL Anywhere 10 .db file into MySQL 5.1

江枫思渺然 提交于 2019-12-11 08:49:18
问题 I have a backup of a database from a week ago. I need to import this into MySQL without access to the original database server. Despite my boss's knowledge that I am nowhere near a database administrator; how do I do this? 回答1: No one will provide an answer because (a) it is illegal, and (b) it is against the website rules. If you have legal access to the database server: which means the first option is to get a licence for ASA, rather than using MySQL. It takes one single command to load the

Decrypting AES in SQL Anywhere 16 encrypted in C# and vise versa

不羁的心 提交于 2019-12-11 02:35:25
问题 I have this peace of code that encrypts stuff using AES, to be more precise Rijndael algorithm to mimic (http://dcx.sybase.com/index.html#sa160/en/dbreference/encrypt-function.html) the behaviour of SQL Anywhere 16, for sake of examples simplicity keys are fake: var Key = Encoding.ASCII.GetBytes("1234567812345678"); var IV = Encoding.ASCII.GetBytes("1234567812345678"); var text = "stuff"; string encrypted; var aes = new RijndaelManaged { Mode = CipherMode.CBC, Padding = PaddingMode.PKCS7,