Structures in Pro*C

From: Stephen M. Deal <deal_at_tempus.Kodak.Com>
Date: Tue, 17 Aug 93 01:24:46 GMT
Message-ID: <1993Aug17.012446.23078_at_kodak.rdcs.kodak.com>


I tried to fetch into a structure as follows. Is this supported?

	EXEC SQL BEGIN DECLARE SECTION;
	struct empRec
	{  char fname[10];
	   char lname[25];
	}
	struct empRec cur_rec;
	EXEC SQL END DECLARE SECTION;

	EXEC SQL DECLARE emp_csr CURSOR FOR ...

	EXEC SQL FETCH emp_csr INTO :cur_rec;

I have done this ^^ with a competing product by declaring the structure and then fetching directly into the structure without explicitly stating each field. It doesn't seem to work with Pro*C.

So then I tried this:

	EXEC SQL BEGIN DECLARE SECTION;
	struct emprec
	{  char fname[10];
	   char lname[25];
	}
	struct emprec cur_rec;
	EXEC SQL END DECLARE SECTION;

	EXEC SQL DECLARE emp_csr CURSOR FOR ...

	EXEC SQL FETCH emp_csr INTO 
		:cur_rec.fname,
		:cur_rec.lname;


and it still complains as follows:

PCC-S-0026: Undeclared host variable "cur_rec.fname" at line 267 in file ekDir_proc_5.pc

267                 :cur_rec.lname;
267 ..............................^

PCC-S-0026: Undeclared host variable "cur_rec.lname" at line 267 in file ekDir_proc_5.pc
267                 :cur_rec.lname;
267 ..............................^

Am I chasing down the wrong path? Am I missing something obvious?

Any hints would be gratefully accepted.

  +====================================================================+

| Steve Deal | Internet: deal_at_Kodak.COM |
| Eastman Kodak Co. | UUCP: ...rutgers!rit!kodak!tempus!deal |
| Engr. Systems Div. | Voice: (716) 722 - 2850 |
| mailcode: 03059 | FAX: (716) 588 - 2721 |
| 2400 Mt. Read. Blvd.| |
| Rochester, NY | |
| 14650-3059 | |
+====================================================================+ Disclaimer: "Everyone is entitled to an opinion, the above is mine and not that of my employer."
Received on Tue Aug 17 1993 - 03:24:46 CEST

Original text of this message