Re: [Q] 1. shared object 4GE 2. CREATE VIEW + UNION
Posted in 1996
gis81566@cis.nctu.edu.tw (Lin FuXiong) wrote: :Hi, : I'm learning 4GL programming and have many questions. :I'll appreciate it if you can help me solve them. :I'm using : :------------ :INFORMIX-OnLine Dynamic Server Version 7.10UC1 :SunOS 5.4 generic sun4m sparc :INFORMIX-4GL Version AH6.00.UE3 :Question 1. Dynamic linked 4GL executables ? :----------- : To know how the 'c4gl' compile a 'program', I wrote a testing :'program'. :$cat t01.4gl :MAIN :END MAIN :$c4gl t01.4gl -o t01.4ge :$ls -l t01.4g? :-rwxr-xr-x 1 fxlin se 935464 Oct 4 18:54 t01.4ge :-rw-r--r-- 1 fxlin se 14 Oct 4 18:54 t01.4gl :It contains 935k+ bytes!!! I know 'strip', but it still contains :853k+ bytes after stripped. How can I reduce its size? You can use shared libraries if your platform supports that. It will not make the in memory image smaller, but you will save some diskspace. Otherwise you can't do much. This however is truly not a problem on modern computers. Both diskspace and memory is so cheap these days any costs related to this will be swamped by all other costs you have. Also remember if several users run the same program they will automatically share the code in memory. Most other 4GL's will expand more or less in the same way. You can of course use ESQL/C instead, but will the cost's be less when you considder the extra time you need? :Question 2. Create a view with "UNION" ? :----------- : Is it possible to create a view with the function like union? :We have many databases located in different informix database servers. :Some tables in different servers have identical columns. We want to :create a view which will "UNION" them. :For example: : CREATE VIEW v01 AS : SELECT * FROM d01@server1.t01 : UNION : SELECT * FROM d01@server2.t01 : UNION : SELECT * FROM d01@server3.t01 : ... :How can I do it ? :P.S. Please don't JOIN many tables in a single select ... You can't do it. No way. I think the problem is releated to the fact that a view shall be much like a table in use. When you do: select from v01 where somecolumn = somevalue the where part is combined with the view definition. In a simple view that can easily be done by the engine by simply concatenating the where part in your select with the where part in the view with an and between the two parts. In a view with union the where would have had to be added to every select statement in the union. There are some problems in doing that. Although it could be done, Informix simply haven't done it. Sorry. :Hope you can help me. Thanks in advance. Nils.Myklebust@idg.no NM Data AS, P.O.Box 9090 Gronland, N-0133 Oslo, Norway My opinions are those of my company The Informix FAQ is at http://www.iiug.org