Re: Insert Into-why doesn't it work?

From: Ethel Aardvark <bigjobbies_at_hotmail.com>
Date: 30 Apr 2003 02:10:49 -0700
Message-ID: <1a8fec49.0304300110.6fd13d28_at_posting.google.com>


This is most likely a problem with the date mask. When you treat DATE datatypes like STRING data types of whatever sort and vice-versa, oracle is forced to do a best-guess at converting them. This is EXACTLY the same thing as if you had put "WHERE v_number = '05'" or "WHERE v_string = 5" (which is converted - the number or the string?)

If you try again with an explicit conversion you will: A) find it more likely to work how you intend; B) find it continues to work when your DBA decides to change the default date mask to a 4-digit year (which is probably more sensible if considered in isolation).

If you say what you want the "LIKE" clause to do I will try to give you better help.

Regards,

ETA monicaroman_at_yahoo.com (Monica Roman) wrote in message news:<9eb77af5.0304290812.49235b7f_at_posting.google.com>...
> Hello,
> I received help on SQLLDR from this group a few weeks ago and now I
> need help with the insert into statement.
> I have 2 tables that have the exact same structure:
>
> Name Type
> ------------------------------- ------------
> FIELD1 DATE
> FIELD2 VARCHAR2(30)
> FIELD3 VARCHAR2(25)
> FIELD4 CLOB
>
> I need to:
>
> INSERT INTO Table1
> SELECT * FROM Table2
> WHERE Field1 like '28-APR-03%';
>
> But it doesn't work! why? It should be so simple!!
> I read a lot of the archived messages on the subject but couldn't find
> my answer. Apparently it has to do with the LOB field, does it? Please
> help?
>
> Thank you so much!
>
> Monica
Received on Wed Apr 30 2003 - 11:10:49 CEST

Original text of this message