sybase

sybase/sql self join multiple rows

家住魔仙堡 提交于 2019-12-12 03:43:21
问题 Hi stackoverflow community, I'm trying to do a self join if the unique ID in Col 1 is the same. Table code: CREATE TABLE #table ( Unique_ID int, Product_code varchar(10) ) INSERT INTO #table (Unique_ID, Product_code) VALUES (1111111111, 1) INSERT INTO #table (Unique_ID, Product_code) VALUES (1111111111, 2) INSERT INTO #table (Unique_ID, Product_code) VALUES (1111111111, 3) INSERT INTO #table (Unique_ID, Product_code) VALUES (2222222222, 4) INSERT INTO #table (Unique_ID, Product_code) VALUES

SQL Server not Connecting nor Tossing Errors

自闭症网瘾萝莉.ら 提交于 2019-12-12 03:42:37
问题 I am attempting to connect to an already established database here at work. We don't have access to the back-end, but we do have the server address and the login information to connect to it - I was able to connect last year using PDO and dblib, but dblib is no longer supported in PHP 7 so I am attempting to use the sql server driver. I set up a basic connection string to test it and am not getting any specified errors, nor am I getting any results: <?php //Display All Errors ini_set('display

OdbcDataAdapter Fill(Datatable) method throws System.Data.Odbc.OdbcException with empty exception message

无人久伴 提交于 2019-12-12 02:53:23
问题 I am using following c# code to query a Sybase database(driver - Adaptive Server Enterprise). - string query = “select * from view_Test”; DataTable dt = new DataTable(); OdbcConnection con = new OdbcConnection(); con.ConnectionString = connStr; OdbcCommand selectCommand = new OdbcCommand(query, con); OdbcDataAdapter dataAdatper = new OdbcDataAdapter(selectCommand); dataAdatper.Fill(dt); dt is getting populated but at the same time this code is throwing following exception - System.Data.Odbc

Finding total number of tables in union query

a 夏天 提交于 2019-12-12 02:32:32
问题 I am writing a code which supports different versions of Sybase ASE. I am using union queries and the problem is that different version of Sybase ASE supports different number of tables in union query. The union query is dynamic and will be formed depending on the number of database present in the server. Is there any way in which I can find the max number of tables supported by a particular Sybase ASE? The only solution that I know right now is to fetch the version using query and pick out

how to find if incomming parameter in not null and not empty in Sybase

谁说胖子不能爱 提交于 2019-12-12 01:53:40
问题 I am trying to write some thing like this in sybase ASE @searchstring varchar(500) If(IsNULLorEmpty(@searchstring)) { exec(@strexecsql) } else { exec(@strexecsql1) } what is best way to check this condition IsNULLorEmpty for a incoming @parameter? 回答1: The best would be ISNULL, i.e.: DECLARE @searchstring varchar(500) ... IF(ISNULL(@searchstring,'') = '') EXEC(@strexecsql) ELSE EXEC(@strexecsql1) 来源: https://stackoverflow.com/questions/29077854/how-to-find-if-incomming-parameter-in-not-null

unreadable old storage data in SQL server using PB10.5

↘锁芯ラ 提交于 2019-12-11 19:37:14
问题 i have problem in storage Arabic data in SQL server database,data in database table shows the characters as strange symbols that has no meaning like ÓíÇÑÉ ÕÛíÑÉ but when i read this data using PB7 it seem good and readable ,when read it using PB10.5 it seem unreadable 回答1: Related to unicode / non unicode. Sql sever has that likely as NVarChar uniqode, and PB10.5 tries to interpret it as normal ascii,. Check with their documentation (years that I made powerbuilder) but I would say something

jConnect4 pooled connection does not work as documented

人走茶凉 提交于 2019-12-11 18:09:18
问题 Official Sybase jConnect Programmers Reference suggests following way to use pooled connections: SybConnectionPoolDataSource connectionPoolDataSource = new SybConnectionPoolDataSource(); ... Connection ds = connectionPoolDataSource.getConnection(); ... ds.close(); However getDataSource always causes exception. I decompiled SybConnectionPoolDataSource and found that the method call explicitly generates an error: public Connection getConnection() throws SQLException { ErrorMessage.raiseError(

How to Copy a Timestamp Datatype

允我心安 提交于 2019-12-11 17:19:05
问题 I have a table with a TIMESTAMP column: create table dbo.EX_EMPLOYEE ( NAME_X varchar(10) null, RECORD_TIME_STAMP timestamp null ) when I copy the rows from one table to another, using either: SELECT * INTO EX_EMPLOYEE_T FROM EX_EMPLOYEE WHERE 1=0 or: INSERT INTO EX_EMPLOYEE_T SELECT * FROM EX_EMPLOYEE I get this warning: Warning: A non-null value cannot be inserted into a TIMESTAMP column by the user. The database timestamp value has been inserted into the TIMESTAMP field instead. The

How to get procedure cache hit ratio in sybase by using query?

主宰稳场 提交于 2019-12-11 17:08:02
问题 I have installed sybase setup in my local now I want check the procedure cache Hit ratio by using query. Please help on this, because I am new on sybase and I need to collect procedure cache hit ratio for some purpose. 来源: https://stackoverflow.com/questions/54181588/how-to-get-procedure-cache-hit-ratio-in-sybase-by-using-query

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