@@ -45,15 +45,12 @@ queries. It takes care of all the tedious moving of information to and
45
45
from variables in your <Acronym>C</Acronym> program. Many <Acronym>RDBMS</Acronym> packages
46
46
support this embedded language.
47
47
48
- <Para>
49
- There is an ANSI-standard describing how the embedded language should
50
- work. Most embedded <Acronym>SQL</Acronym> preprocessors I have seen and heard of make
51
- extensions so it is difficult to obtain portability between them
52
- anyway. I have not read the standard but I hope that my implementation
53
- does not deviate too much and that it would be possible to port programs
54
- with embedded <Acronym>SQL</Acronym> written for other <Acronym>RDBMS</Acronym> packages
55
- to <ProductName>Postgres</ProductName> and thus
56
- promoting the spirit of free software.
48
+ <Para> There is an ANSI-standard describing how the embedded language should
49
+ work. <Application>ecpg</Application> was designed to meet this standard as much as possible. So it is
50
+ possible to port programs with embedded <Acronym>SQL</Acronym> written for
51
+ other <Acronym>RDBMS</Acronym> packages to
52
+ <ProductName>Postgres</ProductName> and thus promoting the spirit of free
53
+ software.
57
54
58
55
<Sect1>
59
56
<Title>The Concept</Title>
@@ -431,25 +428,6 @@ you are not interested in how it really works, skip this section.
431
428
This version the preprocessor has some flaws:
432
429
433
430
<VariableList>
434
- <VarListEntry>
435
- <Term>Preprocessor output</Term>
436
- <ListItem>
437
- <Para>
438
- The variables should be static.
439
- </Para>
440
- </ListItem>
441
- </VarListEntry>
442
-
443
- <VarListEntry>
444
- <Term>Preprocessor cannot do syntax checking on your <Acronym>SQL</Acronym> statements</Term>
445
- <ListItem>
446
- <Para>
447
- Whatever you write is copied more or less exactly to the <ProductName>Postgres</ProductName> and
448
- you will not be able to locate your errors until run-time.
449
- </Para>
450
- </ListItem>
451
- </VarListEntry>
452
-
453
431
<VarListEntry>
454
432
<Term>no restriction to strings only</Term>
455
433
<ListItem>
@@ -485,51 +463,59 @@ to_date et al.
485
463
<Term>records</Term>
486
464
<ListItem>
487
465
<Para>
488
- Possibility to define records or structures in the declare section
489
- in a way that the record can be filled from one row in the database.
466
+ Records or structures have to be defined in the declare section.
490
467
491
- <Para>
492
- This is a simpler way to handle an entire row at a time.
493
- </Para>
494
468
</ListItem>
495
469
</VarListEntry>
496
470
497
471
<VarListEntry>
498
- <Term>array operations </Term>
472
+ <Term>missing statements </Term>
499
473
<ListItem>
500
474
<Para>
501
- Oracle has array operations that enhances speed. When implementing it in
502
- <Application>ecpg</Application> it is done for compatibility reasons only. For them to
503
- improve speed would require a lot more insight in the <ProductName>Postgres</ProductName> internal
504
- mechanisms than I possess.
475
+ The following statements are not implemented thus far:
476
+ <VariableList>
477
+ <VarListEntry>
478
+ <Term> exec sql type</Term>
479
+ </VarListEntry>
480
+ <VarListEntry>
481
+ <Term> exec sql prepare</Term>
482
+ </VarListEntry>
483
+ <VarListEntry>
484
+ <Term> exec sql allocate</Term>
485
+ </VarListEntry>
486
+ <VarListEntry>
487
+ <Term> exec sql free</Term>
488
+ </VarListEntry>
489
+ <VarListEntry>
490
+ <Term> exec sql whenever sqlwarning</Term>
491
+ </VarListEntry>
492
+ <VarListEntry>
493
+ <Term> SQLSTATE</Term>
494
+ </VarListEntry>
495
+ </VariableList>
505
496
</Para>
506
497
</ListItem>
507
498
</VarListEntry>
508
499
509
500
<VarListEntry>
510
- <Term>indicator variables </Term>
501
+ <Term>message �no data found� </Term>
511
502
<ListItem>
512
503
<Para>
513
- Oracle has indicator variables that tell if a value is <Type>null</Type> or if
514
- it is empty. This largely simplifies array operations and provides for a
515
- way to hack around some design flaws in the handling of <Type>VARCHAR2</Type>
516
- (like that an empty string isn't distinguishable from a
517
- <Type>null</Type> value). I am not sure if this is an Oracle extension or part
518
- of the ANSI standard.
504
+ The error message for "no data" in an exec sql insert select from statement
505
+ has to be 100.
519
506
</Para>
520
507
</ListItem>
521
508
</VarListEntry>
522
509
523
510
<VarListEntry>
524
- <Term>typedefs </Term>
511
+ <Term>sqlwanr[6] </Term>
525
512
<ListItem>
526
513
<Para>
527
- As well as complex types like records and arrays, typedefs would be
528
- a good thing to take care of .
514
+ sqlwarn[6] should be 'W' if the PRECISION or SCALE value specified in a SET
515
+ DESCRIPTOR statement will be ignored .
529
516
</Para>
530
517
</ListItem>
531
518
</VarListEntry>
532
-
533
519
<VarListEntry>
534
520
<Term>conversion of scripts</Term>
535
521
<ListItem>
0 commit comments