Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Migration problems

Re: Migration problems

From: Kevin Brand <kevin.brandx_at_tel.gte.com>
Date: Tue, 19 Mar 2002 14:00:43 -0600
Message-ID: <a785e7$qje$1@news.gte.com>


Pierre,

Sounds to me like you need to use varchar type rather than char type in the C source code. If your host variables are defined as 'char' type, they will be padded with spaces when short(er) values are selected into them. So for instance:

...
char mystring[30]
...
EXEC SQL SELECT table_name INTO :mystring

    FROM USER_TABLES
    WHERE table_name = 'EMP'
;

printf(" '%s'\n", mystring );

will output a padded string like so...

'EMP                          '

... which is, I think, not what you want. Either write a function to trim off white space or use varchar type instead of char type.

Hth,

-Kevin

"Pierre" <gitsp_at_swing.be> wrote in message news:ff0974a4.0203190244.57513cfb_at_posting.google.com...
> Hi *,
>
> We currently migrate a customer application written in Uniface 5.2 /
> database Oracle 6 and under Unix 8 to Uniface 7.2.06 / database Oracle
> 8.1.7 HP/Unix 11.
>
> A great part of the application was written in Pro*C.
>
> After very much problems with the 'make', we finally find our way to a
> running application but we still have a big problem with all the
> Pro*C!
>
> Every string function seems to be working a different way then on the
> initial application.
> Most of the time, it's a problem with the '/0' end of string, in other
> cases the data's find by a SQL statement have a lenght problem for
> further use,and so on.
>
> We already use different switches for compilation('-Ac') but the
> strings problem is still there.
>
> One possibility we have is to change all the code to insert some
> string function but ... it's a lot of work.
>
> The question is, does anyone know with switch we could use to avoid
> the problem.
>
> Thanks in advance.
> Regards,
>
> Pierre.
Received on Tue Mar 19 2002 - 14:00:43 CST

Original text of this message

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