Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: TRUNCATE on INSERT (ORACLE)
> There's no jdbc (or database) option for
> statement/connection/database/resultset whereas one can
> tell the database "if this string doesn't fit, truncate it", is there???
>
> ie in ORACLE, how can I get this to work without altering the table or
> making the string shorter?
>
> CREATE TABLE YYY ( FOO VARCHAR2(10));
>
> INSERT INTO YYY VALUES('abcdefghijlkmnopqrstuvwxyz');
How about
insert into YYY values (substr('abcdefgihjklmnopqrstuvwxyz',1,10));
Although why you can't clientside shorten the string I can't really understand.
-- Talden_at_homeReceived on Sun Aug 13 2000 - 00:00:00 CDT