sybase

sybase error while fetching coloums more then 255 characters

hello all, i m having problems while fetching data from columns which have more than 255 characters i got such an error message: Open Client Message: Message number: LAYER = (1) ORIGIN = (4) SEVERITY = (1) NUMBER = (132) Message String: ct_fetch(): user api layer: internal common library error: The bind of result set item 3 resulted...

Sybase and tempdb

Hi, Im working with Sybase central - Adaptive Server Anywhere 9 and I want some examples in the use of de tempDB. How , for example can I insert some records in a temporary table ? I tried for example: select * into TempDB.dba.#testing from testTable but I got the followiing error: Syntax error near '.' on line 1 ...

Database name while referencing tables - Sybase

How do I get away with hardcoding the database name in referencing a table within a stored procedure. For example there are two databases db1 and db2. I am writing a stored procedure in db2 which references two tables, one from db1 and another from db2. Both are on the same sybase server. ...

Sybase: how can I remove non-printable characters from CHAR or VARCHAR fields with SQL?

I'm working with a Sybase database that seems to have non-printable characters in some of the string fields and this is throwing off some of our processing code. At first glance, it seemed to only be newlines and carriage returns, but we also have an ASCII code 27 in there - an ESC character, some accented characters, and some other odd...

Restrict stored procedure to only perform SELECT operations

Is is possible to restrict a stored proc to only SELECT from a database. I want a stored proc which only selects data to execute correctly and a stored proc with UPDATE, CREATE, DELETE operations to return an error indicating insufficient permissions. I am using Sybase 12.5 ...

Column names in dynamically generated datawindows

When I dynamically create a datastore using SyntaxFromSQL (in order to generate datastore source code, based on a SQL SELECT statement), with syntax like this string ERRORS, sql_syntax, dwsyntax_str, presentation_str dwsyntax_str = trans_object.SyntaxFromSQL ( sql_syntax, presentation_str, ERRORS) ds_1.Create( dwsyntax_str, ERRORS) ho...

Sybase "interfaces" file issue

Hi, There is a strange issue about sybase interfaces file. We have an application which is run on solaris sparc OS and this application uses open client (sybase OCS-12_5) for database operations. When we upgrade our database server to sybase 15.03, our application didn't work. then I start the research for figure out why it does not wo...

Introspecting IDENTITY columns in Sybase SQL Anywhere

For a table such as: create table foo (id int identity primary key) I would like to query the system tables to determine that id is in fact an IDENTITY column. The closest thing I found was: select tc.max_identity from systabcol tc join systab t on t.table_id = tc.table_id where t.table_name = 'foo' Unfortunately max_identity is 0...

Sybase Advantage Database server and 64 bit VFP OLE providers

Does anyone know if the sybase ads vfp provider works in 64 bit? Currently we have to build our .NET applications targeting x86 to be able to use the vfpoledb provider that only runs in 32 bit. Any solutions or suggestions would be appreciated. ...

ASE Sybase BLOB

hi I want to write a file into a column of a blob data type,can some one pls send me the syntax for it. Appreciate if you could also send me the syntax for retrieving the file while doing the select as well.Thanks. ...

Automate conversion of Sybase .ADT files to SQL.

I am working with some data I obtained that is read with a program using an embedded Advantage Database Server. The program was not written by me and does not have all of the functionality that I need. I would like to convert this data to a different format so that I can work with it more freely, such as MySQL. I know that Sybase pr...

Getting column names with sqsh -m bcp option enabled?

When I'm using sqsh in interactive mode, sometimes I like to run my query in the following way so I can get it in a nice csv file: 1> select * from Table where Blah=Blah 2> go -m bcp > /file/name/here The only problem I have is that using the "-m bcp" option does not give me the column names in the output. Any idea how to ...

How recover sybase database (unknow db version)

I have a database file (*.db) that need to be recovered. The bad is, the end-user have null idea of the version of the database. Not know the password. The original developer is lost. The computer where was installed was formatted. We have not experience in this database software. Yeah, nightmare. My guess is a old database. I'm trying...

Looking for sql to find a list of people in a database who don't have a particular row without using not exists.

It's easy to find all the users ids who have trait.color = "green" but I need to find all the people who don't. The obvious way is a subselect for all the ids where not exists (select id where trait.color = "green') but I was trying to think if there's a way to do it without a subselect. Is there some trick I don't know about? sybase 12...

sybase - can not migrate database

hi, I am working on load database dumps to new ase server. but when I try to load 15gb and 32gb dumps to database, I get below error. When I load 2gb dump to db, everything fine. I search on net and they advice to get db dump with sp_flushstats in single user more but I have no chance to get new dumps. isql 1> load database db1 2> ...

Sybase: trying to lock a record on select so another caller does not get the same one

I have a simple table in Sybase, let's say it looks as follows: CREATE TABLE T ( name VARCHAR(10), entry_date datetime, in_use CHAR(1) ) I want to get the next entry based on order of "entry_date" and immediately update "in_use" to "Y" to indicate that the record is not available to the next query that comes in. The kicker i...

Sybase passing list of values in 1 parameter

Is it possible ? CALL "DBA"."stored_proc"("iParameter" = 'value1','value1','value1','value1','value1') Or how to make this possible ...

fetching blob data from sybase

Hello all my question is about sybase's ct_get_data() function i got below message when fetching TEXT data that is is not the last column of the result set. Open Client Message: Message number: LAYER = (1) ORIGIN = (1) SEVERITY = (1) NUMBER = (61) Message String: ct_get_data(): user api layer: external error: Item of 1 is not greater th...

Linq 2 Sybase ASE database? What are the options?

I have a need to query an existing Sybase ASE database and would like to use Linq syntax for my data retrival. I don't need write access, nor do I need the full set of Linq operators, just Select(), SelectMany(), Where(), and GroupJoin() What are options are available? In particular, I'm wondering about nHibernate and building a ne...

Selecting max/min value from more than one fields

In the following query the start/finish columns are datetime fields. How should I modify this query to get two more columns, one with the min date and one with the max date (of all the 6 datetime fields and all the rows) repeated in each row. Alternatively how could I create a new query returning only these 2 (min/max) dates, for the...