sybase

Does Nhibernate support Sybase?

I'm about to start on a new WPF application with a Sybase datastore. The team has experience with Nhibernate, but we are not really sure how well it supports Sybase and if there are some major pitfalls we should look out for. If yes, how about Fluent nhibernate? If not, do you know any other ORM products that we could use for Sybase i...

database encryption questions

We are using Sybase SQL Anywhere 11. We need to encrypt some of our tables in our database. I followed the instruction and did it. We selected the "strong" option with encryptionKey and AES256_FIPS algorithm. But there are something I am not clear about them. It will require encryptonKey when we create the database, remove the database...

Determine caller within stored proc or trigger

I am working with an insert trigger within a Sybase database. I know I can access the @@nestlevel to determine whether I am being called directly or as a result of another trigger or procedure. Is there any way to determine, when the nesting level is deeper than 1, who performed the action causing the trigger to fire? For example, w...

Sybase: programmatically turn off foreign key checks

Hi, I need to do bulk inserts/updates/deletes on a table-by-table basis via JDBC. Database is Sybase. Because of FK checks, I can't do this, because I temporarily violate integrity. In MySQL I can easily turn off and on constraint checks, by issuing a simple command. Is there some way to do the same in Sybase? Thanks. ...

There is not enough Procedure cache to run this procedure, Sybase ASE, C#

Hey everyone, I've having a small issue loading a ~50meg file into a database. Unfortunately, and before we ask why I'm doing this, I need to add this feature for legacy purposes. The column is setup as type Image which means I can't unfortunately load the data in chunks and concatenate them (since sybase doesn't not allow it for Image ...

Need help in converting String to Date format in Sybase

Hi, I am trying to convert two types of string into date format, however not able to do either of them. The problematic input strings with expected output are as follows: Input 1: 20100614191522 Expected output 1: 6/14/2010 7:15:22 PM Input 2: 2010/12 Expected output 2: 12/1/2010 12:00:00 AM I tried like , select convert(d...

What code could be used as a string aggregator for Sybase? (Like Oracle's stragg)

In my travels in Oracle, the 'stragg' function, or 'String Aggregator' was life-saving when I had to create dynamic SQL queries on the fly. You can read up about it here: http://www.oratechinfo.co.uk/delimited_lists_to_collections.html The basic use of it was: select stragg(fruit) from food; fruit ----------- apple,pear,banana,strawb...

Is there anyone out there using Clear Case with Sybase Powerbuilder?

Word has come from upon high to standardize our SCM system. And upon the clay tablets was written Clear Case. I am reaching out to anyone who is actually using this configuration - to get best practices, hints and tips, war stories, anything... The Sybase Source Control newsgroup only gives back the sound of crickets. We currently h...

how to count number of tables/views/index in my database

how to count number of tables/views/index in my database I am using sybase 11 ...

Access sql that triggered the trigger from within trigger (Sybase)

Is there a way to access the sql that triggered a trigger from within the trigger? I've managed to get it by joining to the master..monProcessSQLText MDA table but this only works for users with the mon_role and I don't want to give that to everyone. Is there a global variable I've missed? I'm trying to log all the updates run against...

How to replicate :new trigger functionality from Oracle to Sybase

I am trying to convert code from Oracle to Sybase, where there are manipulations occurring on the :new.x values. These triggers are BEFORE INSERT, so whatever changes in the :new values are replicated in the insert into the table the trigger is placed on. The Sybase triggers are fired after insert, but I can't seem to work out how to ge...

sql query help - how to properly join ??

Hi guys, Let's say if I have a table "PersonData" in which 4 of its columns are FromPersonId, FromEmployeeId, ToPersonId, ToEmployeeId Any of the records only ever contains Only one From** and Only one To** and the other two columns are null. Also FromPersonId and ToPersonId belong to "Person" table and FromEmployeeId and ToEmployeeId...

SQL: CASE and selecting multiple COLUMS

Hi Guys, How can I do this: Based on the select Case below I want to show TWO separate columns within one WHEN? The two lines below which are commented is what something I would like to have and I am sure it is something very simple I am missing....however i get syntax error select person.FirstName, person.LastName, CASE ...

sql multiple insert on one table, while looping/iterating over another table?

Hi Guys, I have two table "TempStore" and "Store" with the same column called "Items". There is data in "TempStore" table which I need to move over to "Store" table which requires few modifications. I need to iterate over "TempStore" data (i.e. items) and insert into Store... More specifically: How can I iterate over TempStore (in sq...

Varchar to UniVarchar: What are the tradeoffs?

We need to tranfer our database which has a current encoding of utf 8 to an iso 1 database server. As not to do any more cleaning of data I am thinking of converting varchar to univarchar. So in this way unicode encoding can be preserved in the iso 1 database server. Aside from the size(1byte for varchar vs 2 for univarchar) what are th...

sybase: get list of stored procedures using a particular table

Hi, I have 500 store procedures in a sysbase database. Using sql, can i get list of all stored procedures that are using a particular table say "tbl_books" Thanks ...

A tool that can detect redundant database tables

I'd like to find a tool that can detect redundant/unused tables and stored procedures in a sybase database. The DB is accessed from a Java application which uses JDBC to access both the tables and the stored procs. There are neraly 400 tables and a similar number of stored procedures. Any suggestions? ...

SQL stored proc - help me write this one, please!

Hi Guys, Could you please help me with this one: In one of my scripts I am inserting some data in to some table "Item". One of the columns in the "Item" table is "ItemNumber". I want to be able to call some function (most probably a Stored proc) where it would return me a numeric number which I can use for the ItemNumber. I CAN NOT ...

SQL stored proc - help me write this one, please! (part 2)

I have the following table with the value 501 in it.. CREATE TABLE _Numbers( Number numeric(20,0) NOT NULL PRIMARY KEY ) INSERT INTO _Numbers VALUES(501) How can I write a stored proc on this which returns me 501 and increments Number to next in sequence (i.e. 502)? I would like this behaviour repeated every time the stored proc i...

SQL query and stored procedure not producing desired results

I have this table and Stored proc function: Table: CREATE TABLE _DMigNumbers( Number numeric(20,0) NOT NULL PRIMARY KEY ); INSERT INTO _DMigNumbers VALUES(0) Stored proc function: CREATE FUNCTION read_and_increment() RETURNS NUMERIC(20,0) BEGIN DECLARE @number_just_read NUMERIC(20,0); SELECT number INTO @number_just_r...