Subject Re: [firebird-support] Re: Issues with String Truncation error on insert (FB 2.1 64 bits windows server)
Author Reinier Olislagers
On 17-1-2013 4:35, fabianchocron wrote:
> What we are trying to achieve is to have a trigger that reads the size
> of each field and trims all insert sentences to the size of the field
> being inserted, and the reason is because the application receives the
> strings to insert on database from many different systems across the
> world and it is not aware of the current size of each field, the
> application's job is to receive data via internet and post it to the DB
> via insert command. So the App is doing what it was designed to do. The
> DB's fields size cannot be increased every time a new system across the
> world is connected to the application, and we cannot just increase field
> sizes to the maximum because it will slowdown the system's response. So
> we planned to use triggers to trim the input but it seems impossible.
> The alternative would be to let the App know the DB schema upfront, and
> deal with the issue at the App level, but we were under the impression
> the problem could be sorted via triggers, it appears it is not possible.

Why do you need to "let the app know the DB schema"? Can't the
application query the DB schema tables (RDB$*) itself to find out field
lengths - e.g. once when the application starts?