informix

Analytical Query

对着背影说爱祢 提交于 2019-12-23 12:47:22
问题 Am looking for a single query that can convert the following information in the table name:time :state a :10:00 AM:login b :10:05 AM:login a :10:06 AM:chatting a :10:08 AM:Idle b :10:11 AM:chatting a :10:10 AM:Logout b :10:12 AM:Logout to something like this (given the time range 10 AM to 10:15 AM as the querying period) name: State :Duration a : chatting :2 Minutes a : Idle :2 Minutes b : chatting :1 Minute Can this be done ONLY using SQL? Am using Informix version 11.5 回答1: It can be done

Informix 7.3 - Declaring a date column data type with default as current date on insert/update

和自甴很熟 提交于 2019-12-23 03:12:16
问题 Looking for your help again Jonathan Leffler! I am creating a table on Informix 7.3 and need a timestamp field that will default to today on inserts and updates. How can I define a date/datetime/timestamp column for a table with a default value of the current time? Here is a field definition for a simple date field: column upd_date date comments "" desc "Last update date" heading "Last update date" text "Last update date" attributes ( ) There is also some other syntax in schema files that

Finding Informix DB Server

纵然是瞬间 提交于 2019-12-23 03:02:48
问题 I have a server and I know that there is an Informix installed on it, but I don't know who installed it. There is closed source client connecting to this server but I cannot get anything about it apart from username and password. I have no idea how to connect it, I don't know what would be the port number and server name of it. I have downloaded SQuirreL with JDBC Informix drivers. How can I connect to JDBC Informix server without knowing the port and server name? 回答1: In short, you will need

How can I conditionally construct a table name for an SQL CREATE TABLE statement?

喜欢而已 提交于 2019-12-20 05:11:32
问题 Within an SQL stored procedure, I would like to have the ability to construct a table name and create it. Example: I just logged into my database under company 03 and a customer table does not exist, so I would like for the proc to CREATE TABLE CUSTOMER03 . Is there a way to append company_id char(2) to CUSTOMER and feed it to the CREATE TABLE statement? maybe like CREATE TABLE $tablename or $tablename+company_id? 回答1: You would need to use dynamic SQL eg: DECLARE @company_id char(2) SET

Illegal attempt to use Text/Byte host variable - Inserting into TEXT column

最后都变了- 提交于 2019-12-20 03:54:07
问题 Trying to insert into a table (Text Column) via Dapper, and getting the error from Informix: Illegal attempt to use Text/Byte host variable I have written a small program to simulate this, and I am still up against problems. We cannot currently use the Informix drivers, as they do not suit our needs. using Dapper; using System; using System.Data.Odbc; namespace DapperParamsTest { class Program { static void Main(string[] args) { OdbcConnection conn = new System.Data.Odbc.OdbcConnection(

Hibernate Query problem with Informix

独自空忆成欢 提交于 2019-12-20 03:38:07
问题 I have written an application using Seam 2.2.1 & MySQL which is working. I am now trying to connect the application to Informix and when I execute a query from hibernate ( select user from User user ) I am getting the following exceptions: org.hibernate.exception.genericjdbcexception could not execute query when i execute a query as select user.id,user.name from User user it's executed successefuly. The Generated sql is select first 2 user0_.USER_ID as USER1_120_, user0_.dateOfBirth as

Problem with Informix JDBC, MONEY and decimal separator in string literals

余生长醉 提交于 2019-12-20 03:18:09
问题 I have problem with JDBC application that uses MONEY data type. When I insert into MONEY column: insert into _money_test (amt) values ('123.45') I got exception: Character to numeric conversion error The same SQL works from native Windows application using ODBC driver. I live in Poland and have Polish locale and in my country comma separates decimal part of number, so I tried: insert into _money_test (amt) values ('123,45') And it worked. I checked that in PreparedStatement I must use dot

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

孤者浪人 提交于 2019-12-20 01:42:17
问题 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. 回答1: 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

ODBC connection from 64-bit SQL Server to Informix data source

江枫思渺然 提交于 2019-12-19 04:04:22
问题 I am trying to create a linked table in a 64-bit SQL Server to Informix, and the SQL server does not list Informix ODBC in the DSN list. I have downloaded the 64-bit Informix Client SDK, however, despite the fact that it states 64-bit Informix Client SDK, it only appears in the 32-bit ODBC DSN. I tried to create a linked table in a 32-bit SQL Server and I was then able to see Informix ODBC DDN. I was just wondering that if there is an Informix Client SDK that would show in the 64-ODBC DSN,

Informix 7.3 isql insert statement - text/blob/clob field insert error

早过忘川 提交于 2019-12-18 09:26:58
问题 Is a way around this?? I am trying to insert some data into a table whose structure is: Column name Type Nulls crs_no char(12) no cat char(4) no pr_cat char(1) yes pr_sch char(1) yes abstr text yes The type of the last field reads 'text', but when trying to insert into this table, I get this error: insert into crsabstr_rec values ("COMS110","UG09","Y","Y","CHEESE"); 617: A blob data type must be supplied within this context. Error in line 1 Near character position 66 So this field is some