Все вопросы: [sybase]

107 вопросов

1
голосов
2ответов
478 просмотров

Grab SQL being executed in a shell script

Given a shell script containing a bunch of SQL statements, is there an option to redirect just the SQL statements to stdout/file? The structure of the script is something like this: ... for i in *list* do isql *credentials etc* <<EOF > a.out select *about 100 cols* from ...

1
голосов
1ответов
6128 просмотров

insert now() into a Sybase timestamp field

I'm new to sybase and google was anything but helpful. All I want to do is insert a valid time for "right now" into a timestamp field. The mysql equivalent is now(). I tried getdate() and got funny results. Thanks.

0
голосов
3ответов
914 просмотров

JRruby, Sybase JDBC and DBI - fetching column name with the AS clause issue

I have a ruby script which I run using the JRuby Interpreter. The script connects to a Sybase database using DBI and Sybase JDBC (jTDS3.jar and jconn3.jar) My problem is that I have a select query that alters the column names of table. For example: SELECT t.TRANSACTION as 'business_transaction'...

1
голосов
2ответов
389 просмотров

How to get mysql to accept sybase database..table notation

I'm porting a sybase application to mysql and of course there's tons of sql compatibility issues, but one that I don't see an easy way out of without changing every single sql is that in sybase you can refer to a table by db..table notation, but in mysql it requires db.table. I'm kinda on mysql's...

1
голосов
5ответов
2465 просмотров

Selecting rows between x and y from database

I've got a query which returns 30 rows. I'm writing code that will paginate those 30 rows into 5 records per page via an AJAX call. Is there any reason to return just those 5 records up the presentation layer? Would there be any benefits in terms of speed or does it just get all the rows under ...

1
голосов
7ответов
640 просмотров

How do I implement this algorithm in SQL?

I am trying to implement an algorithm in SQL (transact sql) and finding it difficult given my current abilities. I have tried to strip the problem down to the esstentials. The basic idea behind this algorithm is that a user is planning out their budget for lets say a month. They have a good idea ...

1
голосов
3ответов
4193 просмотров

how to model this database relationship? (sybase powerdesigner)

I'm doing a conceptual model in Sybase PowerDesigner. The restriction is following: One doctor can work in only one office at a time during his working time (shift). I guess Doctor - Office relationship should be many-many, but what about time restriction ("during his working time")? Should it...

0
голосов
2ответов
1821 просмотров

Sybase: Does the column order in a non-clustered index affect insert performance?

To be more specific (since the general answer to the subject is likely "yes"): We have a table with lots of data in Sybase. One of the columns is "date of insertion" (DATE, datetime type). The clustered index on the table starts with the "DATE". Question: For another, non-clustered index, do...

0
голосов
4ответов
216 просмотров

Does having several indices all starting with the same columns negatively affect Sybase optimizer speed or accuracy?

We have a table with, say, 5 indices (one clustered). Question: will it somehow negatively affect optimizer performance - either speed or accuracy of index picks - if all 5 indices start with the same exact field? (all other things being equal). It was suggested by someone at the company that ...

1
голосов
2ответов
2152 просмотров

Does the order of columns on a covered index in Sybase affect select performance?

We have a large table, with several indices (say, I1-I5). The usage pattern is as follows: Application A: all select queries 100% use indices I1-I4 (assume that they are designed well enough that they will never use I5). Application B: has only one select query (fairly frequently run), which c...

1
голосов
2ответов
885 просмотров

SQL string replacement workaround

I'm working in a modified version of Sybase 10 that doesn't have the stuff, replace or str_replace functions. I need to replace part of string in a number of records. Are there any creative ways to program around this, so I don't have to do them all manually? Example: UPDATE status SET descri...

1
голосов
1ответов
11963 просмотров

Running Sybase SQL commands from DOS/Windows batch file

Is there any way I can run Sybase SQL commands from command prompt. I need to write a batch file which runs an SQL query on machine as a fix for a bug.

6
голосов
7ответов
25883 просмотров

How do I select from a stored procedure in Sybase?

My DBA has constructed me a stored procedure in a Sybase database, for which I don't have the definition. If I run it, it returns a resultset with a set of columns and values. I would like to SELECT further to reduce the rows in the result set. Is this possible? From this question it seems like ...

0
голосов
2ответов
1032 просмотров

Slow SQL update could use some help

An ex-coworker of mine wrote the following UPDATE as part of a data import script and it takes nearly 15 minutes to complete on a table of 92k rows. UPDATE table SET name = ( SELECT TOP 1 old_name FROM ( SELECT SUM(r) rev, number, name, ...

27
голосов
12ответов
206557 просмотров

From a Sybase Database, how I can get table description ( field names and types)?

I have access to command line isql and I like to get Meta-Data of all the tables of a given database, possibly in a formatted file. How I can achieve that? Thanks.

0
голосов
1ответов
1157 просмотров

Any drivers available for ODBC to Sybase that can be used with QTP?

I am looking for drivers that can be used to connect to sybase database from QTP.

1
голосов
1ответов
1134 просмотров

creating sybase stored procedure that returns jdbc statement.getWarning

I am creating a sybase stored prodedure that is being called through JDBC. Under certain error conditions i want my stored procedure to return a warning to the JDBC caller. What do i need to add to the stored procedure so Statement.getWarnings() returns a SqlWarning that contains an error me...

0
голосов
3ответов
1695 просмотров

Is KPID globally unique within Sybase?

Can a KPID (as select kpid from master..sysprocesses) be assumed to be globally and always unique? (I've found that for my small sample set KPID(n+1) ~= KPID(n) + 65536 (2^16) but I want to know if I can assume, previous db connections kpid is unique, even if it's previous loginame and spid matc...

377
голосов
21ответов
781980 просмотров

Cannot insert explicit value for identity column in table 'table' when IDENTITY_INSERT is set to OFF

I have the below error when I execute the following script. What is the error about, and how it can be resolved? Insert table(OperationID,OpDescription,FilterID) values (20,'Hierachy Update',1) Error: Server: Msg 544, Level 16, State 1, Line 1 Cannot insert explicit value for identity...

0
голосов
1ответов
1859 просмотров

sybase - showplan drops estimated I/O greatly by adding another table to query

The application of the query has been changed, but the theory is the same. 4 tables: states - list of states (index on state) stores - stores, and the state they're in (separate indexes on state, store) store_orders - ties an order to a store (separate indexes on store, order) order_statuses - ...

0
голосов
2ответов
1019 просмотров

adding lock option to Create Table statement in Sql Server 2005

I am busy creating tables in Sql Server from a Sybase database. In the Sybase database when the tables are created an option 'lock allpages' was used, how can I replicate this when creating the tables in Sql Server 2005.

0
голосов
1ответов
201 просмотров

How to force table select to go over blocks

How can I make Sybase's database engine return an unsorted list of records in non-numeric order? ~~~ I have an issue where I need to reproduce an error in the application where I select from a table where the ID is generated in sequence, but the ID is not the last one in the selection. Let me ...

2
голосов
2ответов
5748 просмотров

How can I do paging in Sybase without making temp table? (oracle rownum issue)

In Oracle, usually query like this for paging. SELECT * FROM (SELECT *, rownum rid FROM TABLEA WHERE rownum <= #pageend#) WHERE rid > #pagestart# However, there is no "rownum" function in Sybase DBMS. How can I do that query exactlly same in Sybase? I found some ways. use "rowcount...

0
голосов
1ответов
1787 просмотров

Check constraint to make sure values in a character column are all digits

This is similar to CHECK CONSTRAINT of string to contain only digits. (Oracle SQL) but I want to do this for Sybase. I have a character column 'colExp' (8 characters). I want to put a check constraint to make sure values for this column are all digits. How can I do this? This will work but its...

0
голосов
2ответов
404 просмотров

Call SQL with a compute clause in C#

Does anybody know how to invoke a SQL command with a compute clause in C#? I'm getting an internal error 30016: Internal Error :30016 Unknown Dataitem Dataitem My Database is Sybase 12.5.4.

0
голосов
1ответов
1111 просмотров

Inserting Japanese characters to Sybase db from Excel

I can see the Japanese test in the excel cells. I've built the insert query using ADO. It does the insert in the DB, but Japanese characters are simply represented as "????" Any help would be appreciated.

11
голосов
2ответов
5009 просмотров

PowerDesigner - Prevent DB name to be uppercase in generated SQL

I am currently beginning playing around with Sybase PowerDesigner and its Physical Data Model (PDM). I have managed to create some entities/tables, columns, et cetera, and the case in the generated SQL (to create the database from the model) is like I want. However, regarding the database name,...

1
голосов
1ответов
3243 просмотров

Sybase select variable logic

Ok, I have a question relating to an issue I've previously had. I know how to fix it, but we are having problems trying to reproduce the error. We have a series of procedures that create records based on other records. The records are linked to the primary record by way of a link_id. In a proced...

3
голосов
6ответов
1918 просмотров

How to generate 2TB+ size of data for Oracle, Informix & Sybase

I am a new to Informix and as part of my testing activity I am in need of creating 2TB+ size data for Oracle, Informix & Sybase. Is there a database-neutral way of doing this? I am looking for any freeware or open source tools as well; I can find a few for Oracle but hardly any for Informix...

1
голосов
2ответов
6304 просмотров

What is the equivalent function for REPLACE(of Oracle) in sybase

What is the equivalent function for REPLACE(of Oracle) in sybase?