home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.databases.oracle
- Path: sparky!uunet!spool.mu.edu!uwm.edu!linac!att!mcdchg!laidbak!newsserver.pixel.kodak.com!kodak!tempus!deal
- From: deal@tempus.Kodak.Com (Stephen M. Deal)
- Subject: ? How do I declare a structure into which to fetch records?
- Message-ID: <1992Dec30.054617.3077@kodak.kodak.com>
- Keywords: Pro*C, Declare Section, :structure
- Sender: deal@tempus (Stephen M. Deal)
- Reply-To: deal@Kodak.COM
- Organization: Eastman Kodak Company
- Distribution: na
- Date: Wed, 30 Dec 92 05:46:17 GMT
- Lines: 45
-
-
- I don't have my manuals with me (I'm at home) and I am trying to get
- some embedded SQL C code (a.k.a. Pro*C) to precompile. I am not sure
- that the manuals would answer this one anyway so I have turned to the
- net for help.
-
- I have declared a structure into which a record should be retrieved:
-
- EXEC SQL BEGIN DECLARE SECTION;
- struct emprec_ {
- char name[35];
- char dept_name[41];
- char phone[16];
- } query_results; /* Results of query placed here */
- EXEC SQL END DECLARE SECTION;
-
- but the precompiler errors on the fetch statement as follows:
-
- Precompiling proc_3.pc
- 215 EXEC SQL FETCH emp_csr INTO :query_results;
- 215 ....................................................^
- PCC-S-0026: Undeclared host variable "query_results" at line 215
- in file proc_3.pc
- *** Error code 1
-
- It is pretty clear what is wrong. But how do I fix it? I know that char
- datatypes are declared as VARCHAR, yet int are declared as int. Is there
- a keywork for declaring embedded SQL structures?
-
- Even a snippet of code that shows the proper syntax for the declaration
- would be helpful. I just need the precompiler to recognize that the
- structure has been declared.
-
- Thanks in advance,
- ======================================================================
- | Steve Deal | Internet: deal@Kodak.COM |
- | Eastman Kodak Co. | UUCP: ...rutgers!rit!kodak!tempus!deal |
- | Engr. Systems Div. | Voice: (716) 726 - 5396 |
- | mailcode: 35108 | FAX: (716) 726 - 7406 |
- | 901 Elmgrove Road | |
- | Rochester, NY | |
- | 14653-5108 | |
- ======================================================================
- Disclaimer: "Everyone is entitled to an opinion,
- the above is mine and not that of my employer."
-