sybase

What is a validationQuery with respect to databases and JNDI?

孤街浪徒 提交于 2019-11-29 14:22:21
I seem to be having the same exact problem as the poster of this original SO question . The problem is, he answered his own question with the following comment: I solved my problem, I added a validationQuery to my JNDI datasource. Unfortunately, that doesn't mean anything to me, and doesn't help me solve my problem. So I ask: what is a " validationQuery " with respect to my database (Sybase) and the JNDI entry used to hold the server lookup info? Thanks in advance. rgettman The validation query is a query run by the data source to validate that a Connection is still open before returning it.

Best practices for multithreaded processing of database records

瘦欲@ 提交于 2019-11-29 11:55:48
问题 I have a single process that queries a table for records where PROCESS_IND = 'N', does some processing, and then updates the PROCESS_IND to 'Y'. I'd like to allow for multiple instances of this process to run, but don't know what the best practices are for avoiding concurrency problems. Where should I start? 回答1: The pattern I'd use is as follows: Create columns "lockedby" and "locktime" which are a thread/process/machine ID and timestamp respectively (you'll need the machine ID when you

Getting ExecuteBatch to execute faster

梦想的初衷 提交于 2019-11-29 07:52:23
I'm trying to read a table from a sybase server, process the rows, and output the results to another table. (Below is my code) The code retrieves the table pretty fast and processes equally fast (get's to the part where it sends within 30 seconds). But When I run execute batch it sits there for 20 minutes before finish (fyi, I have a table which I'm testing with 8400 rows). Is there a more efficient way to do this? I'm amenable as to how I can recieve or send the queries (I can create a new table, update a table, etc) -- I just don't know why this is so slow (I'm sure the data < 1 MB and I'm

大规模数据如何检索?

倖福魔咒の 提交于 2019-11-29 07:07:08
思考:大规模数据如何检索? 如:当系统数据量上了10亿、100亿条的时候,我们在做系统架构的时候通常会从以下角度去考虑问题: 1)用什么数据库好?(mysql、sybase、oracle、达梦、神通、mongodb、hbase…) 2)如何解决单点故障;(lvs、F5、A10、Zookeep、MQ) 3)如何保证数据安全性;(热备、冷备、异地多活) 4)如何解决检索难题;(数据库代理中间件:mysql-proxy、Cobar、MaxScale等;) 5)如何解决统计分析问题;(离线、近实时) 来源: https://www.cnblogs.com/zeenzhou/p/11462649.html

Oracle TimesTen & Sybase ASE

久未见 提交于 2019-11-29 06:50:07
内存数据库(或IMDB)可以是一个独立的数据库管理系统(DBMS),如Oracle的TimesTen,或者从属于DBMS的一个特殊数据库,如SAP Sybase Adaptive Server Enterprise (ASE)。 IMDB的目标是通过使用计算机内存实现数据存储来提高吞吐量和降低延迟。这与使用磁盘存储的传统数据库管理系统不同。由于内部优化算法更简单,而且执行的CPU指令较少,所以内存内数据的速度比基于磁盘的数据库快。访问内存数据可以提高响应速度。对于一些响应时间要求较高的应用程序,如交易、电信和国防系统,一般都会使用IMDB。由于IMDB的这种特性,这些数据库使用内存要多于磁盘数据库产品。   Oracle TimesTen 和 Sybase ASE -IMDB是一种使用过程外主内存的数据库。它们实现了SQL的完整支持,也支持一些特殊语言、安全性和数据库管理。这两种数据库都支持通过SQL访问数据。它们都具有一些磁盘数据库产品的特性。因此,使用这些产品缓存SQL后台持久化数据库的SQL请求就很简单。   TimesTen、ASE-IMDB及现有的所有商业内存数据库都基于所谓的基于行的关系存储模型。这些产品很适合OLTP应用程序使用。   Oracle TimesTen内存数据库是什么?   Oracle TimesTen是一个全新设计的内存数据库。它使用基于行的关系模型

Get records from last hour

北战南征 提交于 2019-11-29 06:12:57
问题 I have this query: SELECT Field1, OrderFor, Writeback, Actshipdate, Orderstatus, receivedate, receivetime FROM orderinfo, shippinginfo WHERE orderinfo.orderid = shippinginfo.orderid AND shippinginfo.custid = '37782' AND receivedate = DATE(NOW()) AND receivetime = ??????? I am using Sybase adaptive server anywhere and trying to get records for the last hour. 回答1: try this !! SELECT Field1, OrderFor, Writeback, Actshipdate, Orderstatus, receivedate, receivetime FROM orderinfo, shippinginfo

Convert INT to VARCHAR SQL

为君一笑 提交于 2019-11-28 15:21:32
I am using Sybase and I am doing a select which returns me a column called "iftype", but its type is int and I need to convert into varchar. When I try to do the select without the convert function I get this error: Error code 257, SQL state 37000: Implicit conversion from datatype 'VARCHAR' to 'INT' is not allowed. Use the CONVERT function to run this query. I dont know how to implement the function CONVERT . Can anyone help me, please ? Tobberoth Use the convert function. SELECT CONVERT(varchar(10), field_name) FROM table_name Mahdi Use the STR function: SELECT STR(field_name) FROM table

Sybase offset for pagination

对着背影说爱祢 提交于 2019-11-28 11:30:26
Is there any simple way to implement pagination in sybase? In postgres there are limit and offset in mysql there is limit X,Y. What about sybase? There is top clausure to limit results but to achieve full pagination there is also offset needed. It is not a problem if there are a few pags, I can simply trim results on the client side, but if there are millions of rows I would like to fetch only data that I need. kolchanov Quoting from http://www.isug.com/Sybase_FAQ/ASE/section6.2.html#6.2.12 : Sybase does not have a direct equivalent to Oracle's rownum but its functionality can be emulated in a

how to specify row delimiter when using bcp with a format file

半世苍凉 提交于 2019-11-28 10:31:27
问题 I am using bcp utility to import data into Sybase database on Solaris system Since the bcp file is generated by another xml parsing script, I have no control on that to make it generate the fields in the order I want. And now the the order of fields in the bcp file is a little different with the order in the database table. I want to use a format file for bcp tool to control the order of fields loaded into the database, so I have the sample bcp file as below and constructed a format file

Sybase Oracle SQL 存储过程的创建和执行

£可爱£侵袭症+ 提交于 2019-11-28 09:58:45
Sybase 存储过程的创建和执行 --返回值为int的存储过程 create proc testReturn @tname varchar(12) , @tid int output as begin set @tid = (select testid from Mytest where testname=@tname) return end --返回值为varchar的存储过程 create proc testReturnT @tid int , @tname varchar(12) output as begin set @tname = (select testname from Mytest where testid=@tid) return end --可以正确执行 declare @tid int exec testReturn 'testname', @tid output select @tid --本意是想直接输出输出参数 declare @tname varchar(12) exec @tname = testReturnT 3,@tname output select @tname --异常:Implicit conversion from datatype 'INT' to 'VARCHAR' is not allowed. Use the CONVERT