Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Pro*C host arrays

Re: Pro*C host arrays

From: Ed Prochak <edprochak_at_adelphia.net>
Date: Fri, 21 Mar 2003 20:20:58 GMT
Message-ID: <3E7B77F9.4030802@adelphia.net>


Brian Beld wrote:
> Hello,
>
> In Oracle Pro*C/C++ docs, chapter 4, I have :
>
> struct
> {
> char emp_name[3][10];
> int emp_number[3];
> int dept_number[3];
> } emp_rec;
> ..
> strcpy(emp_rec.emp_name[0], "ANQUETIL");
> strcpy(emp_rec.emp_name[1], "MERCKX");
> strcpy(emp_rec.emp_name[2], "HINAULT");
> emp_rec.emp_number[0] = 1964; emp_rec.dept_number[0] = 5;
> emp_rec.emp_number[1] = 1974; emp_rec.dept_number[1] = 5;
> emp_rec.emp_number[2] = 1985; emp_rec.dept_number[2] = 5;
>
> EXEC SQL INSERT INTO emp (ename, empno, deptno)
> VALUES (:emp_rec);
>
> But how to insert a date field ?
> (how to do "TO_DATE(...)" like in a classic "INSERT INTO ... VALUES" ?)
>
> Thanks in advance.

Did you read earlier chapters about declaring data types? Do you know how to insert a date value that is not part of a host array? (IOW try to walk before trying to run).

HTH

-- 
Ed Prochak
running: http://www.faqs.org/faqs/running-faq/
family:  http://web.magicinterface.com/~collins
--
"Two roads diverged in a wood and I
I took the one less travelled by
and that has made all the difference."
robert frost
Received on Fri Mar 21 2003 - 14:20:58 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US