From: Michael Meskes <meskes@usa.net>
docs improvement for ecpg..
This commit is contained in:
parent
bf395e895b
commit
06b8c8a8b8
@ -45,15 +45,12 @@ queries. It takes care of all the tedious moving of information to and
|
|||||||
from variables in your <Acronym>C</Acronym> program. Many <Acronym>RDBMS</Acronym> packages
|
from variables in your <Acronym>C</Acronym> program. Many <Acronym>RDBMS</Acronym> packages
|
||||||
support this embedded language.
|
support this embedded language.
|
||||||
|
|
||||||
<Para>
|
<Para> There is an ANSI-standard describing how the embedded language should
|
||||||
There is an ANSI-standard describing how the embedded language should
|
work. <Application>ecpg</Application> was designed to meet this standard as much as possible. So it is
|
||||||
work. Most embedded <Acronym>SQL</Acronym> preprocessors I have seen and heard of make
|
possible to port programs with embedded <Acronym>SQL</Acronym> written for
|
||||||
extensions so it is difficult to obtain portability between them
|
other <Acronym>RDBMS</Acronym> packages to
|
||||||
anyway. I have not read the standard but I hope that my implementation
|
<ProductName>Postgres</ProductName> and thus promoting the spirit of free
|
||||||
does not deviate too much and that it would be possible to port programs
|
software.
|
||||||
with embedded <Acronym>SQL</Acronym> written for other <Acronym>RDBMS</Acronym> packages
|
|
||||||
to <ProductName>Postgres</ProductName> and thus
|
|
||||||
promoting the spirit of free software.
|
|
||||||
|
|
||||||
<Sect1>
|
<Sect1>
|
||||||
<Title>The Concept</Title>
|
<Title>The Concept</Title>
|
||||||
@ -431,25 +428,6 @@ you are not interested in how it really works, skip this section.
|
|||||||
This version the preprocessor has some flaws:
|
This version the preprocessor has some flaws:
|
||||||
|
|
||||||
<VariableList>
|
<VariableList>
|
||||||
<VarListEntry>
|
|
||||||
<Term>Preprocessor output</Term>
|
|
||||||
<ListItem>
|
|
||||||
<Para>
|
|
||||||
The variables should be static.
|
|
||||||
</Para>
|
|
||||||
</ListItem>
|
|
||||||
</VarListEntry>
|
|
||||||
|
|
||||||
<VarListEntry>
|
|
||||||
<Term>Preprocessor cannot do syntax checking on your <Acronym>SQL</Acronym> statements</Term>
|
|
||||||
<ListItem>
|
|
||||||
<Para>
|
|
||||||
Whatever you write is copied more or less exactly to the <ProductName>Postgres</ProductName> and
|
|
||||||
you will not be able to locate your errors until run-time.
|
|
||||||
</Para>
|
|
||||||
</ListItem>
|
|
||||||
</VarListEntry>
|
|
||||||
|
|
||||||
<VarListEntry>
|
<VarListEntry>
|
||||||
<Term>no restriction to strings only</Term>
|
<Term>no restriction to strings only</Term>
|
||||||
<ListItem>
|
<ListItem>
|
||||||
@ -485,51 +463,59 @@ to_date et al.
|
|||||||
<Term>records</Term>
|
<Term>records</Term>
|
||||||
<ListItem>
|
<ListItem>
|
||||||
<Para>
|
<Para>
|
||||||
Possibility to define records or structures in the declare section
|
Records or structures have to be defined in the declare section.
|
||||||
in a way that the record can be filled from one row in the database.
|
|
||||||
|
|
||||||
|
</ListItem>
|
||||||
|
</VarListEntry>
|
||||||
|
|
||||||
|
<VarListEntry>
|
||||||
|
<Term>missing statements</Term>
|
||||||
|
<ListItem>
|
||||||
<Para>
|
<Para>
|
||||||
This is a simpler way to handle an entire row at a time.
|
The following statements are not implemented thus far:
|
||||||
|
<VariableList>
|
||||||
|
<VarListEntry>
|
||||||
|
<Term> exec sql type</Term>
|
||||||
|
</VarListEntry>
|
||||||
|
<VarListEntry>
|
||||||
|
<Term> exec sql prepare</Term>
|
||||||
|
</VarListEntry>
|
||||||
|
<VarListEntry>
|
||||||
|
<Term> exec sql allocate</Term>
|
||||||
|
</VarListEntry>
|
||||||
|
<VarListEntry>
|
||||||
|
<Term> exec sql free</Term>
|
||||||
|
</VarListEntry>
|
||||||
|
<VarListEntry>
|
||||||
|
<Term> exec sql whenever sqlwarning</Term>
|
||||||
|
</VarListEntry>
|
||||||
|
<VarListEntry>
|
||||||
|
<Term> SQLSTATE</Term>
|
||||||
|
</VarListEntry>
|
||||||
|
</VariableList>
|
||||||
</Para>
|
</Para>
|
||||||
</ListItem>
|
</ListItem>
|
||||||
</VarListEntry>
|
</VarListEntry>
|
||||||
|
|
||||||
<VarListEntry>
|
<VarListEntry>
|
||||||
<Term>array operations</Term>
|
<Term>message ´no data found´</Term>
|
||||||
<ListItem>
|
<ListItem>
|
||||||
<Para>
|
<Para>
|
||||||
Oracle has array operations that enhances speed. When implementing it in
|
The error message for "no data" in an exec sql insert select from statement
|
||||||
<Application>ecpg</Application> it is done for compatibility reasons only. For them to
|
has to be 100.
|
||||||
improve speed would require a lot more insight in the <ProductName>Postgres</ProductName> internal
|
|
||||||
mechanisms than I possess.
|
|
||||||
</Para>
|
</Para>
|
||||||
</ListItem>
|
</ListItem>
|
||||||
</VarListEntry>
|
</VarListEntry>
|
||||||
|
|
||||||
<VarListEntry>
|
<VarListEntry>
|
||||||
<Term>indicator variables</Term>
|
<Term>sqlwanr[6]</Term>
|
||||||
<ListItem>
|
<ListItem>
|
||||||
<Para>
|
<Para>
|
||||||
Oracle has indicator variables that tell if a value is <Type>null</Type> or if
|
sqlwarn[6] should be 'W' if the PRECISION or SCALE value specified in a SET
|
||||||
it is empty. This largely simplifies array operations and provides for a
|
DESCRIPTOR statement will be ignored.
|
||||||
way to hack around some design flaws in the handling of <Type>VARCHAR2</Type>
|
|
||||||
(like that an empty string isn't distinguishable from a
|
|
||||||
<Type>null</Type> value). I am not sure if this is an Oracle extension or part
|
|
||||||
of the ANSI standard.
|
|
||||||
</Para>
|
</Para>
|
||||||
</ListItem>
|
</ListItem>
|
||||||
</VarListEntry>
|
</VarListEntry>
|
||||||
|
|
||||||
<VarListEntry>
|
|
||||||
<Term>typedefs</Term>
|
|
||||||
<ListItem>
|
|
||||||
<Para>
|
|
||||||
As well as complex types like records and arrays, typedefs would be
|
|
||||||
a good thing to take care of.
|
|
||||||
</Para>
|
|
||||||
</ListItem>
|
|
||||||
</VarListEntry>
|
|
||||||
|
|
||||||
<VarListEntry>
|
<VarListEntry>
|
||||||
<Term>conversion of scripts</Term>
|
<Term>conversion of scripts</Term>
|
||||||
<ListItem>
|
<ListItem>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user