Home » Developer & Programmer » Precompilers, OCI & OCCI » strcpy((char *) uid.arr,argv[1]);
strcpy((char *) uid.arr,argv[1]); [message #162152] Thu, 09 March 2006 00:18 Go to next message
surbhigarg
Messages: 11
Registered: January 2006
Junior Member
hi
i m trainee and i m reading a pro*c code.
they have used "strcpy((char *) uid.arr,argv[1]);"
can any one tell-->
why do we use "strcpy((char *) uid.arr,argv[1]);"

why we use uid.arr instead cant we use directly "strcpy(uid,argv[1]);"

thanks
surbhi
Re: strcpy((char *) uid.arr,argv[1]); [message #169770 is a reply to message #162152] Fri, 28 April 2006 11:07 Go to previous message
denis.flotat
Messages: 13
Registered: September 2005
Junior Member
Because each VARCHAR2 field in oracle database is defined as a VARCHAR in PRO*C.

In fact it is a host structure that is defined by 2 fields :
- arr : string content (null terminated)
- len : specify length of string

when you want to insert a string you need to fill .arr structure then update .len (=strlen(xxx.arr)).

Regards.
Previous Topic: What is the fastest way of getting BLOB data into 9i?
Next Topic: Fetching Multiple Records from Table Type in Pro*C
Goto Forum:
  


Current Time: Thu Mar 28 14:48:55 CDT 2024