home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!ukma!darwin.sura.net!europa.asd.contel.com!emory!emory!not-for-mail
- From: randy@turq.b8.ingr.com (Randy Paries)
- Newsgroups: comp.databases.informix
- Subject: Help with structs and .ec
- Date: 5 Nov 1992 15:03:08 -0500
- Organization: Mailing List Gateway
- Lines: 66
- Sender: walt@mathcs.emory.edu
- Distribution: world
- Message-ID: <1dbulsINNqte@emory.mathcs.emory.edu>
- Reply-To: randy@turq.b8.ingr.com (Randy Paries)
- NNTP-Posting-Host: emory.mathcs.emory.edu
- X-Informix-List-ID: <list.1574>
-
- Hi,
-
- I having problems fetching into a structure when using a prepare.
- I will explain.
-
- /*------------------------------------------------------------*/
- $struct open{
- int var1;
- int var2;
- char var3;
- };
- $struct open open_rec;
-
- main()
- {
- $declare X cursor for
- select * from table where table.var1 = 2;
- $open;
- $fetch X into $open_rec;
- }
- /*------------------------------------------------------------*/
- This above example works ok. The following example fails on the
- compile with the following error:
- line 13: RECORD objects 'open_rec' are not allowed in this list
- /*------------------------------------------------------------*/
- $struct open{
- int var1;
- int var2;
- char var3;
- };
- $struct open open_rec;
-
- main()
- {
- char qvar[200];
-
- strcpy(qvar,"select * from table where table.var1 = 2");
-
- $prepare Y from $qvar;
- $declare X cursor for Y;
- $open;
- $fetch X into $open_rec;
- }
- /*------------------------------------------------------------*/
-
- if I replace $fetch X into $open_rec; with
- $fetch X into $open_rec.var1,$open_rec.var2,$open_rec.var2
- it works ok.
-
- The problem is the tables that I need to fetch in real life have
- LOTS of columns.
-
-
-
- Thanks for any help..
- --
- ------------------------------------------------------------------------
- |--------------| # -------------------------------|
- | Randy Paries | ____/| _______| b8!turq!randy |
- | x6191 cr041| \ oO| / | uunet!ingr!b8!turq!randy |
- |--------------| ## | ~|_/ ## | randy@turq.b8.ingr.com |
- #### `-U' #### |Intergraph, Huntsville Alabama|
- \\ || // ================================
- TEAM "CATS" \/ \/ ples exuse al speln mstaks
- "Smells like team spirit" | |
- ------------------------------------------------------------------------
-