informix

Rollback informix database

孤者浪人 提交于 2019-12-24 11:13:16
问题 I have some code that uses an Informix 11.5 database that I want to run some tests against. If the tests fail they will often leave the database in an inconsistent state that needs to be manually resolved before the tests can be run again. I would like to automate this so that the tests do not require manual intervention before running the tests again. My current solution is to write some code that does the cleanup, but this means the code must be maintained whenever potential new

substring operation on blob text in informix

走远了吗. 提交于 2019-12-24 10:58:25
问题 How can I substring a text of BLOB datatype in informix? If the operation is possible only on text of char datatype, is it possible to convert from BLOB to char (like to_char in oracle)? Thanks in advance, 回答1: You can use substring operator: http://publib.boulder.ibm.com/infocenter/idshelp/v111/index.jsp?topic=/com.ibm.sqls.doc/sqls1069.htm Code looks like: select txt, txt[3,5] from _text_test (txt is of BLOB type, but I also tested using TEXT type). WARNING! In my tests such select gives

Linked Informix table in MS SQL Server ignoring criteria?

余生颓废 提交于 2019-12-24 10:57:36
问题 I’m having a problem with a linked Informix table in MS SQL Server 2008r2. When I query this table, it seems to ignore some of the criteria I’m passing to it but not others. For example if I put a condition on the rowdate field the remote query part of the execution plan does not show any WHERE clause but if I put criteria on another field such as ACD it does show. It seems it does not pass any criteria on the rowdate field but does on all others. I know the field is indexed on the Informix

How to get the size of a informix table?

和自甴很熟 提交于 2019-12-24 10:21:37
问题 I need to find out how much disk space occupied by a given table. How to see it? Suppose i have a table called tb1. Suppose it is currently using 1000 2kb pages. Then table size should be given as 2000kb. 回答1: To add to Jonathan's comment if the table does not store data in blob spaces or smart blob spaces then the oncheck -pt command will give the required information. Look at the "Pagesize" and "Number of pages allocated" information for each fragment. You can also get this information in

Informix: procedure with output parameters?

独自空忆成欢 提交于 2019-12-24 10:16:09
问题 I searched a lot, but couldn't find anything.. I just want to ask if there's any way to create and call a procedure ( Informix ) with out parameters. I know how to return one or more values (for procedures and for functions), but this is not what I want. It would be really strange, if Informix does not allow output parameters.. Thanks in advance! EDIT : Yes, I saw it's possible, but I still can't execute such procedure. For example: CREATE PROCEDURE mytest(batch INT,OUT p_out INT) DEFINE inc

JPA Transactions on Informix

五迷三道 提交于 2019-12-24 09:26:58
问题 I need to make an update on a table using JPA 2.0 with EclipseLink 3.0 on a Java SE 7.0 environment, using Non-Transactional Informix DB v. 11.50, the persistence.xml is: <persistence-unit name="pp_pu" transaction-type="RESOURCE_LOCAL"> <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider> <class>...</class> <class>...</class> <properties> <property name="javax.persistence.jdbc.url" value="jdbc:informix-sqli://10.191.78.230:40494/ptpr:informixserver=online_ptpr"/> <property

Cast Date in Informix

跟風遠走 提交于 2019-12-24 08:58:52
问题 I have never used Informix before and I'm trying to write a query that will return records over the last 365 days. Here is the query I have been trying to use: Select * from Visit where vis_mod_dt between today-365 and today; That returns no records even though I know that there is data for the last 365 days. I am guessing that the vis_mod_dt in not a true date column, although it displays as '12/31/1899' I have tried to cast this column using: select * from visit where date(vis_mod_dt)

SELECT only a certain set of rows at a time

不羁岁月 提交于 2019-12-24 04:17:15
问题 I need to select data from one table and insert it into another table. Currently the SQL looks something like this: INSERT INTO A (x, y, z) SELECT x, y, z FROM B b WHERE ... However, the SELECT is huge, resulting in over 2 millions rows and we think it is taking up too much memory. Informix, the db in this case, runs out of virtual memory when the query is run. How would I go about selecting and inserting a set of rows (say 2000)? Given that I don't think there are any row ids etc. 回答1: You

Using subquery in an update always requires subquery in a where clause?

半世苍凉 提交于 2019-12-23 15:16:08
问题 This is a common SQL query for me: update table1 set col1 = (select col1 from table2 where table1.ID = table2.ID) where exists (select 1 from table2 where table1.ID = table2.ID) Is there any way to avoid having two nearly identical subqueries? This query is an obvious simplification but performance suffers and query is needlessly messy to read. 回答1: Unfortunately Informix don't support the FROM clause at UPDATE statement. The way to workaround and you will get better results (performance) is

In SQL, How can I generate every possible unique combination of 5!56?

删除回忆录丶 提交于 2019-12-23 13:34:11
问题 I have a TABLE "elements" with one COLUMN "number", type SMALLINT that contains numbers 1 thru 56. How can I generate unique sets of 5 numbers of every possible combination from 1 to 56, using an SQL statement? In APL (programming language) a simple dyadic function 5!56 does the trick! EDIT: In good ole MS-DOS QBASIC, I accomplished it like this: 10 OPEN "C:\5NUMBERS.OUT" FOR OUTPUT ACCESS READ WRITE AS #1 12 LET SER = 0 15 LET E = 56 30 FOR B5 = 5 TO E 40 FOR B4 = 4 TO E 50 FOR B3 = 3 TO E