This discussion is archived
1 Reply Latest reply: Feb 28, 2012 1:39 AM by 423410 RSS

Copy from varchar2 to into text

902884 Newbie
Currently Being Moderated
Hi

Whats the best way to copy the contents of varchar datatype into text datatype when mixing pro *c and OCI.
#define UNAME_LEN 30
varchar username[UNAME_LEN];

text            *uname ;
strncpy((char *) username.arr, argv[1], UNAME_LEN);
username.len = (unsigned short) strlen((char *) username.arr);


strncpy (uname, username.arr,30);
printf ("username is %s",uname);
I am unable to copy the contents using strncpy.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points