Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Wierd problem? Does C pad a host variable in embedded SQL with spaces?
Two questions:
1- how is laborcode defined in labtrans? If it is a char instead of varchar, Oracle will pad it
2- how are the linkage variables defined in the C program? If a varchar, are you setting the len component of the structure?
In article <6gc2s1$i2k$1_at_newsfep2.sprintmail.com>,
donny_at_who.com (Tony) wrote:
>
> I am using C on a Sun Unix Enterprise Server with embedded sql.
>
> A select statement is used as follows
>
> select laborcode, craft fro labor into :laborcode, craft when la2 =
> :empnum
>
> Then an
> insert into labtrans (laborcode, craft) values (:laborocode, :craft);
>
> :laborcode is defined as char laborcode[17] in the program;
>
> The laborcode field in the labor table is a variable (VAR_CHAR) field in
> Oracle of up to 16 characters.
>
> The problem is that the resulting laborcode in labtrans is always 16
> characters long. If the selected laborcode from labor is less (i.e. JEDRF)
> then it padds the field with spaces to equal 16 characters. Is this a
> function of the embedded sql in C? Or of Oracle
>
> Please respond to ramdan_at_mailexcite.com
>
-----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/ Now offering spam-free web-based newsreading Received on Wed Apr 08 1998 - 10:19:12 CDT
![]() |
![]() |