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: Talden <news_at_TheAbode.gen.nz>
Date: 2000/08/13
Message-ID: <8n4poi$k34$1@news.wave.co.nz>#1/1

> 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