sybase

PowerDesigner - Assign a TriggerTemplate to a trigger through VBScript?

In PowerDesigner v12, how would one, through use of VBScript, assign a TriggerTemplate to triggers that are missing the definition? We have a script now that can loop through the triggers and display the triggertemplate (if it has one), but all attempts to assign a template to these triggers have failed. Any insight would be greatly ap...

BeanPropertySqlParameterSource and Doubles

Have a table and a sproc setup in Sybase as follows: create table testtab (f float) create proc insert_testtab @f float as insert testtab values(@f) And a java object that holds a Double class TestObj { Double getF() { return 12.34; } } Using SimpleJdbcCall & BeanPropertySqlParameterSource: SqlParameterSource params = new BeanPrope...

How do you get Mobilink to synchronize tables so that the most recent updated table is not overwritten?

Here is the scenario. I have an Oracle consolidated database. I am using Mobilink to synchronize Oracle with a SqlAnywere database that is being used on a handheld. If userA changes a record in the remote DB on their handheld device to "updated first" and then 10 minutes later userB updates the same record on their handheld device to ...

Sybase ASE ADO.net 2.0 provider?

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

Am I translating Ansi OUTER JOIN syntax correctly to older Sybase (*=) join syntax?

Assuming this is the correct Ansi SQL syntax for a left outer join: SELECT * FROM employee LEFT OUTER JOIN department ON employee.DepartmentID = department.DepartmentID And this is the correct Ansi SQL syntax for a right outer join: SELECT * FROM employee RIGHT OUTER JOIN department ON employee.Departme...

Registering Mobilink with Mobile Device Center on Vista has errors

I have a bat file that I am using to try and register Mobilink with the Mobile Device Center on Vista. (I am using version 11 of Mobilink) Script: mlasinst -k ./ -v ./ I have copied mlasinst as well as mlasdev.dll and mlasdesk.dll to the same folder and am running the above command to get the sychronization process to run.(I have test...

Why would IF EXISTS not work?

I have a lot of code I am trying to run where I'm querying the sysobjects table to check if an object exists before I drop it and create it again. Issue being, sometimes if I go: if not exists (select name from sysobjects o where o.name = 'my_table' and o.type = 'U') CREATE TABLE my_table (..) go it works, no worries. However, when...

Cannot insert into table because the table already exists?

I have a user table. I want to insert data into my user table. I have a statement: SELECT columna, columnb, INTO my_table FROM my_other_table WHERE (... conditions ...) I get the following error: SQL Server Error on (myserver) Error:2714 at Line:1 Message:There is already an object named 'my_table' in the database. Yes, thanks S...

Mixing Parameterized Query and Sub-query on Insert

I have a colleague who wants to attempt the following query: INSERT INTO table (ColumnA, ColumnB, ColumnC) VALUES (?, (SELECT Id FROM ColumnD WHERE x=y), ?) Sybase complains about this as it does not seem to allow subqueries in the VALUES portion of the query. Does anyone know of a way around this problem? ...

Sybase IQ Pagniation

Hi there, I wonder if anyone has a solution to the following requirement. I have a stored procedure which returns a result set of for example 1000 rows. Now I need to limit this to 100 rows at a time. So I will pass in a start and end index value and I only want the records between the start index rowcount and the end index rowcount ...

Delete foreign keys in sybase 12.5

Hi, I have two tables: CREATE TABLE dbo.country ( cntry_id VARCHAR(2) NOT NULL, name VARCHAR(50) NOT NULL, CONSTRAINT pk_country PRIMARY KEY (cntry_id) CREATE TABLE dbo.city ( city_id VARCHAR(3) NOT NULL, name VARCHAR(50) NOT NULL, cntry_id VARCHAR(2) NOT NULL, CONSTRAINT pk_city PRIMARY KEY (city_id), FO...

Quality of Sybase ASE support in Delphi

I have Delphi Professional 2007 and 2009 and was thinking of upgrading either or both to Enterprise due to a new project that requires me to interface to a Sybase ASE database. I did some web research and it appears that 2007 Sybase driver leaked memory and it doesn't appear that this problem was fixed. Does anyone know if the Codegear...

Formatting RAISERROR messages in SYBASE ASE 12.5

In a stored procedure, I am trying to test if a parameter is null or less then 1, and if so, raise an error with a friendly message, and the value of the parameter. Here is my code: IF @ID IS NULL OR @ID <= 0 BEGIN RAISERROR 27001 'ID is ?????. ID cannot be null or less then zero.' RETURN 27001 END What I would like back is e...

Prepared statement with "partition by" doesn't work against Sybase IQ?

I'm seeing a problem when querying Sybase IQ with a prepared statement. The query works fine when I type the entire query as text and then call PrepareStatement on it with no parameters. But when I stick in one parameter, then I get back errors, even though my sql is correct. Any idea why? This code works perfectly fine and runs my que...

Sybase ASA 8 character issue - £ vs ú

I have an issue at a client where the same data field displays differently in our legacy application installed on two different machines. The character in question is the UK pound sign £ which on some machines displays as ú. I have tried to over-type this character with £ on machines where it's wrong, but this then "breaks" it on machin...

SQL min / max group by question

I have something like the following data structure: Category StartDateTime EndDateTime =============================================== 1 12/1/2009 12:00 12/1/2009 12:12 1 12/1/2009 04:00 12/1/2009 04:20 2 12/2/2009 10:15 12/2/2009 10:22 2 12/2/2009 11:00 12/2/2009 11:01 ...

Sybase ASE: "Your server command encountered a deadlock situation"

Hello, When running a stored procedure (from a .NET application) that does an INSERT and an UPDATE, I sometimes (but not that often, really) and randomly get this error: ERROR [40001] [DataDirect][ODBC Sybase Wire Protocol driver][SQL Server]Your server command (family id #0, process id #46) encountered a deadlock situation. Please ...

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

strong text ...

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

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 procedure that grabs this link_id, the query is ...