sybase

What is the mysterious 'timestamp' datatype in Sybase?

I recently discovered a table in our Sybase database at work that uses a column of type 'timestamp'. If I create a table using this mysterious timestamp datatype like this create table dropme ( foo timestamp, roo int null ) insert into dropme (roo) values(123) insert into dropme (roo) values(122) insert into dropme (roo) valu...

Error when updating table in Sybase

Hi, I am issuing an UPDATE Statement on a Sybase table but I am getting the below error: Msg 325, Level 18, State 4: Server 'dev', Line 1: Adaptive Server finds no legal query plan for this statement. If an Abstract Plan is forcing the query plan, check its correspondence to the query. If not, please contact Sybase Technical...

System.NullReferenceException thrown by AseDataReader

I’m using Sybase.AdoNet2.AseClient to access Sybase ASE data from a Console C# Application. Not always, but from time to time I get System.NullReferenceException With following code. It works well with only one application started, but fails with this exception if I start 10 processes at the same time in my machine. public void Dummy(...

Sybase Ase 15 error on multiple recordsets and active transaction

Hi all, we have very old VB6 applications connection to a Sybase database. Today they are running fine using the Open Client 12 drivers via ODBC connecting to a Syabse Ase 15 servers. There is a plan on upgrading to the OpenClient 15 drivers and with that version I'm getting this error: Run-time error '-2147467259(80004005)' Transactio...

Higher level libraries for Sybase::DBLib?

Has anyone written something similar to SQL::Abstract for Sybase::DBLib? in particular, I'm interested in being able to insert a hash of values into a table without manually forming the sql query myself. A big issue in working with sybperl is that SQL::Abstract returns bind values and placeholder SQL, not concrete SQL. The way to creat...

Is there a way to connect to an ASA database with Powerbuilder without deploying the ODBC or OLEDB drivers?

What I want is a Powerbuilder application that runs on Windows that runs from a CD (or some other external disk) that can read from an ASA database whose file is located on the same disk. But I want to do so without deploying the ODBC or OLEDB drivers. That is, I do not want to have to copy the driver files to the client's hard disk or...

Where in Squirrel SQL Client 3.1 can I create and excecute stored procedures (with Sybase)?

I am using Sybase and JDBC connection, Where in Squirrel SQL Client can I create and execute stored procedures? Do I need to install plugin for this? ...

Calling a Sybase stored procedure from another stored procedure ...

Hi, I'm calling a Sybase Stored Proc X that returns data that is used by a servlet. Within Stored Proc X, Stored Proc get_business_day is called in the following manner: exec get_business_day @CBDate, -1, @prevBusDay output So, the result of calling this (in DBArtisan) is: 6/25/2010 12:00:00.000 AM 1 row(s) affected. The iss...

How do I get just the Nth row of data from sybase?

I have a table with multiple rows for each user. Each user will have the same number of rows but the row ids are all different for each user, so how I do get just the Nth row for a given user? Assuming an order by user_id, row_id clause so you can be guaranteed a consistent order for any given user. This is sybase 12 I'm working with h...

Why will WHERE statement not work in sqlQuery in RODBC?

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 ...

Sybase CURSOR UPDATE extremeley slow / locking up

I have a temp table with 13,000 rows. Most of the rows have a numeric price (100) but some are quoted in 32nds, i.e. 100-30 = 100 + 30/32 = 100.9375. (Some even have fractions of a 32th) I am opening a cursor FOR UPDATE and iterating over the temp table. It takes so long to execute, I am not even sure it is working (my DBA says the exec...

Indexed Views in Sybase

Is it possible to create indices on views in Sybase (> ASE 12.5)? ...

Selectively deleting large amounts data from Sybase table

Using Sybase ASE 15 for this - I have about a large amount of rows (up to 10 mil) to delete from a table on a regular basis, but I want to keep a selection of the latest added data to the table, so that rules out using truncate directly on the table. delete from master_table where... Using the above delete is very slow, so my strategy...

Sybase nonclustered index selection

We have a table with two nonclustered indexs. The two indexes both have the same three columns, in the same order they only differ in that one is sorted ascending the other descending. A developer had created a stored procedure that does a select where he intended to (but forgot!) to force the use of an index rather than do an Order by...

VBA error when executing a sybase stored procedure

Hello, I have the following code that executes a Stored Procedure in Sybase throught VBA. Sub GetInfo() Dim rstRUB As ADODB.Recordset Dim strRUB As String Dim strcnn As String Dim productType As String Dim DealId As String strcnn = "DSN=KONDOR_QUA;DATABASE=Kustom;UID=odbcuser;PWD=odbcuser123;" Set cnn = Ne...

Does Adaptive Server Anywhere not support subqueries in the FROM clause?

I am trying to execute an SQL query on an Adaptive Server Anywhere database. Here it is: SELECT count(*) AS s FROM ( SELECT column1, count(*) AS n FROM table1 GROUP BY column1 HAVING n > 1 ) In the subquery, I want to get all the rows that are duplicates and in the outer query I want a count of the rows that are dupli...

How do I extract Sybase (12.5) table DDL via SQL?

I've scanned similar questions but they seem to be referring to other databases and/or external languages. I'm looking to programatically extract table DDL via SQL, with a result that's "good enough" to re-import and reconstruct the table. DBArtisan produces the exact result I'm looking for, but I have a dynamic list of a few dozen t...

Bulk select in Sybase

Hi, I have a few thousand col1, col2 distinct values. Col1 -> some primary key and Col 2 -> date. For a third col 3, i have to query a large table, which gives me only few hundred results in most cases. now my concern is how can write my where condition or use unions so that the number of times i am querying my DB decreases. my progra...

[SYBASE] SQL query for "concatenate on join"

NOTE: I'm still looking for an answer that I can accept. Hi, I'm using a Sybase ASE database. I have two tables that look like: Table Shops: --------------------- | ShopName | ShopID | --------------------- | Sweetie | 1 | | Candie | 2 | | Sugarie | 3 | --------------------- Table Sweets: --------------------...

How should I populate a MS Access ListBox by querying Sybase database?

I'm trying to populate a ListBox on MS Access Front end by querying Sybase. I think setting the RowSource will not work here. Will be very helpful if someone can provide me with sample code. Many thx. ...