Re: C compiler limits
Posted in 1993
Topics: Stored Procedures & SPL, Connectivity: ESQL/C, 4GL & Embedded SQL
Note: I am posting this on behalf of Sivaguru Ramanathan since he has some problems sending mails from his system ; John Baker writes: >I wrote: > >} Since your Informix table is converted into a C structure, there is a limit >} to the number of columns you can have in a single table. It depends on the >} C compiler on your machine. Check your documentation for the limit to the >} number of members in a structure. > >Dave Cortesi replied: > >> This is not strictly true. As far as the database engine goes, there >> is no C structure describing a table. The table is fully described in >> the system catalog tables (systables, syscolumns). Hence there is no >> restriction on the CREATE TABLE (column-names...) statement. >> >> But if you are programming in 4GL, and you write >> >> DEFINE one_tab_row RECORD LIKE wide_table_name.* >> >> then there might indeed be -- in the C generated from that program -- a >> struct with a member for each column. I had never heard of a compiler >> with a limit on struct members, but I can well believe one exists. >> >> Could you clarify where/when this C struct is created for you? >> >Gee Dave, thanks for enlightening me! For two and a half years now, I've >assumed that Informix makes a structure out of CREATE TABLE statements. > >Why have I assumed this????? Because the "experts" on the Informix >Tech Support line told me so! Some experts, huh?! > ... >I just ran some test programs in 4GL. I specified a table named "test_tab" >with 147 columns and compiled it. It ran just fine. Next I coded a second >4GL program in which I wrote: > > MAIN > DEFINE tab_rec RECORD LIKE test_tab.* > DISPLAY " Program done." > END MAIN >This program did not get past the Phase 3 compile. The message "Parameter >stack overflow" was displayed from the C compiler. This is due to the >limit of our C compiler of 146 members in a structure..... ..... >John I would like to share some information that I figured out when I tried to convert an ACE report kicked off by a PERFORM screen to a standalone 4GL program calling a report. In this particular instance I was trying to print a report selecting data from a single table containing 413 columns!!! when I ran into compiler dependency problems. To get around the problem I set the compile time switches as shown below and was sucessful in compiling the entire program. unix_prompt> cc -c -W0,-Np2048 -W0,-Ns2048 filename.c Once I got the filename.o compiled then I used my makefile to link the program with appropriate informix libraries. Anyway can anybody explain what these compile time switches are. Thanks in advance Sivaguru Ramanathan -------------------------------------------------------------------------- Sivaguru Ramanathan Phone: (W):(314)-235-0954 Arbor Consulting Resources : (R):(314)-527-8517 7777, Bonhomme Ave, E-mail: sr5484@txnds1.sbc.com Clayton, MO 63105. -------------------------------------------------------------------------- -- Bye ================================================================================ Raghu B.A. St.Louis,MO 314-832-4136, 235-4197/W cpg2907@swuts.sbc.com ////////// 24-K-1,OBC