Subject | Re: [IB-Conversions] problem with sql2gdb |
---|---|
Author | Marcelo |
Post date | 2000-11-19T23:15:20Z |
Helen Borrie wrote:
The quotes can be turned on or off from the Customizations step (but the
wizard will use other mangling methods). The colon before the field name
means that it is a placeholder. For example, if you want not to move a field,
you can modify the script to look like:
insert into mytable (
"field1",
"field3'
) values (
:"field1",
:"field3"
)
The record insertion will then use the DEFAULT expression defined for the
field, NULL, or raise an exception, which gets reported later on.
quotes are kept because they are simple placeholders; if you remove the
quotes around the field names, you should remove them from the value
placeholders, too:
insert into mytable (
field1
) values (
:field1
)
modeling (what's the different between product and Product?).
However, the option is *on* by default, because it's the easiest way to
handle spaces; sql2gdb was written with the idea of producing as little
confusion as possible to MS SQL and MS Access users, where it's legal (and
painfully common) to use spaces in identifier names, and then put them
between brackets. Queries simply need to be rewritten like so:
select [emp name]
from [employees]
translates to
select "emp name"
from "employees"
If you're used to plain, good ol' EMP_NAME and EMPLOYEES, using quotes is a
pain; if you come from Access and MSSQL, it keeps things more consistent.
Marcelo
> At 12:51 AM 19-11-00 +0000, you wrote:The sql2gdb wizard uses this script as a "template" to move records later on.
> >I tryed to convert my .mdb to interbase's .sql with sql2gdb but all
> >the INSERT's I got are as abobe:
> >
> >INSERT INTO "mytable" (
> > "field1",
> > "field2",
> > "field3",
> >) VALUES (
> > :"field1",
> > :"field2",
> > :"field3",
> >)
> >;
> >
> >That ist, I don't get the values but only the names preceding of ':'.
>
The quotes can be turned on or off from the Customizations step (but the
wizard will use other mangling methods). The colon before the field name
means that it is a placeholder. For example, if you want not to move a field,
you can modify the script to look like:
insert into mytable (
"field1",
"field3'
) values (
:"field1",
:"field3"
)
The record insertion will then use the DEFAULT expression defined for the
field, NULL, or raise an exception, which gets reported later on.
>True, true, true; use simple quotes for delimiting values. However, the
> Unless you want your column names to be case-sensitive, or you want to use
> reserved words as column names, avoid the quotes when you define the
> columns in your metadata.
>
> In IB 6, double-quotes are not legal syntax for delimiting values.
quotes are kept because they are simple placeholders; if you remove the
quotes around the field names, you should remove them from the value
placeholders, too:
insert into mytable (
field1
) values (
:field1
)
>Yes, and case-sensitivity is, in my opinion, a pain, at least for data
> If you have made your column names case-sensitive, then you are stuck with
> putting them around the field list to avoid having InterBase store them as
> uppercase.
modeling (what's the different between product and Product?).
However, the option is *on* by default, because it's the easiest way to
handle spaces; sql2gdb was written with the idea of producing as little
confusion as possible to MS SQL and MS Access users, where it's legal (and
painfully common) to use spaces in identifier names, and then put them
between brackets. Queries simply need to be rewritten like so:
select [emp name]
from [employees]
translates to
select "emp name"
from "employees"
If you're used to plain, good ol' EMP_NAME and EMPLOYEES, using quotes is a
pain; if you come from Access and MSSQL, it keeps things more consistent.
Marcelo