informix

This IfxTransaction has completed; it is no longer usable

拥有回忆 提交于 2019-12-02 04:45:52
Q: When I use the transactions ,I'll get the following error on about 1 out of every 100 record. This IfxTransaction has completed; it is no longer usable I can't expect when the error happen or what is the reason of this error. I try to insert about 607 record in the same transaction. My code: public static int InsertGroups(List<Group> groups) { DBConnectionForInformix con = new DBConnectionForInformix(""); con.Open_Connection(); con.Begin_Transaction(); int affectedRow = -1; Dictionary<string, string> groupsParameter = new Dictionary<string, string>(); try { foreach (Group a in groups) {

Begin Viewing Query Results Before Query Ends

梦想与她 提交于 2019-12-02 02:36:38
Lets say I query a table with 500K rows. I would like to begin viewing any rows in the fetch buffer, which holds the result set, even though the query has not yet completed. I would like to scroll thru the fetch buffer. If I scroll too far ahead, I want to display a message like: "REACHED LAST ROW IN FETCH BUFFER.. QUERY HAS NOT YET COMPLETED". Could this be accomplished using fgets() to read the fetch buffer while the query continues building the result set? Doing this implies multi-threading* Can a feature like this, other than the FIRST ROWS hint directive, be provided in Oracle, Informix,

Informix: how to get an id of the last inserted record

情到浓时终转凉″ 提交于 2019-12-02 02:35:26
What's the most efficient way of getting the value of the SERIAL column after the INSERT statement? I.e. I am looking for a way to replicate @@IDENTITY or SCOPE_IDENTITY functionality of MS SQL The value of the last SERIAL insert is stored in the SQLCA record, as the second entry in the sqlerrd array. Brian's answer is correct for ESQL/C, but you haven't mentioned what language you're using. If you're writing a stored procedure, the value can be found thus: LET new_id = DBINFO('sqlca.sqlerrd1'); It can also be found in $sth->{ix_sqlerrd}[1] if using DBI There are variants for other languages

Error 360: Cannot modify table or view used in subquery

杀马特。学长 韩版系。学妹 提交于 2019-12-01 22:52:28
INFORMIX-SE 7.32: I'm getting error 360 when I try to execute the following statement: update transaction set transaction.colx = (select tab1.cola from tab1) where transaction.num = (select max(transaction.num) from transaction) and transaction.colx IS NULL; Any ideas? You're trying to UPDATE the table transaction and read from the same table using SELECT MAX with the same query. You cannot do that. Subquery restrictions In general, you cannot modify a table and select from the same table in a subquery. For example, this limitation applies to statements of the following forms: DELETE FROM t

Is there a direct way to convert Unix Time on Informix to YYYY-MM-DD HH:MM:SS?

让人想犯罪 __ 提交于 2019-12-01 21:01:13
I know something like this can be accomplished easily using PHP or Perl, but I want to know if there's a way to do it directly on Informix, something like the function FROM_UNIXTIME() on MySQL. I think you can do it using dbinfo with 'utc_to_datetime' as a parameter: http://publib.boulder.ibm.com/infocenter/idshelp/v115/index.jsp?topic=%2Fcom.ibm.sqls.doc%2Fids_sqs_1484.htm 来源: https://stackoverflow.com/questions/9213273/is-there-a-direct-way-to-convert-unix-time-on-informix-to-yyyy-mm-dd-hhmmss

如何正确设置 Informix GLS 及 CSDK 语言环境

醉酒当歌 提交于 2019-12-01 21:00:47
本文介绍 GLS 相关知识,说明如何正确设置 Informix GLS 语言环境相关变量(DB_LOCALE,CLIENT_LOCALE),保证 Informix 数据库服务器、客户端能正确的支持中文字符和支持使用中文的对象名。说明在 CSDK 2.7 以上版本(当前最新版本为 CSDK 3.5)中对语言环境设置的要求。以及举例说明语言环境设置常见错误及解决办法。 概述 IBM Informix 产品可以支持许多语言、文化和代码集。所有特定于文化的信息汇集于单个环境中,称为 Global Language Support (GLS)语言环境。除了 ASCII 美国英语之外,GLS 允许您在其他语言环境中工作并在 SQL 数据和标识中使用非 ASCII 字符。可以使用 GLS 功能来与特定语言环境定制保持一致。语言环境文件包括特定于文化的信息,如货币和日期格式以及整理顺序。 本文介绍 GLS 相关知识,说明如何正确设置 Informix GLS 语言环境相关变量(DB_LOCALE, CLIENT_LOCALE),保证 Informix 数据库服务器、客户端能正确的支持中文字符和支持使用中文的对象名。以及说明在 CSDK 2.7 以上版本(当前最新版本为 CSDK 3.5)中对语言环境设置的要求。 GLS 基本概念 字符(Character)是各种文字和符号的总称,包括各国家文字

jdbc 查询informix数据库中文乱码解决办法

陌路散爱 提交于 2019-12-01 21:00:31
问题: jdbc连接informix数据库查询中文出现乱码, informix数据库连接字符串为:jdbc:informix-sqli://10.0.26.30:8009/swcard:informixserver=nxauh;NEWCODESET=GBK,8859-1,8191,819 工程使用UTF-8编码; 解决: Stirng value = new String (resultSet.getString("T_NAME").getBytes("iso-8859-1")); 来源: oschina 链接: https://my.oschina.net/u/122067/blog/181306

How to open and read a file in Informix

安稳与你 提交于 2019-12-01 20:21:07
I need to write a stored procedure which reads input from a text file which contains employee records (multiple rows) and compares those values to that in the employee table and edits the row in the employee table if there are any modifications. I am using the DB Visualizer tool with connection type as Informix. As I am new to Informix, I don't know how to start. The scenario is: I have an Employee table which has fields emp_no, dept_no, fname, lname, crp_id, sal, hours etc. I have a text file in 'C:\sample.txt' with data 111 222 fname lname 3456 112 223 fname2 lname2 3457.. I need to read the

update Informix table with joins

三世轮回 提交于 2019-12-01 16:19:38
Is this the correct syntax for an Informix update? update table1 set table1.code = 100 from table1 a, table2 b, table3 c where a.key = c.key a.no = b.no a.key = c.key a.code = 10 b.tor = 'THE' a.group = 4183 a.no in ('1111','1331','1345') I get the generic -201 'A syntax error has occurred' message, but I can't see what's wrong. Esen your syntax error is table1.code set table1.code = 100 change this into set a.code = 100 Full code update table1 set a.code = 100 from table1 a, table2 b, table3 c where a.key = c.key and a.no = b.no and a.key = c.key and a.code = 10 and b.tor = 'THE' and a.group

update Informix table with joins

馋奶兔 提交于 2019-12-01 15:18:16
问题 Is this the correct syntax for an Informix update? update table1 set table1.code = 100 from table1 a, table2 b, table3 c where a.key = c.key a.no = b.no a.key = c.key a.code = 10 b.tor = 'THE' a.group = 4183 a.no in ('1111','1331','1345') I get the generic -201 'A syntax error has occurred' message, but I can't see what's wrong. 回答1: your syntax error is table1.code set table1.code = 100 change this into set a.code = 100 Full code update table1 set a.code = 100 from table1 a, table2 b, table3