sybase

sybase中表迁移到oracle中

寵の児 提交于 2019-12-07 02:22:26
Aqua Data Studio下: 选定表,右击----->Tools----->Export Data 在右侧Objects视图中,自己选定的表已经打√,同时,你也可以选择多个,只要在复选框中打√就行。 ----->Next,可以改变导出文件位置,以及编码等,还有部分特殊数据格式。 ----->Next,等待导出,导出状态显示,completed即完成。 -------------------------------------------------------------------------------------------------------- 查询建表语句 选定表,右击----->Script Object to Window as ----->CREATE,建表语句在右侧窗口显示, 复制 。 PL/SQL下: 在SQL窗口中,将建表语句粘贴,运行成功。[可能其中有的关键字和语句规则不一样,如果运行失败,请注意改动] 工具栏,Tools----->Text Importer...-----> Open Data File 上传刚刚导出的txt文件, 第一次导入,一些配置选项可能不会自动分配,需要自己手动选择。 【 Data from Textfile 】File Data视图里,是你txt文件中的预览; Configuraion--General-

PHP PDO installation on windows (xampp)

天涯浪子 提交于 2019-12-06 20:06:19
问题 I am trying to develop a web app that can connect to as many different databases as possible on PHP. PDO (http://www.php.net/manual/en/book.pdo.php) seems to be the right interface for it but I am having trouble installing all the extentions needed for all the different PDO database drivers that I need. Please note that I use xampp on a windows 7 machine. PHP Version 5.3.8. PDO drivers enabled mysql, odbc, sqlite, sqlite2, sqlsrv. I have successfully connected with the following: MySQL using

Analog of “select level from dual connect by level < 10” for Sybase?

試著忘記壹切 提交于 2019-12-06 16:36:29
By select level from dual connect by level < 10 in Oracle I can generate sub-query of integer and transform it to another sequence. Is this possible with Sybase? PS I want to find dates where are no data in table (missing days). In Oracle I do this as: select to_date('2012-01-01', 'yyyy-mm-dd')+level-1 from dual connect by level < to_date('2013-01-01', 'yyyy-mm-dd') - to_date('2012-01-01', 'yyyy-mm-dd') MINUS select distinct date from TBL where date between to_date('2012-01-01', 'yyyy-mm-dd') and to_date('2013-01-01', 'yyyy-mm-dd') In Sybase analog for MINUS is: select whatever from table1 T1

PHP7 - Connect to sybase database

拈花ヽ惹草 提交于 2019-12-06 12:07:17
http://php.net/manual/en/function.sybase-connect.php is removed as from PHP7. So now I am gettings this error: PHP Fatal error: Uncaught Error: Call to undefined function sybase_connect() How am I supposed to connect to sybase now with PHP7? You are using Ubuntu 16.04, so after installation of php7.0-sybase package in your system, you are able to connect with Sybase database using pdo_dblib Example #1 PDO_DBLIB DSN examples sybase:host=localhost;dbname=testdb Following general PDO reference , you create connection like this $databaseHandler = new PDO('sybase:host=localhost;dbname=testdb',

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

陌路散爱 提交于 2019-12-06 09:21:31
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 have loved to put this in table format, but I don't know how to here...) : Custom datatype : TYPE1,

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

℡╲_俬逩灬. 提交于 2019-12-06 07:07:05
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 CREATE OR REPLACE PROCEDURE read_and_increment (number_just_read OUT NUMBER) IS BEGIN DECLARE stored_number NUMBER DEFAULT NULL; BEGIN SELECT number

Sybase sp_who truncates hostname

≡放荡痞女 提交于 2019-12-06 06:38:07
问题 I am connecting to sql databse using Rapid SQL or isql provided by sybase server. When I issue sp_who username command I should get list of connected users. I do but hostname column is truncated so for example when host address is host0001 it get truncated to host0 this is a problem because there are many hosts which names start with same prefix e.g. host001, host002.... Because of that I do not know which processes are blocking my database and I can not log to the machine and kill those

Hibernate timestamp version controlled by database.

我只是一个虾纸丫 提交于 2019-12-06 03:25:01
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 symbol: class DB location: class SourceType" and a compiling error for rowVersion, The Version field or

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

让人想犯罪 __ 提交于 2019-12-06 03:13:21
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 at the moment, but it requires me running a parameterised query 44 times to get all the data. Thanks,

What is the best way to connect to a sybase database from python?

匆匆过客 提交于 2019-12-06 02:13:33
问题 I am trying to retrieve data in a sybase data base from python and I was wondering which would be the best way to do it. I found this module but may be you have some other suggestions: http://python-sybase.sourceforge.net/ Thanks 回答1: The sybase module you linked is by far the easiest way. You can get data like so: import Sybase db = Sybase.connect('server','name','pass','database') c = db.cursor() c.execute("sql statement") list1 = c.fetchall() print list1 You will have to use something like