informix

Explanation about a code fragment

I see the following code fragment in a legacy application that accesses Informix through C. Can anyone explain what the SQL in the code is trying to achieve? Thanks. EXEC SQL BEGIN DECLARE SECTION; int i_tableref; EXEC SQL END DECLARE SECTION; /* Some code here */ if (!i_sel_ref) { exec sql begin declare section; const char *sql...

Cast Date in Informix

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 ...

I'm getting "Invalid month in date" trying to run this?

I'm trying to run the following db command against Informix: delete from table1 where u_id in (select u_id from table2 where c_id in (select c_id from ptable where name = 'Smith' and...

Handling huge numbers C, Java, Informix

Hi all, We are in a situation to handle numbers with a maximum of 15 digits. We need to parse this value from a text file, through C, store it in Informix table. There is another Java component that reads these values, does mathematical operations and computes a result. I have been doing some research on this and found that the int8 da...

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

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...

Adding reference to correct version of IBM.Data.Informix library

When I go to reference the Informix client libraries for .NET in Visual Studio (Website->Add Reference) they show up as IBM.Data.Informix (version: 2.81.0.0; Runtime: v1.1.4322; Path: C:...\Client-SDK\bin\netf11\IBM.Data.Informix.dll) This actually works, but after running into some trouble loading my application on the production serve...

Does Informix have scheduled triggers?

I need an Informix database to update some records on December 31 at 11:59; can Informix do this on a trigger, or does it have a scheduler of some sorts? I'm an Informix noob btw. I'm using informix 11.1 for hp-ux ...

Can't create Informix stored procedure using ISQL command?

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(...

Informix Dynamic Server 2000: How do I enable ODBC?

I have an old server (Solaris 8) running Informix Dynamic Server 2000 Version 9.21.UC4, and I want to get ODBC enabled so that I can get to the data from elsewhere, but I haven't been able to find documentation online about how to do this on the server. I am able to use dbaccess on the server to get to the data just fine, but when I loo...

Informix ODBC Connection Help

I have a development project that requires us to be able to support informix data sources via ODBC. I've downloaded the prebuilt Informix Virtual Appliance from the IBM website and am able see the server with the built in tools, but haven't been able to get at it from an ODBC connection on the client! I have the ODBC support package ins...

E/R diagrammer for Informix?

Correct me if I'm wrong, but Server studio doesn't have relationship connectors. Is there a good informix E/R diagrammer out there that generates the code automaticaly? free would be nice... UPDATE: Im wrong, it does have relationship connectors, it's just that you must define the foregin key and then execute, I didn't execute I thoug...

Informix: Fifo valuation with SQL/Stored procedures

I am using IDS 10 and I have a simple transaction table with the inventory changes with product ID, transaction time, volume, quantity and price. Is it possible to determine the FIFO valuation solely with SQL/Stored procedures or do I need to use something like Perl with DBI for the cursor handling? Fifo valuation requires cursor-handlin...

Informix SQL text Blob wildcard search

I am looking for an efficient way to use a wild card search on a text (blob) column. I have seen that it is internally stored as bytes... The data amount will be limited, but unfortunately my vendor has decided to use this stupid datatype. I would also consider to move everything in a temp table if there is an easy system side function t...

Tools for Informix

Are there any tools available for Informix, similar to 'Query Analyzer' for SQL Server? ...

SQL query to get the "latest" value for each location

Hi What I thought would be a simple thing to solve has now bugged for quite some time. Now I need help from you guys. In Informix I have a table "temperatures" like this: locId dtg temp 100 2009-02-25 10:00 15 200 2009-02-25 10:00 20 300 2009-02-25 10:00 24 100 2009-02-25 09:45 13 300 200...

update data from one table to another (in a database)

DB gurus, I am hoping someone can set set me on the right direction. I have two tables. Table A and Table B. When the system comes up, all entries from Table A are massaged and copied over to Table B (according to Table B's schema). Table A can have tens of thousands of rows. While the system is up, Table B is kept in sync with Table ...

Remote Informix 11.5 Command Line Client

Does a command line tool ship with Informix 11.5 similar to SQLCMD for SQL Server? If yes, how do I connect to a remote server and perform regular SELECT/INSERT/UPDATE queries using it? ...

Informix: What happens when you delete a row with serial/serial8 primary key?

I had a quick question on serial data types used on primary key on informix db's. If I delete a row, will the serial key carry on counting or will it re-adjust for any rows that were deleted? So if current row is serial no 5, I delete number row withs serial no 3, will the next value be 6 and keep carrying on? Is serial no 3 that is no...

update via subquery, what if the subquery returns no rows?

I am using a subquery in an UPDATE: UPDATE tableA SET x,y,z = ( (SELECT x, y, z FROM tableB b WHERE tableA.id = b.id AND (tableA.x != b.x OR tableA.y != b.y OR tableA.z != b.z))) ); My question is, what happens if the subquery returns no rows?...

Informix with NHibernate

Hi All, I am trying to get Informix working with NHibernate on windows 7. I have a connection string that works fine with informix now, it is this, Database=db;Server=server:port;uid=username;password=password;pooling=false I am using the IBM.Data.Informix .NET provider version 9.0.0.2. We have a number of different applications that...