|
8 | 8 | //=////////////////////////////////////////////////////////////////////////=//
|
9 | 9 | //
|
10 | 10 | // Copyright 2010-2011 Christian Ensel
|
11 |
| -// Copyright 2017-2023 Ren-C Open Source Contributors |
| 11 | +// Copyright 2017-2024 Ren-C Open Source Contributors |
12 | 12 | // REBOL is a trademark of REBOL Technologies
|
13 | 13 | //
|
14 | 14 | // See README.md and CREDITS.md for more information.
|
|
27 | 27 | //
|
28 | 28 | // The driver is made to handle queries which look like:
|
29 | 29 | //
|
30 |
| -// ["select * from tables where (name = ?) and (age = ?)" {Brian} 42] |
| 30 | +// ["select * from tables where (name = ?) and (age = ?)" {Brian} 49] |
31 | 31 | //
|
32 | 32 | // The ? notation for substitution points is what is known as a "parameterized
|
33 | 33 | // query". The reason it is supported at the driver level (instead of making
|
34 | 34 | // the usermode Rebol code merge into a single string) is to make it easier to
|
35 | 35 | // defend against SQL injection attacks. This way, the scheme code does not
|
36 | 36 | // need to worry about doing SQL-syntax-aware string escaping.
|
| 37 | +// |
| 38 | +// An experimental SQL dialect is implemented in the usermode portion of the |
| 39 | +// extension, which allows you to write your SQL as a BLOCK! of words and |
| 40 | +// other symbols, forming the words as text, turning GROUP!s into parentheses |
| 41 | +// and doing parameterized variable subsitutions with ^META-WORD!s. So if you |
| 42 | +// were to write the Rebol code: |
| 43 | +// |
| 44 | +// fptitle: "Title" |
| 45 | +// fpinits: "Inits" |
| 46 | +// fpname: "Name" |
| 47 | +// |
| 48 | +// sql-execute [ |
| 49 | +// INSERT INTO fps (title, fname, surname) |
| 50 | +// VALUES (^fptitle, ^fpinits, ^fpname) |
| 51 | +// ] |
| 52 | +// |
| 53 | +// What gets passed to the driver will look like: |
| 54 | +// |
| 55 | +// [ |
| 56 | +// {INSERT INTO fps (title, fname, surname) VALUES (?, ?, ?)} |
| 57 | +// "Title" "Inits" "Name" |
| 58 | +// ] |
| 59 | +// |
| 60 | +// (Again, this is experimental, and the choice of ^META-WORD! is not final.) |
| 61 | +// |
37 | 62 |
|
38 | 63 | #include "reb-config.h"
|
39 | 64 |
|
@@ -226,7 +251,7 @@ Value* Error_ODBC_Core(
|
226 | 251 |
|
227 | 252 | case SQL_ERROR:
|
228 | 253 | return rebValue(
|
229 |
| - "make error! {Internal ODBC extension error (bad diag record #)" |
| 254 | + "make error! {Internal ODBC extension error (bad diag record #)}" |
230 | 255 | );
|
231 | 256 |
|
232 | 257 | case SQL_NO_DATA:
|
|
0 commit comments