SQL END SQL postgresql

Iwan AB <[email protected]> Wed, 7 Jul 2021 09:56:00 +0700
Newsgroups gmane.comp.lang.4gl.aubit.general
Message-ID <CAHJCSmJJGByMvW0htSFbjVPSVijvn4wUNw52OL_fRHUNvjWgKw@mail.gmail.com>
Hi,

I try SQL END SQL block to check whether a table is defined with or without
oid in postgresql as follow

    SQL WITHOUT CONVERSIONS

        SELECT attname FROM pg_attribute
            WHERE attrelid = 't_test'::regclass
              AND attname = 'oid'

    END SQL

when compiled, it came up with the following error

    SQL WITHOUT CONVERSIONS

        SELECT attname FROM pg_attribute
            WHERE attrelid = 't_test'::regclass
|___________________________________________^
| Error at line 24, character 45
| ':' does not represent a defined variable (:)
              AND attname = 'oid'

    END SQL

why is that?

Regards,

Iwan

<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
Virus-free.
www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

_______________________________________________
Aubit4gl-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/aubit4gl-discuss