sybase

weird phenomena during deadlocks involving IMAGE or TEXT columns

你说的曾经没有我的故事 提交于 2019-12-14 04:05:44
问题 This is something very disturbing I stumbled upon while stress-testing an application using Sybase ASE 15.7. We have the following table: CREATE TABLE foo ( i INT NOT NULL, blob IMAGE ); ALTER TABLE foo ADD PRIMARY KEY (i); The table has, even before starting the test, a single row with some data in the IMAGE column. No rows are either deleted or inserted during the test. So the table always contains a single row. Column blob is only updated (in transaction T1 below) to some value (not NULL).

How to remove/rename a duplicate column in SQL (not duplicate rows)

岁酱吖の 提交于 2019-12-14 03:49:01
问题 When attempting to do an OPENQUERY from Sybase to Microsoft SQL I run into an error: Duplicate column names are not allowed in result sets obtained through OPENQUERY and OPENROWSET. The column name "PatientID" is a duplicate. The query I have built joins 2 tables based on similar admissionID and patientID. For Instance: PatID AdmID Loc PatID AdmID Doctor 1 5 NC 1 5 Smith 2 7 SC 2 7 Johnson The real query of course has a ton more information than just this. Is there a good way to rename or

not able to run isql on cygwin

流过昼夜 提交于 2019-12-14 02:08:46
问题 When I am trying to run sybase query through isql syntex it is giving below error. Error - "The context allocation routine failed when it tried to load localization files!! One or more following problems may caused the failure Your sybase home directory is C:\Sybase. Check the environment variable SYBASE if it is not the one you want! Using locale name "en_US.UTF-8" defined in environment variable LANG Locale name "en_US.UTF-8" doesn't exist in your C:\Sybase\locales\locales.dat file An error

Sybase Select Statement

非 Y 不嫁゛ 提交于 2019-12-13 08:05:15
问题 I am trying to select with some specific conditions but cannot seem to get what I am wanting. Table Person person_id | first_name | last_name Table Service service_id | person_id | start_time | end_time | service_type_id Table Service_Types type_id | description Table Service_User service_id | start_time | end_Time | user_id The goal is to get all of the person_id's that meet any of the following criteria: Last Name Like 'Mar%' Service Type Like 'Fusions%' Service Type Like 'New%' And User_Id

Problems with running Sybase SQL Script from C# - too many parameters

独自空忆成欢 提交于 2019-12-13 04:38:02
问题 I'm having issues running a Sybase SQL Script from an AseCommand object in the Sybase API. Here are copies of my script, which is passed into the C# as the sql string parameter SQL Script: DECLARE @dt DATETIME DECLARE @mx INT SELECT @dt = getDate() EXEC DATABASE_NAME..StoredProcedure1 @id_own_grd = 200, @id_dom_grd = 'TEST VALUE', @value = @mx OUTPUT EXEC DATABASE_NAME..StoredProcedure2 @id_level = @mx, @id_level_pt=NULL, @id_obj1 = 58464819, @id_typ_lvl='TEST', @am_test=20130916, @id_obj1

Can I use the wildcard for table name while selecting from multiple table?

大城市里の小女人 提交于 2019-12-13 04:34:55
问题 My problem is there are multiple tables like table_1, table_2,...,table_100 Now I want to query from all tables at once, is that possible? Right now I am using SQL like this select * from table_1 union select * from table_2 union . . 来源: https://stackoverflow.com/questions/31698025/can-i-use-the-wildcard-for-table-name-while-selecting-from-multiple-table

Running bulk of SQL Scripts in Sybase through batch

前提是你 提交于 2019-12-13 04:28:53
问题 I was using below code(as .bat file) to recursively execute the bulk of .sql files, having SQL SERVER 2008 R2 as backend: for /R %%G in (*.sql) do sqlcmd /S [Database Server] /d [Database name] -U [Username] - P[Password] -i"%%G" pause Now, i i have to execute bulk of sql scripts but this time Sybase as backend. Please suggest me what modification should i do to make it run for 'Sybase'!! 回答1: The connection string for Sybase is very similar isql -U [username] -P [password] -S [servername] -D

Caused by: com.sybase.jdbc2.jdbc.SybSQLException: The column detail_id in table exam does not allow null values

只谈情不闲聊 提交于 2019-12-13 04:13:44
问题 I have two tables between which I am trying to establish a 1-to-1 mapping using Hibernate. ExamDetail.java package com.hibernate.mapping; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.Table; @Entity @Table(name="exam_detail") public class ExamDetail { private int id; private String fullName; private int numberOfQuestions; private int passingPercentage; @Id @GeneratedValue @Column

How to export Sybase table contents to a text file?

穿精又带淫゛_ 提交于 2019-12-13 03:47:29
问题 I want to export the tables with contents from a Sybase database to a text file. I am using Sybase ASE 15.5 and that can't be changed/upgraded. I have tried using sp_tables and different Select commands, but they don't give the result I'm looking for. The output format I'm looking for is something like this: FIRST_TABLE Column_1 Column_2 Column_3 Roger Male 51 Anne Female 46 SECOND_TABLE Column_1 Column_2 Column_3 BMW German Car Schwinn American Bicycles etc.etc. 回答1: Create a view that

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

感情迁移 提交于 2019-12-13 03:24:52
问题 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 use AutoIncrement because ItemNumber is unique and there might be a collision when in a differnt script I am inserting data in "Item", which already has "ItemNumber" I only