Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: TRUNCATE on INSERT (ORACLE)
yes, that would work, of course. But I really meant to add "without changing code" :) you know, sort of like being able to do an ALTER SESSION SET NLS_DATE_FORMAT = "MM/DD/YYYY HH24:MI:SS" to make some current queries work, without changing code....
Talden wrote:
> > 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_home
Received on Sun Aug 13 2000 - 00:00:00 CDT