sybase

Cannot insert into table because the table already exists?

青春壹個敷衍的年華 提交于 2019-12-22 03:42:12
问题 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 Sybase. I know this. I know the table exists. I want to insert data into it. Why is Sybase not playing nicely? :( (Sybase isn't my forte, Oracle is. This may just be an

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

佐手、 提交于 2019-12-22 00:34:23
问题 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 is that if two execution paths try to run the query at the same time I want the second one to block so it does not grab the same record. The problem is I've found that you

Execute stored proc with OPENQUERY

只谈情不闲聊 提交于 2019-12-21 16:21:19
问题 I have SQL Server 2008 with a linked Sybase server and I am trying to execute a stored procedure on the Sybase server using OPENQUERY. If I have a stored proc that doesn't take parameters it succeeds fine. If I have a stored proc with parameters it fails. I even tried a very basic stored proc that only took an int an that still failed. Below is the syntax I am using: select * from OPENQUERY([LINKSERVER],'exec database.user.my_stored_proc ''AT'',''XXXX%'',''1111'',1') Msg 7357, Level 16, State

Answers to the mysterious Sybase ASE 'timestamp' datatype questions

為{幸葍}努か 提交于 2019-12-21 12:56:08
问题 Eric Johnson ask the following questions in Aug 2010. "What is the mysterious 'timestamp' datatype in Sybase? What the heck is a timestamp? Does it have any relation at all to time or date? Can I convert it to a datetime? If its not a time or a date, what do you use it for?" I attempted to answer the above post but this site would not accept a new answer due to the age of the original post. As the subject matter remains a FAQ amongst SAP/Sybase ASE professional, I have decided to re-post the

SQL Union to NHibernate Criteria

江枫思渺然 提交于 2019-12-21 12:28:58
问题 There's a way to convert this SQL statement to a NHibernate Criteria? (select b1.FieldA as Name, b1.FieldA as FullName from Sale b1 where b1.FieldA like '%john%' or b1.FieldA like '%john%' order by b1.Id desc) union (select b2.FieldC as Name, b2.FieldD as FullName from Sale b2 where b2.FieldC like '%john%' or b2.FieldD like '%john%' order by b2.Id desc) union (select c.FieldE as Name, c.FieldF as FullName from Client c where c.FieldE like '%john%' or c.FieldF like '%john%' order by c.Id desc)

SQL Union to NHibernate Criteria

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-21 12:26:10
问题 There's a way to convert this SQL statement to a NHibernate Criteria? (select b1.FieldA as Name, b1.FieldA as FullName from Sale b1 where b1.FieldA like '%john%' or b1.FieldA like '%john%' order by b1.Id desc) union (select b2.FieldC as Name, b2.FieldD as FullName from Sale b2 where b2.FieldC like '%john%' or b2.FieldD like '%john%' order by b2.Id desc) union (select c.FieldE as Name, c.FieldF as FullName from Client c where c.FieldE like '%john%' or c.FieldF like '%john%' order by c.Id desc)

Any alternative to Sybase Sql Advantage? [closed]

不羁岁月 提交于 2019-12-21 05:41:32
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . Sybase Sql Advantage is the default editor for the Sybase database. But it has lots of shortcomings, because it basically is what Notepad is for Windows users: Can't do multiple undo's Monochrome, text is black and background is white Can't see what character did you exactly paste from clipboard, and sometimes

Loading 26MB text data from database consume JVM heap of 258MB

二次信任 提交于 2019-12-21 05:22:08
问题 An app (Spring, JPA Hibernate, Sybase 12, Webapp) when run locally on startup consumes 40MB of the 256MB heap space based on VisualVM. When I trigger a search that returns 70,000+ rows (text data no blobs) the heap space graph shoots up to 256MB and throws out of memory. I have resolved this by using setMaxResults(limit). However, when I queried the same data, copy-pasted to a text file and saved to the filesystem, I can see that the size is only 26MB worth of text. So in effect, 216MB(from

ResultSet.getTimestamp(“date”) vs ResultSet.getTimestamp(“date”, Calendar.getInstance(tz))

爱⌒轻易说出口 提交于 2019-12-20 20:01:02
问题 java.util.Date , java.util.Timetamp were seems to be causing great confusion for many. Within StackOverflow there are so many questions, Unfortunately my question is bit twisted. There are 2 JDBC api. How they should perform? Was there any consistencies among RDBMS’es? ResultSet.getTimestamp("dateColumn") ResultSet.getTimestamp("dateColumn", Calendar.getInstance(tz)) If someone has knowledge in Sybase, could you please share your experience? 回答1: First, you're confusing java.util with java

comparing null in SQL comparisons

旧街凉风 提交于 2019-12-20 03:54:30
问题 I am creating a front end with VB6 and my database is Sybase. Using DSN I have created some small exe's to populate reports in grid. It was working fine. However if I use the below query I am getting only hour and Answered data. If I execute the query in SQL Query complete data is coming. I believe the sum(case when will not work in VB6, please guide me for an alternate. "select datepart (hh, callstartdt) as Hour, " _ & " count(seqnum) as Anaswered," _ & " sum(case when user_id <> NULL then 1