sybase

Select Query on 2 tables, on different database servers

爷,独闯天下 提交于 2019-12-19 03:43:12
问题 I am trying to generate a report by querying 2 databases (Sybase) in classic ASP. I have created 2 connection strings: connA for databaseA connB for databaseB Both databases are present on the same server (don't know if this matters) Queries: q1 = SELECT column1 INTO #temp FROM databaseA..table1 WHERE xyz="A" q2 = SELECT columnA,columnB,...,columnZ FROM table2 a #temp b WHERE b.column1=a.columnB followed by: response.Write(rstsql) <br> set rstSQL = CreateObject("ADODB.Recordset")<br> rstSQL

How in JDBC can you call a stored procedure when only setting some parameters

谁都会走 提交于 2019-12-19 03:38:40
问题 What is the best way to make a call to a stored procedure using JDBC if you only want to set some of the parameters? If I was just using SQL, I could set the paramerers by name in the SQL to call the sproc. E.g. if I have a stored procedure with nine parameters and I wanted to set parameters 1,2 and 9, leaving the rest to their default values, I can run this SQL: exec my_stored_procedure @parameter_1 = "ONE", @parameter_2 = "TWO", @parameter_9 = "NINE" Using JDBC (Specifically jConnect 6.0),

Sybase, execute string as sql query

会有一股神秘感。 提交于 2019-12-19 02:04:21
问题 In Sybase SQL, I would like to execute a String containing SQL. I would expect something like this to work declare @exec_str char(100) select @exec_str = "select 1" execute @exec_str go from the documentation of the exec command execute | exec is used to execute a stored procedure or an extended stored procedure (ESP). This keyword is necessary if there are multiple statements in the batch. execute is also used to execute a string containing Transact-SQL. However my above example gives an

What is a validationQuery with respect to databases and JNDI?

一曲冷凌霜 提交于 2019-12-18 08:29:09
问题 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. 回答1: The validation query is

how to set row number in sybase query

巧了我就是萌 提交于 2019-12-18 07:04:50
问题 I have a select statemnt which will return results say 1000 using join with some 3 to 4 tables. My requirement is to have identity column in the resultset . Can anyone help me on this. ex : Result : id name -- ---- 001 xxx 002 yyy 003 zzz My requirment : Rowid id name 1 -- ---- 2 001 xxx 3 002 yyy 4 003 zzz Like Row_number in sql , do we have anything here in sybase 回答1: In sybase there isn't row_number or something like that. Maybe temporary tables with identity column will help you?

Error Handling in Sybase

心已入冬 提交于 2019-12-18 06:48:29
问题 Is there a way to handle errors in SYBASE , such as the TRY-CATCH block you can use in MS SQL Server , Oracle , etc? I've searched the web and the only option I found was the global variable @@error , but it didn' work as I expected, for example, the following code: begin tran update table1 set name = 'new name' where name = 'old name' update table2 set id = 1 where id = 30 -- suppose id has a unique constraint and there's already a row with id = 1 IF @@error = 0 begin print 'commited' commit

Difference between drop table and truncate table?

拟墨画扇 提交于 2019-12-17 22:29:59
问题 I have some tables that I build as a part of my report rollup. I don't need them afterwards at all. Someone mentioned to truncate them as it would be faster. 回答1: Deleting records from a table logs every deletion and executes delete triggers for the records deleted. Truncate is a more powerful command that empties a table without logging each row. SQL Server prevents you from truncating a table with foreign keys referencing it, because of the need to check the foreign keys on each row.

PDO To Connect to MSSQL Over MSSQL_* Functions

牧云@^-^@ 提交于 2019-12-17 20:07:09
问题 There is a range of mssql_* Which are not in the depreciation process. They work the same as mysql_* functions; they need to me manually escaped, please find the link to the manual below: http://uk1.php.net/manual/en/book.mssql.php MSSQL_* Functions was apart of php5-mssql but have now been moved into php5-sybase Furthermore, using PDO for your Database Construct, is available but is experimental http://php.net/manual/en/ref.pdo-dblib.php But my overall question, from the fact that PDO/MySQLI

From a Sybase Database, how I can get table description ( field names and types)?

早过忘川 提交于 2019-12-17 17:28:53
问题 I have access to command line isql and I like to get Meta-Data of all the tables of a given database, possibly in a formatted file. How I can achieve that? Thanks. 回答1: Check sysobjects and syscolumns tables. Here is a diagram of Sybase system tables. List of all user tables: SELECT * FROM sysobjects WHERE type = 'U' You can change 'U' to other objects: C – computed column D – default F – SQLJ function L – log N – partition condition P – Transact-SQL or SQLJ procedure PR – prepare objects

hibernate 各种方言

試著忘記壹切 提交于 2019-12-14 11:27:59
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> DB2 org.hibernate.dialect.DB2Dialect DB2 AS/400 org.hibernate.dialect.DB2400Dialect DB2 OS390 org.hibernate.dialect.DB2390Dialect PostgreSQL org.hibernate.dialect.PostgreSQLDialect MySQL org.hibernate.dialect.MySQLDialect MySQL with InnoDB org.hibernate.dialect.MySQLInnoDBDialect MySQL with MyISAM org.hibernate.dialect.MySQLMyISAMDialect Oracle (any version) org.hibernate.dialect.OracleDialect Oracle 9i/10g org.hibernate.dialect.Oracle9Dialect Sybase org.hibernate.dialect.SybaseDialect Sybase Anywhere org.hibernate.dialect.SybaseAnywhereDialect Microsoft SQL