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 -> Wierd problem? Does C pad a host variable in embedded SQL with spaces?

Wierd problem? Does C pad a host variable in embedded SQL with spaces?

From: Tony <donny_at_who.com>
Date: 1998/04/07
Message-ID: <6gc2s1$i2k$1@newsfep2.sprintmail.com>#1/1

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 Received on Tue Apr 07 1998 - 00:00:00 CDT

Original text of this message

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