informix

Can't create Informix stored procedure using ISQL command?

蓝咒 提交于 2019-12-18 09:08:59
问题 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)

Insert into temp values (select… order by id)

ぃ、小莉子 提交于 2019-12-18 06:57:47
问题 I'm using an Informix (Version 7.32) DB. On one operation I create a temp table with the ID of a regular table and a serial column (so I would have all the IDs from the regular table numbered continuously). But I want to insert the info from the regular table ordered by ID something like: CREATE TEMP TABLE tempTable (id serial, folio int ); INSERT INTO tempTable(id,folio) SELECT 0,folio FROM regularTable ORDER BY folio; But this creates a syntax error (because of the ORDER BY) Is there any

Attaching Informix .dat and .idx files

大憨熊 提交于 2019-12-14 02:26:25
问题 We are trying to duplicate one of our informix database on a test server, but without Informix expertise in house we can only guess what we need to do. I am learning this stuff on the fly myself and nowhere near the expertise level needed to operate Informix efficiently or even inefficiently. Anyhow... We managed to copy the .dat and .idx files from the live server somewhere. Installed Linux and the latest Informix Dynamic Server on it and have it up and running. Now what should we do with

how to obtain ranges of serial numbers in sql?

狂风中的少年 提交于 2019-12-14 00:40:30
问题 I have a table with a field called sector, each sector is usually something like 1,2,3,4,5,6,7,etc. I want to show available sectors in an application, I thought that showing all 1,2,3,4,5,6,7 is dumb so I should show "1 to 7" instead. The problem is that sometimes the sectors skip one number like this 1,2,3, 5,6,7. So I want to show something like 1 to 3, 5 to 7. how could I query this in sql to show in my app? 回答1: Some DBMS might have some OLAP functionality that makes it easy to write

RFX_BigInt error

二次信任 提交于 2019-12-13 18:04:26
问题 I have a field _int64 m_initial_amount; declared in the .h file and have a corresponding line RFX_BigInt(pFX, _T("[initial_amount]"), m_initial_amount); defined in the .cpp file I am getting an error C2065: 'RFX_BigInt' : undeclared identifier What is the error related to? Am I missing upon some header file, includes, libraries? Note: I am compiling the code in VC++ 6.0? 回答1: There is no RFX_xxxxx macro to transfer 64 bit integer - you have to get the raw data and convert it manually to a 64

How to open files stored as bytes in database with http handler?

烈酒焚心 提交于 2019-12-13 17:40:28
问题 I have my files stored as bytes in my database. How to open files like this with its application (like microsoft office, acrobat reader ,...etc) or download it. I want to do this with generic handler : public class Attachement : IHttpHandler, System.Web.SessionState.IRequiresSessionState { public void ProcessRequest(HttpContext context) { try { byte[] Attachement = (byte[])AttachementDAL.ReadAttachement(int.Parse(context.Session["attch_serial"].ToString())).Rows[0]["attach_content"]; } catch

Row_number() function for Informix

橙三吉。 提交于 2019-12-13 16:37:42
问题 Does informix has a function similar to the SQLServer and Oracle's row_number() ? I have to make a query using row_number() between two values, but I don't know how. This is my query in SQLServer: SELECT col1, col2 FROM (SELECT col1, col2, ROW_NUMBER() OVER (ORDER BY col1) AS ROWNUM FROM table) AS TB WHERE TB.ROWNUM BETWEEN value1 AND value2 Some help? 回答1: If, as it appears, you are seeking to get first rows 1-100, then rows 101-200, and so on, then you can use a more direct (but non

Convert Informix cursor to MSSQL Cursor

我的未来我决定 提交于 2019-12-13 16:23:49
问题 I have a cursor in Informix database which is part of a function, I would like to convert that into a cursor in MS-SQL. Below is the code: DECLARE select distinct agentname, agentloginid from selected_agents call; OPEN cur; FETCH cur INTO @l_AgentName, @l_AgentLoginID; WHILE @@FETCH_STATUS = 0 BEGIN getAgentLogActivity(@l_AgentName, @l_AgentLoginID, @p_startTime, @p_endTime); insert into final_result(Agent_Name, Agent_Login_ID, op1, Login_Time, op2, Logout_Time, Logout_Reason_Code, Logon

migrate the large data from xml file to the database

↘锁芯ラ 提交于 2019-12-13 15:29:47
问题 Q: I face the following problem two weeks ago , and i don't know how to handle it taking the performance issues , the data integrity in consideration. What I do is: I wanna to migrate the data from the XML file to its similar tables in my database . for example : i have two nodes (XML file): courses , teachers Two tables (database) courses , teachers . I allow the user to upload the XML file to a folder on my server and i begin to read the XML file and insert the data into my database . The

Temporary tables and connection pool

别来无恙 提交于 2019-12-13 02:49:58
问题 I use connection pooling provided by JBoss 7 and I do a connection.close() after every action. But when I create a temporary table, it does not remain for the current user because he is using a new session from the database (due to connection.close() and pooling). For example, I create a temp table in an action. The user changes page. The new action has to do queries in temp table but this does not exist anymore. So, I really don't know how to provide temporary tables with this kind of