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

Home -> Community -> Usenet -> c.d.o.tools -> Re: pro*c problem - strcat

Re: pro*c problem - strcat

From: Izabela Sowula <izasow_at_yahoo.com>
Date: 20 Jul 2001 06:08:13 -0700
Message-ID: <61cb1b1e.0107200508.2b394c79@posting.google.com>

bhooshanprabhu_at_hotmail.com (Bhooshan) wrote in message news:<99f3c2af.0107200107.7da651eb_at_posting.google.com>...
> izasow_at_yahoo.com (Izabela Sowula) wrote in message news:<61cb1b1e.0107191747.16c50ffa_at_posting.google.com>...
> > Hi,
> >
> > I'm having a problem with finding a replacement for strcat or strncat
> > functions to use in my pro*c (dynamic method 4 with Pro*C/C++: Release
> > 8.1.7.2.0).
> >
> > The flow of actions in my application are to prompt user to ask a
> > question in English then to analyse it against the dictionary and then
> > to create an SQL query and retrieve data from the database all in the
> > runtime.My dictionary has to be in an array of structs:
> >
> > struct dicRecord
> > {
> >
> > string key;
> > string from;
> > string where;
> >
> > } copyofdictionary[100];
> >
> > So far I can do everything apart from concatenation of strings, which
> > then are going to make sql equerry.
> >
> > In my main I have defined:
> > char g_from[82] = {"FROM PLANT"};
> >
> > then I want to use an equivalent of strcat doing:
> > strcat(g_from,",");
> >
> > or
> >
> > strcat(g_from,copyofdictionary[result].from);
> >
> >
> > If I'm trying to use #define mystrcat(A,B) strcat((char*)A,B);
> > then I'm going into an infinitive loop with the message
> > ANSI Sqlstate 42000 Syntax error or access violation ORA 00942
> >
> > I will appreciate any help
> >
> > Thanks
> >
> > Izabela
> ________________________________________________________________________
> Can't understand this problem really. strcat is a c function and hence is
> available in Pro*c as well. Is it not?


Yes, but for some reason I'm having a problem getting it to work. It appears to me that my initialization of char g_from[82] = {"FROM PLANT"};
is treated by the pro*c compiler as if it char was VARCHAR, and I'm very confused over it since I don't know Oracle that well.

I could provide you with the sourcecode if that will help.

Izabela Received on Fri Jul 20 2001 - 08:08:13 CDT

Original text of this message

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