Home » SQL & PL/SQL » SQL & PL/SQL » quick question
quick question [message #35635] Tue, 02 October 2001 13:12 Go to next message
sheik
Messages: 1
Registered: October 2001
Junior Member
Hi
How to copy a varchar vairable to a string (char *)
Thanks

----------------------------------------------------------------------
Re: quick question [message #35639 is a reply to message #35635] Wed, 03 October 2001 04:46 Go to previous messageGo to next message
ratna
Messages: 7
Registered: October 2001
Junior Member
I guess writing a macro like
#define VARCHAR2_TO_CHAR(d, s) memcpy((char *) d, (char *) (s).arr, (s).len);
d [[ (s).len ]] = NULL;

might help you. S is varchar2 and d is char* variable you will use.
You can use this macro at any C part of your program later.


----------------------------------------------------------------------
Re: quick question [message #35662 is a reply to message #35635] Thu, 04 October 2001 07:49 Go to previous message
bharat
Messages: 11
Registered: February 2000
Junior Member
use the strcpy function ,e.g.,
char *x;
strcpy(x,address.arr);

----------------------------------------------------------------------
Previous Topic: Re: Day of week
Next Topic: need an answer from experts
Goto Forum:
  


Current Time: Sat May 25 15:19:47 CDT 2024