> Specify the name of the table, if an exception occurs when insert
> -----------------------------------------------------------------
>
> Key: CORE-4252
> URL: http://tracker.firebirdsql.org/browse/CORE-4252
> Project: Firebird Core
> Issue Type: Improvement
> Reporter: Maxim Kuzmin
>
>
> When occurs exception in INSERT, FB show info, like this:
> The insert failed because a column definition includes validation constraints.
> validation error for column ID_WRIT_OF_EXEC, value "*** null ***".
>
> But if exception occurs in EXECUTE BLOCK or in program, sometimes impossible,
> looking at the name of the field, to determine the
> name of the table. Which complicates the correction of an error in
> database/program.
The simplest way is to prefix reported column name by relation name with
some separator
(usually a dot). I.e. error message will look like:
validation error for column TABLE_NAME.FIELD_NAME, value "*** null ***".
My concern is delimited identifiers with embedded spaces (in dialect 3
database).
For example, if we have "Some Table" with "Some Field" in it, we'll have:
validation error for column Some Table.Some Field, value "*** null ***"
and i consider it as a weird :)
We can:
a) always add quotes around identifiers:
validation error for column "TABLE_NAME"."FIELD_NAME", value "*** null
***".
validation error for column "Some Table"."Some Field", value "*** null
***"
b) add quotes only if database is in dialect 3, or
c) add quotes only if identifier have embedded space in it.
I prefer (a) as simplest solution.
Also, i consider accompanied SQL CODE message
The insert failed because a column definition includes validation
constraints.
is not good, as it is the same for both INSERT and UPDATE statements.
I offer to change it by something like
The insert (update) failed because a column definition includes
validation constraints.
or someone could offer better wording.
Opinions ?
Regards,
Vlad
------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
Firebird-Devel mailing list, web interface at
https://lists.sourceforge.net/lists/listinfo/firebird-devel