informix

Informix: Select null problem

一个人想着一个人 提交于 2019-11-30 09:19:13
问题 Using Informix, I've created a tempory table which I am trying to populate from a select statement. After this, I want to do an update, to populate more fields in the tempory table. So I'm doing something like; create temp table _results (group_ser int, item_ser int, restype char(4)); insert into _results (group_ser, item_ser) select group_ser, item_ser, null from sometable But you can't select null. For example; select first 1 current from systables works but select first 1 null from

Data migration between different DBMS's

让人想犯罪 __ 提交于 2019-11-30 05:53:33
As i couldnt get any satisfying answer to my Question it seems we have to write our own program for that, we are in the design phase and we are thinking which format shall we use to backup the data. The program will be written in Delphi. Needed is Exporting/Importing data between Oracle/Informix/Msserver, very important here is the Performance issue, as this program will run on a 1-2 GB Databases. Beside the normal data there are Blobs in the Database which have to be backuped. We thought of Xml-Data or comma-separated data as both are transparent (which is nice to have), but Blobs must be

Informix SQL - List all fields & tables

痴心易碎 提交于 2019-11-30 00:17:25
Informix iSQL has a command " info tables; " that shows all tables. The syntax for viewing the fields and their respective data types is " info columns for table; " Is there a similar command that shows table.field for all tables and all fields? Using the preferred JOIN notation: SELECT TRIM(t.tabname) || '.' || TRIM(c.colname) AS table_dot_column FROM "informix".systables AS t JOIN "informix".syscolumns AS c ON t.tabid = c.tabid WHERE t.tabtype = 'T' AND t.tabid >= 100 ORDER BY t.tabname, c.colno; or the old-fashioned join-in-where-clause notation: SELECT TRIM(t.tabname) || '.' || TRIM(c

Connecting to Informix using .NET

扶醉桌前 提交于 2019-11-29 22:11:13
问题 Server Information Sun Microsystems Inc. SunOS 5.8 Generic Patch October 2001 Server: Informix Dynamic Server Version 7.31.UD3 Information: Link: Connecting to Informix database from .Net Article: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0510durity/ I am running Visual Studio 2010 (C# 4.0). I don't care if it is ODBC vs OLE DB. I uninstalled all the client SDKs for Informix. I have readily available the IBM Informix CSDK 3.5 ready to be installed (the article uses 2.9 in

Can't create Informix stored procedure using ISQL command?

强颜欢笑 提交于 2019-11-29 16:12:11
I'm having trouble creating this stored procedure on IBM Informix Dynamic Server Version 10.00.FC9 (see Jonathan Leffler's answer to this post here ) using the 'isql' command from Informix SQL. I get an error on the ( char for each of his two examples near RETURNING CHAR(8) ex. 1: CREATE PROCEDURE ampm_time(tm SMALLINT) RETURNING CHAR(8); DEFINE hh SMALLINT; DEFINE mm SMALLINT; DEFINE am SMALLINT; DEFINE m3 CHAR(3); DEFINE a3 CHAR(3); LET hh = MOD(tm / 100 + 11, 12) + 1; LET mm = MOD(tm, 100) + 100; LET am = MOD(tm / 1200, 2); LET m3 = mm; IF am = 0 THEN LET a3 = ' am'; ELSE LET a3 = ' pm';

SQL - WHERE AGGREGATE>1

谁说胖子不能爱 提交于 2019-11-29 15:45:56
Imagine I have a db table of Customers containing {id,username,firstname,lastname} If I want to find how many instances there are of different firstnames I can do: select firstname,count(*) from Customers group by 2 order by 1; username | count(*) =================== bob | 1 jeff | 2 adam | 5 How do I write the same query to only return firstnames that occur more than once? i.e. in the above example only return the rows for jeff and adam. You want the having clause, like so: select firstname, count(*) from Customers group by firstname having count(*) > 1 order by 1 group by 2 order by 1 is

Informix: Select null problem

寵の児 提交于 2019-11-29 15:13:40
Using Informix, I've created a tempory table which I am trying to populate from a select statement. After this, I want to do an update, to populate more fields in the tempory table. So I'm doing something like; create temp table _results (group_ser int, item_ser int, restype char(4)); insert into _results (group_ser, item_ser) select group_ser, item_ser, null from sometable But you can't select null. For example; select first 1 current from systables works but select first 1 null from systables fails! (Don't get me started on why I can't just do a SQL Server like "select current" with no table

SQL - Converting 24-hour (“military”) time (2145) to “AM/PM time” (9:45 pm)

喜欢而已 提交于 2019-11-29 14:43:45
I have 2 fields I'm working with that are stored as smallint military structured times. Edit I'm running on IBM Informix Dynamic Server Version 10.00.FC9 beg_tm and end_tm Sample values beg_tm 545 end_tm 815 beg_tm 1245 end_tm 1330 Sample output beg_tm 5:45 am end_tm 8:15 am beg_tm 12:45 pm end_tm 1:30 pm I had this working in Perl, but I'm looking for a way to do it with SQL and case statements. Is this even possible? EDIT Essentially, this formatting has to be used in an ACE report. I couldn't find a way to format it within the output section using simple blocks of if(beg_tm>=1300) then beg

group_concat in Informix

ぐ巨炮叔叔 提交于 2019-11-29 08:20:52
Looking for a query in Informix's SQL that will simulate MySQL's group_concat function. What MySQL's group_concat does is it creates an enumeration of all members in the group. So with the data as follows: orderid:itemName:price 1:Paper :10 1:Pen :5 2:Sugar :15 and the following query: select group_concat(itemName), sum(price) from order_details group by orderid would produce: items :price Paper,Pen:15 Sugar :15 What would be most efficient way to achieve this in Informix? Would we definitely have to use a stored procedure? You would have to define a user-defined aggregate to do this. That has

Data migration between different DBMS's

给你一囗甜甜゛ 提交于 2019-11-29 04:10:38
问题 As i couldnt get any satisfying answer to my Question it seems we have to write our own program for that, we are in the design phase and we are thinking which format shall we use to backup the data. The program will be written in Delphi. Needed is Exporting/Importing data between Oracle/Informix/Msserver, very important here is the Performance issue, as this program will run on a 1-2 GB Databases. Beside the normal data there are Blobs in the Database which have to be backuped. We thought of