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 Question - printing varchar

Re: Pro*C Question - printing varchar

From: Bent Stigsen <ngcdo_at_thevoid.dk>
Date: Fri, 15 Oct 2004 07:00:07 +0200
Message-ID: <416f5943$0$247$edfadb0f@dread14.news.tele.dk>


Kareem Nutt wrote:
> I have the following:
>
> varchar name[21];
> .... select statement puts value into name ...
> .....
> name.arr[name.len] = '\0';
> printf ("name is %s.\n", name.arr);
>
> Example of what I get when I do this I get:
> "name is bob."
>
> What I want is to have all the extra spaces printed out as well:
> "name is bob."
>
> Anyone know how to do this?

You could declare the host variable as char instead of varchar or read up on printf's format string syntax.

btw. please dont multipost.
/Bent Received on Fri Oct 15 2004 - 00:00:07 CDT

Original text of this message

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