sybase

shell Command execution Failing when executed from Java

只谈情不闲聊 提交于 2019-12-02 21:02:01
问题 When I execute the below command on command line, it shows all the stored procedures and tables in the sybase DB. printf 'sp_help\ngo\n' | isql -Uxx -Pxxxx -Dxxxxx But when I do the same thing in java. This does not return any result. Can anyone tell me what is the problem with my code below: public class test { public static void main(String[] args) { String cmd = "printf "+"\'sp_help\ngo\n\'"+"| isql -Uxx -Pxxxx -Dxxxxx" ; try{ Process p; p = Runtime.getRuntime().exec(cmd); p.waitFor();

Sybase ASE学习笔记

我的未来我决定 提交于 2019-12-02 15:58:53
通过这两天的学习,由于之前完全没有接触过sybase,发现sybase跟oracle或者SQL server都有比较大的差别,一是需要配置运行sybase的环境,二是sybase采用的是Transaction-SQL。三是,其数据库管理开始时让我很不习惯。 在接触别人安装了的sybase(linux 64bit-ase15.7)时,我发现sybase老是连不上,通过showserver命令来查看,shell却说没此命令,接着进入其安装 SYBASE_HOME/ASE-15_0/install/检查了,showserver没有问题,但启动./startServer.sh时,发现错误 了,出现了can execute file RUN_SYBASE。此刻我发现了我与本目录的RUN_*****不同,虽然意识到不同,但我只是mark下它而没有进行进一步思考。通过上网搜索资 料,如果sybase是安装成功,那么应该就是环境问题了。所以我调用./SYBASE.sh(我以为起码当前的环境就配好了),于是我就调用isql -Usa -S服务名、isql -Usa -S192.168.*.*和isql -Usa -S192.168.*.*:5000 以及它们各种变形,其间还需用注意得在SYBASE_HOME/OCS-15_0/bin目录下(即存在isql.sh脚本文件的目录下),这里花了我不

如何查找数据库启动的失败原因

走远了吗. 提交于 2019-12-02 15:58:45
 首先,应检查Server的日志文件。不同版本缺省的日志文件如下(其中<server_name>为Sybase Server的名称: UNIX: 11.0*: $SYBASE/install/errorlog 11.5* 或 11.9*: $SYBASE/install/<server_name>.log 12.0*: $SYBASE_ASE/install/<server_name>.log NT: 11.0* 11.5* 或 11.9*: $SYBASE\install\errorlog 12.0*: $SYBASE\ASE-12_0\install\errorlog CASE 1: basis_dlock: file '/sybase/master.dat' already in use by a SQL Server kernel kdconfig: unable to read primary master device kernel kiconfig: read of config block failed 检查server是否已经启动( showserver, ps -u sybase 或NT service ) CASE 2: dopen: open '/sybase/master.dat' failed, permission denied kernel

need to convert data in multiple rows with same ID into 1 row with multiple columns

旧街凉风 提交于 2019-12-02 15:06:49
问题 I reviewed versions of my question already addressed, but some of the good tips I found (using rank() over (partition...) for example, do not seem to work in the Sybase version I am on. I am hoping to run a procedure that pulls data organized as follows: Email | Preference email1 | PreferenceXYZ email1 | PreferenceABC And render it in a table like the following: Email | Preference1 | Preference2 email1 | PreferenceXYZ | PreferenceABC In essence, I have multiple records for the same person

Does the order of columns on a covered index in Sybase affect select performance?

梦想的初衷 提交于 2019-12-02 12:37:45
问题 We have a large table, with several indices (say, I1-I5). The usage pattern is as follows: Application A: all select queries 100% use indices I1-I4 (assume that they are designed well enough that they will never use I5). Application B: has only one select query (fairly frequently run), which contains 6 fields and for which a fifth index I5 was created as a covered index. The first 2 fields of the covered index are date, and a security ID. The table contains rows for ~100 dates (in date order,

Entity Data Model wizard disappears SQL Anywhere 17

大憨熊 提交于 2019-12-02 09:54:29
问题 I am trying to make a new model using Entity Framework 6 and SQL Anywhere 17. I followed exactly these steps. http://dcx.sap.com/index.html#sqla170/en/html/37fb9e8558e94547b66156b9298be16f.html But when I go through Entity Data Model wizard, it disappears after the following screen. 回答1: I got same Issue and able to resolve by following these step. Open server explorer tab- Delete all existing data connections- Rebuild your project- After this Entity Data Model wizard will not disappears. 来源:

shell Command execution Failing when executed from Java

柔情痞子 提交于 2019-12-02 08:38:51
When I execute the below command on command line, it shows all the stored procedures and tables in the sybase DB. printf 'sp_help\ngo\n' | isql -Uxx -Pxxxx -Dxxxxx But when I do the same thing in java. This does not return any result. Can anyone tell me what is the problem with my code below: public class test { public static void main(String[] args) { String cmd = "printf "+"\'sp_help\ngo\n\'"+"| isql -Uxx -Pxxxx -Dxxxxx" ; try{ Process p; p = Runtime.getRuntime().exec(cmd); p.waitFor(); String line; BufferedReader reader = new BufferedReader(new InputStreamReader(p.getInputStream())); while

comparing null in SQL comparisons

三世轮回 提交于 2019-12-02 07:38:55
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 else 0 end) as answered_calls ," _ & " sum(case when user_id <> NULL and datediff (ss, callstartdt,

Entity Data Model wizard disappears SQL Anywhere 17

我是研究僧i 提交于 2019-12-02 06:44:21
I am trying to make a new model using Entity Framework 6 and SQL Anywhere 17. I followed exactly these steps. http://dcx.sap.com/index.html#sqla170/en/html/37fb9e8558e94547b66156b9298be16f.html But when I go through Entity Data Model wizard, it disappears after the following screen. I got same Issue and able to resolve by following these step. Open server explorer tab- Delete all existing data connections- Rebuild your project- After this Entity Data Model wizard will not disappears. 来源: https://stackoverflow.com/questions/37178496/entity-data-model-wizard-disappears-sql-anywhere-17

How Do I Generate Sybase BCP Fmt file?

你离开我真会死。 提交于 2019-12-02 06:20:43
问题 I have a huge database which I want to dump out using BCP and then load it up elsewhere. I have done quite a bit of research on the Sybase version of BCP (being more familiar with the MSSQL one) and I see how to USE an Import file but I can't figure out for the life of me how to create one. I am currently making my Sybase bcp out files of data like this: bcp mytester.dbo.XTABLE out XTABLE.bcp -U sa -P mypass -T -n and trying to import them back in like this: bcp mytester.dbo.XTABLE in XTABLE