Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: TRUNCATE on INSERT (ORACLE)

Re: TRUNCATE on INSERT (ORACLE)

From: uncle.scrooge <uncle.scrooge_at_worldnet.att.net>
Date: 2000/08/13
Message-ID: <39960C19.AE5B38CC@worldnet.att.net>#1/1

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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US