Welcome to dbFreaks.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

tembdb is not accepting the default null value

 
   Database Help (Home) -> Sybase RSS
Next:  Problem in sysdatabases  
Author Message
Venky

External


Since: Dec 04, 2008
Posts: 2



(Msg. 1) Posted: Thu Dec 04, 2008 7:46 am
Post subject: tembdb is not accepting the default null value
Archived from groups: comp>databases>sybase (more info?)

I have written a procedure
Ex:
create table #temp1
(
field1 varchar(10) null
)

insert into #temp1 select 'venkt'

create table #temp2
(
field1 varchar(10) null,
field2 varchar(10) null
)

insert into #temp2 select * from #temp1

This above procedure is working in one server. tempdb automatically
inserting null value into field2 of #temp2.
But in another server the procedure is giving the below error message.
Insert error: column name or number of supplied values does not match
table definition

I have fixed this issue by below code
insert into #temp2 select * from #temp1
instead of this one i have used
insert into #temp2 select *,null from #temp1

Can you please someone explain why tempdb is giving this error.

Thanks,
Venky

 >> Stay informed about: tembdb is not accepting the default null value 
Back to top
Login to vote
Carl Kayser

External


Since: Jan 01, 2007
Posts: 11



(Msg. 2) Posted: Thu Dec 04, 2008 11:26 am
Post subject: Re: tembdb is not accepting the default null value [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Venky" wrote in message

>I have written a procedure
> Ex:
> create table #temp1
> (
> field1 varchar(10) null
> )
>
> insert into #temp1 select 'venkt'
>
> create table #temp2
> (
> field1 varchar(10) null,
> field2 varchar(10) null
> )
>
> insert into #temp2 select * from #temp1
>
> This above procedure is working in one server. tempdb automatically
> inserting null value into field2 of #temp2.
> But in another server the procedure is giving the below error message.
> Insert error: column name or number of supplied values does not match
> table definition
>
> I have fixed this issue by below code
> insert into #temp2 select * from #temp1
> instead of this one i have used
> insert into #temp2 select *,null from #temp1
>
> Can you please someone explain why tempdb is giving this error.
>
> Thanks,
> Venky

Not that it really makes a lot of sense to me (since I think that the first
successful insert is wrong) but has "allow nulls by default" been set for
model (and implicitly tempdb) on one server and not the other?

 >> Stay informed about: tembdb is not accepting the default null value 
Back to top
Login to vote
Venky

External


Since: Dec 04, 2008
Posts: 2



(Msg. 3) Posted: Thu Dec 04, 2008 7:55 pm
Post subject: Re: tembdb is not accepting the default null value [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Dec 4, 9:26 pm, "Carl Kayser" wrote:
> "Venky" wrote in message
>
>
>
>
>
>
>
> >I have written a procedure
> > Ex:
> > create table #temp1
> > (
> > field1 varchar(10) null
> > )
>
> > insert into #temp1 select 'venkt'
>
> > create table #temp2
> > (
> > field1 varchar(10) null,
> > field2 varchar(10) null
> > )
>
> > insert into #temp2 select * from #temp1
>
> > This above procedure is working in one server. tempdb automatically
> > inserting null value into field2 of #temp2.
> > But in another server the procedure is giving the below error message.
> > Insert error: column name or number of supplied values does not match
> > table definition
>
> > I have fixed this issue by below code
> > insert into #temp2 select * from #temp1
> > instead of this one i have used
> > insert into #temp2 select *,null from #temp1
>
> > Can you please someone explain why tempdb is giving this error.
>
> > Thanks,
> > Venky
>
> Not that it really makes a lot of sense to me (since I think that the first
> successful insert is wrong) but has "allow nulls by default" been set for
> model (and implicitly tempdb) on one server and not the other?- Hide quoted text -
>
> - Show quoted text -

Yes. you are correct.
how can we check the tempdb model details. Can you please provide me
the command...
 >> Stay informed about: tembdb is not accepting the default null value 
Back to top
Login to vote
Carl Kayser

External


Since: Jan 01, 2007
Posts: 11



(Msg. 4) Posted: Fri Dec 05, 2008 5:28 am
Post subject: Re: tembdb is not accepting the default null value [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Venky" wrote in message

On Dec 4, 9:26 pm, "Carl Kayser" wrote:
> "Venky" wrote in message
>
>
>
>
>
>
>
> >I have written a procedure
> > Ex:
> > create table #temp1
> > (
> > field1 varchar(10) null
> > )
>
> > insert into #temp1 select 'venkt'
>
> > create table #temp2
> > (
> > field1 varchar(10) null,
> > field2 varchar(10) null
> > )
>
> > insert into #temp2 select * from #temp1
>
> > This above procedure is working in one server. tempdb automatically
> > inserting null value into field2 of #temp2.
> > But in another server the procedure is giving the below error message.
> > Insert error: column name or number of supplied values does not match
> > table definition
>
> > I have fixed this issue by below code
> > insert into #temp2 select * from #temp1
> > instead of this one i have used
> > insert into #temp2 select *,null from #temp1
>
> > Can you please someone explain why tempdb is giving this error.
>
> > Thanks,
> > Venky
>
> Not that it really makes a lot of sense to me (since I think that the
> first
> successful insert is wrong) but has "allow nulls by default" been set for
> model (and implicitly tempdb) on one server and not the other?- Hide
> quoted text -
>
> - Show quoted text -

Yes. you are correct.
how can we check the tempdb model details. Can you please provide me
the command...


sp_helpdb tempdb
go
 >> Stay informed about: tembdb is not accepting the default null value 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Difference between = null and IS NULL When Migrating from .. - Hi everybody, somewhere I heard or read that there are differences between how this is handled different in different versions of ASE. Can somebody give me a clue where to find this (again). I know that I have seen this problem occur when testing code o...

What is default user name and password to connect ASE 12.4 - Dear Gurus, Could anyone tell me What is default user name and password to connect ASE 12.4? like in Oracle default DBA login as username = sys password = sys In MS-SQL Server default DBA login as username = sa password = sa thanks in advance Sanjeev

Problem with ASE 12.5 Backup Server - Hello everyone !!! My problem: I have recently installed ASE 12.5 on winxp. When I try to make a dump or load with isql or DBArtisan i get this message: "Can't open a connection to site 'SYB_BACKUP'. See the error log file in the SQL Server boot..

Tuning stored procedures - Hi Everyone; We are working on tuning a compact framework mobile application which uses the Sybase iAnywhere 9.0 as the database. Performance of the stored procedures have been really bad. But we are at our wits end trying to find out the Stored..

PERL DBI Sybase::DBD error --- Dynaloader.pm - Sybase.so - All - I hesitated to post this as I saw many similar postings in my trawlings. However I have been unable to determine the problem in relation to the answers I've seen for the similar problems. Basically I had a working version of DBI and Sybase:DBD..
   Database Help (Home) -> Sybase All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]