Re: PG8: set search_path at compile time?

Mike Aubury <[email protected]>
Newsgroups gmane.comp.lang.4gl.aubit.general
Message-ID <CAGAq4WHMdAu6ji=izRczWHnRhu21qySzf7eeyGZW4jYusrSPWw@mail.gmail.com>
I'll apply the patch - but the convert file should still be used for the
A4GL_LEXTYPE=C driver too....



On 11 November 2013 10:27, wh <[email protected]> wrote:

> Hello,
>
> Ok. I switched from LEXTYPE C to EC, now the convert file is used. But
> here came the next problem: My search_path is rather long, but aubit
> cuts after 200 chars. I fixed it with the follwoing patch:
>
>
>
> wh@aubit-test:~/aubit-build/aubit4glsrc-cvs$ diff -u
> lib/libaubit4gl/sqlconvert.c.orig lib/libaubit4gl/sqlconvert.c
> --- lib/libaubit4gl/sqlconvert.c.orig   2013-11-11 11:02:35.392228982
> +0100
> +++ lib/libaubit4gl/sqlconvert.c        2013-11-11 11:06:15.475947974
> +0100
> @@ -507,7 +507,7 @@
>   static void
>   read_conversion_file (FILE * fh, char *name)
>   {
> -  char buff[201];
> +  char buff[501];
>     char *t;
>     int len;
>     int line = 0;
> @@ -520,7 +520,7 @@
>     /* each line of the file consists of a function name and
>      * optional arguments.  Ignore lines starting with "#".
>      */
> -  while (fgets (buff, 200, fh))
> +  while (fgets (buff, 500, fh))
>       {
>         line++;
>         if ((t = A4GL_cv_next_token (buff, &len, 0)) == NULL)
>
>
>
>
>
> > I think a neater way of doing this is to use the "DEFAULT_SQL" - which
> > is run whenever a database connection is made.
> >
> > In the etc/convertsql/INFORMIX-POSTGRES8.cnv file - set something like
> > :
> >
> > DEFAULT_SQL 2 = set search_path TO ....
> >
> > That way - you dont need to hack the .c files...
> >
> > (You should be able to create a file anywhere called
> > INFORMIX-POSTGRES8.cnv and point to it using
> > A4GL_SQLCNVPATH if you're worried about it getting overwritten)
> >
> > On 9 November 2013 21:59, W. Haslbeck <[email protected]> wrote:
> >
> >> Hello,
> >>
> >> is there a way to set the PostgreSQL search_path (driver pg8) at
> >> compile
> >> time?
> >> Instructions like CONSTRUCT BY NAME doesn't accept the
> >> "schema.table.column" schema (in contrast to e.g. DEFINE where you
> >> can
> >> say "define var like schema.table.column"), so when the needed
> >> schema is
> >> not in the search_path at compile time, you get an compliation
> >> error.
> >>
> >> At the moment I use a bit modified version of pg8.c, which sets the
> >> search_path at the end of
> >> A4GLSQLLIB_A4GLSQL_init_connection_internal,
> >> but I'm not very pleased with this option...
> >>
> >> Walter
> >>
> >>
> >
> ------------------------------------------------------------------------------
> >> November Webinars for C, C++, Fortran Developers
> >> Accelerate application performance with scalable programming
> >> models. Explore
> >> techniques for threading, error checking, porting, and tuning. Get
> >> the most
> >> from the latest Intel processors and coprocessors. See abstracts
> >> and register
> >>
> >
> http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
> >> [1]
> >> _______________________________________________
> >> Aubit4gl-discuss mailing list
> >> [email protected]
> >> https://lists.sourceforge.net/lists/listinfo/aubit4gl-discuss [2]
> >
> >
> >
> > Links:
> > ------
> > [1]
> >
> http://pubads.g.doubleclick.net/gampad/clk?id=60136231&amp;iu=/4140/ostg.clktrk
> > [2] https://lists.sourceforge.net/lists/listinfo/aubit4gl-discuss
> >
> >
> ------------------------------------------------------------------------------
> > November Webinars for C, C++, Fortran Developers
> > Accelerate application performance with scalable programming models.
> > Explore
> > techniques for threading, error checking, porting, and tuning. Get the
> > most
> > from the latest Intel processors and coprocessors. See abstracts and
> > register
> >
> http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
> >
> > _______________________________________________
> > Aubit4gl-discuss mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/aubit4gl-discuss
>
>
> ------------------------------------------------------------------------------
> November Webinars for C, C++, Fortran Developers
> Accelerate application performance with scalable programming models.
> Explore
> techniques for threading, error checking, porting, and tuning. Get the most
> from the latest Intel processors and coprocessors. See abstracts and
> register
> http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
> _______________________________________________
> Aubit4gl-discuss mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/aubit4gl-discuss
>

------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most 
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk

_______________________________________________
Aubit4gl-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/aubit4gl-discuss
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.