dbTalk Databases Forums  

SA table column created from select into with a variable has not nullconstraint by default

sybase.public.sqlanywhere.general sybase.public.sqlanywhere.general


Discuss SA table column created from select into with a variable has not nullconstraint by default in the sybase.public.sqlanywhere.general forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Aparna Kurada
 
Posts: n/a

Default SA table column created from select into with a variable has not nullconstraint by default - 12-02-2009 , 01:10 PM






Hi,
Would like to know the reason for the behaviour for SA table column
created from select into with a variable has not null constraint by
default?

set temporary option Allow_Nulls_By_Default = 'ON'
set temporary option Non_Ansi_Null_Varchar = 'ON'
create table iqtab(c_rowid integer)
commit
create variable @varclob_retest long varchar
set @varclob_retest = ''
insert into iqtab values (1)
drop table iqtab_new
select *,@varclob_retest into iqtab_new from iqtab-->
From dbtran sql file, sa creates the table with the definition below:
create table DBA.saiqtab_new(
c_rowid integer null,
@varclob_saretest long varchar not null,
)

Thank you,
Aparna

Reply With Quote
  #2  
Old   
Nick Elson [Sybase iAnywhere]
 
Posts: n/a

Default Re: SA table column created from select into with a variable has not null constraint by default - 12-03-2009 , 03:16 PM






First things first. The feature you are using when you specify
the option NON_ANSI_NULL_VARCHAR is new to IQ15.1
and does not seem to be recognized by SQL Anywhere 11.0.1
or earlier [at least not from dbisql]. So if that is the feature
that is failing you will probably need to contact IQ support or
a newsgroup that is specifically targetted to IQ.

Since I cannot set that option I get the behaviour I would
expect with SQL Anywhere 11.0.1 and earlier and that
matches your result, it would seem to be an IQ speicific
issue. It may also be dependant upon which interactive
SQL utility you are using.



"Aparna Kurada" <akurada1 (AT) yahoo (DOT) com> wrote

Quote:
Hi,
Would like to know the reason for the behaviour for SA table column
created from select into with a variable has not null constraint by
default?

set temporary option Allow_Nulls_By_Default = 'ON'
set temporary option Non_Ansi_Null_Varchar = 'ON'
create table iqtab(c_rowid integer)
commit
create variable @varclob_retest long varchar
set @varclob_retest = ''
insert into iqtab values (1)
drop table iqtab_new
select *,@varclob_retest into iqtab_new from iqtab--
From dbtran sql file, sa creates the table with the definition below:
create table DBA.saiqtab_new(
c_rowid integer null,
@varclob_saretest long varchar not null,
)

Thank you,
Aparna

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.