Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 2067

Re: behaviour of default with load table command in IQ 16.

$
0
0

Hi Salim,

 

From "create table statement" IQ ref manuals, the DEFAULT is applied ONLY when the value for that column is not SPECIFIED.

--------------

http://infocenter.sybase.com/help/topic/com.sybase.infocenter.dc01776.1600/doc/html/san1281564827401.html

 

DEFAULT default-value—When defining a column for a table, you can specify a default value for the column using the DEFAULT keyword in the CREATE TABLE (and ALTER TABLE) statement. If a DEFAULT value is specified for a column, this DEFAULT value is used as the value of the column in any INSERT (or LOAD) statement that does not specify a valuefor the column.

----------

 

For example, If you insert NULL value or "zero length" string, then you are in the case "the value is specified" and thus inserted as is. Default value is not used.

 

You can try examples below:

 

insert testa(a, c) values(1, 'm');

insert testa(a, b,  c) values(2,null, 'n');

insert testa(a,b, c) values(1,'', 'o');

 

See also related options

NON_ANSI_NULL_VARCHAR and LOAD_ZEROLENGTH_ASNULL ;


 

Regards,

Tayeb.


Viewing all articles
Browse latest Browse all 2067

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>