sybase-ase

Using Sybase ASE BCP to a Remote Server

梦想的初衷 提交于 2019-12-23 03:38:18
问题 I am using BCP to export/import data sometimes to remote servers where i cannot login into the OS, only connect to the DB. I have success with using BCP to connect to a server like this: bcp mytester.dbo.MyTable in MyTable.bcp -S Sybase157 -U sa -P SyAdmin -n This of course only works becuase Sybase157 is defined in my sql.ini. My question: a) Is it possible to sidestep the whole sql.ini thing and just do something like -S mydb.server.com or -S 123.123.123.123 and if not.... b) what do i need

DBUnit Sybase unable to CLEAN_INSERT

試著忘記壹切 提交于 2019-12-22 18:45:45
问题 According to the DBUnit docs link it should support using a CLEAN_INSERT when using a DatabaseSequenceFilter. I get the following exception when attempting this com.sybase.jdbc2.jdbc.SybSQLException: Dependent foreign key constraint violation in a referential integrity constraint. dbname = 'my_db', table name = 'tbl_child', constraint name = 'fk_tbl_child_parentid'. My tables look like this: CREATE TABLE dbo.tbl_parent ( parent_id numeric(19,0) IDENTITY, ... ) CREATE TABLE dbo.tbl_child (

DBUnit Sybase unable to CLEAN_INSERT

天涯浪子 提交于 2019-12-22 18:45:18
问题 According to the DBUnit docs link it should support using a CLEAN_INSERT when using a DatabaseSequenceFilter. I get the following exception when attempting this com.sybase.jdbc2.jdbc.SybSQLException: Dependent foreign key constraint violation in a referential integrity constraint. dbname = 'my_db', table name = 'tbl_child', constraint name = 'fk_tbl_child_parentid'. My tables look like this: CREATE TABLE dbo.tbl_parent ( parent_id numeric(19,0) IDENTITY, ... ) CREATE TABLE dbo.tbl_child (

Is it better to have single trigger for Insert/Update/Delete, or multiple?

独自空忆成欢 提交于 2019-12-21 06:00:09
问题 I have a requirement to mirror insert/update/delete operations from one table to another. For example insert on tableA has to be copied into tableB, update to tableA applied to tableB, and delete from tableA be applied to tableB. It's as simple as that, except tableB has 1 additional column for a constant value, so very simple triggers are needed. I'm not sure if it is better to write 3 separate triggers, or have one trigger that does all of the operations. This is for 3 databases: Sybase ASE

Sybase ASE ADO.net 2.0 provider?

被刻印的时光 ゝ 提交于 2019-12-20 12:39:01
问题 I'm looking for an ADO.net 2.0 or later provider for Sybase database which seems to be known as Sybase ASE. To clarify, I'm interested in ASE, and not SQL Anywhere. Hopefully the provider will be included with the database, or free. I can find mention of an ADO.net 1.1 provider; that's not what I want. I can find mention of ODBC drivers and OLEDB providers; that's not what I want. I've found the DataDirect ADO.net providers which are paid for; I guess that's the fallback position. Thanks for

Discover primary / unique keys in Sybase ASE

房东的猫 提交于 2019-12-20 04:27:06
问题 In Sybase ASE, I would like to discover all primary and unique keys. I want to do something similar to what is explained in this answer: Identifying Sybase tables, fields, keys, constraints But unfortunately, this doesn't work for me. Somehow the syskeys table does return any rows for my own keys, only for system table keys. What may I be doing wrong? Some missing grants? I have installed Sybase ASE 15.5 and I'm connecting with user dbo , login sa 回答1: When you explicitly declare a key field

Sybase: HAVING operates on rows?

大兔子大兔子 提交于 2019-12-20 04:14:18
问题 I've came across the following SYBASE SQL: -- Setup first create table #t (id int, ts int) go insert into #t values (1, 2) insert into #t values (1, 10) insert into #t values (1, 20) insert into #t values (1, 30) insert into #t values (2, 5) insert into #t values (2, 13) insert into #t values (2, 25) go declare @time int select @time=11 -- This is the SQL I am asking about select * from (select * from #t where ts <= @time) t group by id having ts = max(ts) go The results of this SQL are id ts

How can I use Dapper's strongly-typed query parameters with Sybase ASE?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-19 03:23:04
问题 Dapper can pass query parameters as anonymous objects, and supports any ADO.NET data provider. However, when running the following query against the Sybase 15 ADO.NET drivers: using (var connection = new AseConnection("...")) { connection.Open(); var results = connection.Query<Foo>( "dbo.sp_columns", new { table_name = "dbo.sysusers"}, commandType: CommandType.StoredProcedure); } ... the following error is thrown: Sybase.Data.AseClient.AseException: Procedure sp_columns expects parameter

how to set row number in sybase query

巧了我就是萌 提交于 2019-12-18 07:04:50
问题 I have a select statemnt which will return results say 1000 using join with some 3 to 4 tables. My requirement is to have identity column in the resultset . Can anyone help me on this. ex : Result : id name -- ---- 001 xxx 002 yyy 003 zzz My requirment : Rowid id name 1 -- ---- 2 001 xxx 3 002 yyy 4 003 zzz Like Row_number in sql , do we have anything here in sybase 回答1: In sybase there isn't row_number or something like that. Maybe temporary tables with identity column will help you?

How can I get data from a stored procedure into a temp table?

孤者浪人 提交于 2019-12-18 02:46:26
问题 Am working on sybase ASE 15. Looking for something like this Select * into #tmp exec my_stp; my_stp returns 10 data rows with two columns in each row. 回答1: In ASE 15 I believe you can use functions, but they're not going to help with multirow datasets. If your stored proc is returning data with a "select col1,col2 from somewhere" then there's no way of grabbing that data, it just flows back to the client. What you can do is insert the data directly into the temp table. This can be a little