sybase

HibernateException: Wrong column type:x, expected: y on Sybase

自作多情 提交于 2019-12-08 02:51:18
问题 I don't have much background on the technologies below so any help would be appreciated. Please feel free to ask questions if something's not clear. I'm currently working on a migration project wherein we're updating a number of technologies including: Sybase - from 12.x to 15.7 JConnect - from several versions to 7.0.7_SP130 Now, our apps are deployed on to JBoss 4.x and use Hibernate 3.2.4.sp1 . In the old DB, we have a number of custom datatypes that look something like this (sorry, would

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

*爱你&永不变心* 提交于 2019-12-07 23:56:23
问题 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 is called. (Also, how can I call this stored proc from any query?) Part of my previous question 3151056. Thanks, Voodoo 回答1: CREATE OR REPLACE PROCEDURE read_and

数据库的选择(一)

不打扰是莪最后的温柔 提交于 2019-12-07 15:55:01
数据库如何选择 常用的数据库一般是分为五种: ( 一 ) 、 Access( 二 )SqlServer( 三 )MySQL( 四 )Oracle( 五 )SQLite ,那么,用户想做一个网站,到底 哪一种数据库是适合自己的呢 ? 以下给大家介绍一下常用的数据库有什么区别或是功能方面。 1 、 Access Access 是由微软发布的一款关联式数据序管型系统 , 常被用来开发 Web 应用程序这些应用程序都利用 Asp 技术在 IIs 上运行。不 过中于 Access 是小型数据库,商着根本的使用局限性,在数据库过大或者访间量高的时候性能会急剧下降。 2 、 Mysql MySQL 是一个小型关系型数据库管理系统,开发者为瑞典 MySQLAB 公司,在 2008 年 1 月 16 号被 Sun 公司收购。 MySQL 被广泛 地应用在 Internet 上的中小型网站中。由于其体积小、速度快、总体拥有成本低,尤其是开放源码这一特点,许多中小型网站为 了降低网站总体拥有成本而选择了 MySQL 作为网站数据库。 3 、 SqlServer SqlServer 的特点是真正的客户 / 服务器体系结构 , 并且出十是图形化的用户界面,使数据库管理方式更加直观和简单。它还提供 了丰富的编程接口工具 为用户进行程序设计提供了更大的选择余 。 4 、 Oracle Oracle

Hibernate timestamp version controlled by database.

假如想象 提交于 2019-12-07 14:52:49
问题 I'm using both Hibernate annotations and Sybase. I'm looking to setup a version column to prevent locking. The database needs to administrate the timestamp rather than the application. I would like to accomplish this using annotations rather than hbm.xml. I've tried the following without success, I read on jboss.org to use @org.hibernate.annotations.SourceType.DB @org.hibernate.annotations.Generated(GenerationTime.ALWAYS) however I'm getting an IDE compiling error for DB, "cannot find symbol

Python 3 and Sybase and other databases

允我心安 提交于 2019-12-07 14:20:38
问题 I am new to python. Sorry if this is a noob question. But I am still searching on how can I connect to databases using python 3. Most of what I can see on some sites, forums, are about python 2. Is there any good DBAPI or database driver for python 3 (especially sybase, oracle and sqlserver)? Or did anyone succeed on porting sybase library using 2to3? I have no luck. :( 回答1: To use Python (2.6,2.7 and 3.1 are supported) with Sybase ASE you need two things: sybpydb extension module for Python

How can I COUNT the number of rows in a database for different time periods?

孤者浪人 提交于 2019-12-07 12:41:52
问题 I've got a table in a Sybase DB with a column createdDateTime. What I want to be able to do is count how many rows were created between specific but accumulating time periods, ie: 7:00 - 7:15 7:00 - 7:30 7:00 - 7:45 7:00 - 8:00 ... and so on until I have the last time group, 7:00 - 18:00. Is there a nice way to make one query in SQL that will return all the rows for me with all the row counts: Time Rows Created 7:00 - 7:15 0 7:00 - 7:30 5 7:00 - 7:45 8 7:00 - 8:00 15 ... ... I have a solution

Is there a way to communicate application context to a DB connection in non-Sybase DB servers (similar to set_appcontext in Sybase)?

匆匆过客 提交于 2019-12-07 12:37:01
问题 Sybase has a way for the application to communicate "context" data - such as application's end-user name, etc.. - to the database connection session. Context data is basically just a set of key-value pairs which is stored/retrieved via set_appcontext / get_appcontext stored procs. QUESTION : Do other major DB servers (MSSQL/Oracle/MySQL) have a facility for communicating app context to the session similar to Sybase's set_appcontext ? Details : One specific practical use of app context is when

Selecting the first row from each group, with ORDER BY more than one column

元气小坏坏 提交于 2019-12-07 10:48:46
问题 I have a table T with columns x , y , a , b such that SELECT x,y,a,b FROM T ORDER BY x,y,a,b gives me the following table x | y | a | b x1 | y1 | a1 | b1 x1 | y1 | a1 | b2 x1 | y1 | a2 | b1 x1 | y2 | a1 | b1 x1 | y2 | a1 | b2 x1 | y2 | a2 | b1 How would I get the first row of each x,y group? That is, how would I get the following table x | y | a | b x1 | y1 | a1 | b1 x1 | y2 | a1 | b1 Here is a second example: For a table T such that x | y | a | b x1 | y1 | a1 | b3 x1 | y1 | a1 | b4 x1 | y1 |

Sybase Development IDE

隐身守侯 提交于 2019-12-07 07:30:40
问题 Is there a Toad type application for Sybase? I can't seem to find a single one! I've tried using VS 2008 but can't see the sproc source. 回答1: Am assuming Sybase ASE. Ships with Sybase Central and SQL Advantage as part of the client tools. Sybase Central lets you manage and create tables, views, sprocs etc. SQL Advantage lets you run SQL... Sybase Workspace is a new tool for ASE, I've never tried it. http://www.sybase.com/products/modelingdevelopment/workspace ASE ISQL is a free tool that is

Oracle equivalent to SQL Server/Sybase DateDiff

淺唱寂寞╮ 提交于 2019-12-07 04:38:36
问题 We are now using NHibernate to connect to different database base on where our software is installed. So I am porting many SQL Procedures to Oracle. SQL Server has a nice function called DateDiff which takes a date part, startdate and enddate. Date parts examples are day, week, month, year, etc. . . What is the Oracle equivalent? I have not found one do I have to create my own version of it? (update by Mark Harrison) there are several nice answers that explain Oracle date arithmetic. If you