Quote:
|
Originally Posted by db2random
The problem is I need to avoid substr.
|
Actually, any "automated" solution will use SUBSTR in one way or the other.
Even SqlServer's "SET ANSI_WARNINGS OFF" uses an (automatic) SUBSTR.
The only "fully automatic" way I can see right now is through triggers on each and every table (or view) involved in those inserts. (See my previous post.)
Maybe the "optimal" solution in your case would be a redesign of the database:
Issue an ALTER TABLE on all text columns (where this makes sense), changing their datatype to VARCHAR(2000) (or whatever large value is appropriate).
Since most of the time the values will be short enough, you don't loose storage space with this operation.
Only, now, all SELECTs should be revisited since they could start receiving longer data...