Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Insert Error

5 posts in ,  Backup and RecoveryInternet General Discussion Last posting was on 2001-04-27 19:35:37.0Z
Raghavendra Kulkarni Posted on 2001-04-26 09:12:11.0Z
From: "Raghavendra Kulkarni" <raghu@antispam.com>
Subject: Insert Error
Date: Thu, 26 Apr 2001 14:42:11 +0530
Lines: 16
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.3018.1300
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.3018.1300
Message-ID: <wpH20sozAHA.205@forums.sybase.com>
Newsgroups: sybase.public.sqlserver.backup+recovery,sybase.public.sqlserver.general,sybase.public.sqlserver.internet
NNTP-Posting-Host: 216.160.29.41
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.sqlserver.backup+recovery:285 sybase.public.sqlserver.general:418 sybase.public.sqlserver.internet:210
Article PK: 1060804

I get the below error when our application tries to run a stored procedure
that is trying to insert a record in a table.

"com.sybase.jdbc2.jdbc.SybSQLException: Explicit value specified for
identity field in table 'mpstb_print_test' when IDENTITY_INSERT is set to
OFF."

Would appreciate anyone throwing light on the possible cause for such an
error.

Thanks in advance.

Raghu


Cliff Youse Posted on 2001-04-27 19:35:37.0Z
From: "Cliff Youse" <clifford.youse@sungard.com>
References: <wpH20sozAHA.205@forums.sybase.com>
Subject: Re: Insert Error
Date: Fri, 27 Apr 2001 15:35:37 -0400
Lines: 35
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4133.2400
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
Message-ID: <oJ4OpQ1zAHA.279@forums.sybase.com>
Newsgroups: sybase.public.sqlserver.backup+recovery,sybase.public.sqlserver.general,sybase.public.sqlserver.internet
NNTP-Posting-Host: fwe1.scs.sungard.com 198.62.209.10
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.sqlserver.backup+recovery:279 sybase.public.sqlserver.general:416 sybase.public.sqlserver.internet:208
Article PK: 1060798

logged in as sa try:

use master
go
sp_dboption datbasename, "auto identity", true
go
use databasename
go
checkpoint
go


where databasename = the name of the database

"Raghavendra Kulkarni" <raghu@antispam.com> wrote in message
news:wpH20sozAHA.205@forums.sybase.com...
> I get the below error when our application tries to run a stored procedure
> that is trying to insert a record in a table.
>
> "com.sybase.jdbc2.jdbc.SybSQLException: Explicit value specified for
> identity field in table 'mpstb_print_test' when IDENTITY_INSERT is set to
> OFF."
>
> Would appreciate anyone throwing light on the possible cause for such an
> error.
>
> Thanks in advance.
>
> Raghu
>
>
>


Jim_Morrison Posted on 2001-04-26 20:44:30.0Z
From: Jim_Morrison
Date: Thu, 26 Apr 2001 16:44:30 -0400
Newsgroups: sybase.public.sqlserver.backup+recovery
Subject: Re: Insert Error
Message-ID: <0EA5C1A82799C69E0071EFF885256A3A.0070258485256A3A@webforums>
References: <wpH20sozAHA.205@forums.sybase.com>
Lines: 4
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com!webforums.sybase.com!news
Xref: forums-1-dub sybase.public.sqlserver.backup+recovery:283
Article PK: 1060801

The table has an identity column, Sybase will automatically assign a value
to it. In order to manually insert value, you must use command "set
identity_insert tablename on prior to doing the insert. Check out
Reference Manual Volume I for more details


Raghavendra Kulkarni Posted on 2001-04-27 03:13:39.0Z
From: "Raghavendra Kulkarni" <raghu@antispam.com>
References: <wpH20sozAHA.205@forums.sybase.com> <0EA5C1A82799C69E0071EFF885256A3A.0070258485256A3A@webforums>
Subject: Re: Insert Error
Date: Fri, 27 Apr 2001 08:43:39 +0530
Lines: 21
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.3018.1300
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.3018.1300
Message-ID: <WG91JJyzAHA.254@forums.sybase.com>
Newsgroups: sybase.public.sqlserver.backup+recovery
NNTP-Posting-Host: 216.160.29.41
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.sqlserver.backup+recovery:281
Article PK: 1060799

Thanks guys.

I have an insert in a stored procedure that seems to be causing this error.
When I run this insert statement outside my SP I get no error, but when I
run the SP itself I get this error. I have currently gotten around the
problem by setting the identity_insert to on before the insert and set it
back to off immediately after. But what exactly is causing this problem I
cannot figure. As far as I can see I am not adding anything to the identity
column.

Appreciate all your time and help.

Raghu

<Jim_Morrison> wrote in message
news:0EA5C1A82799C69E0071EFF885256A3A.0070258485256A3A@webforums...
> The table has an identity column, Sybase will automatically assign a value
> to it. In order to manually insert value, you must use command "set
> identity_insert tablename on prior to doing the insert. Check out
> Reference Manual Volume I for more details


Gad Krosner Posted on 2001-04-26 20:19:48.0Z
Message-ID: <3AE882E4.57CBA8D4@Excite.com>
Date: Thu, 26 Apr 2001 16:19:48 -0400
From: Gad Krosner <Krosner@Excite.com>
Organization: Saga Tec, Inc.
X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U)
X-Accept-Language: en
MIME-Version: 1.0
To: Raghavendra Kulkarni <raghu@antispam.com>
Subject: Re: Insert Error
References: <wpH20sozAHA.205@forums.sybase.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: sybase.public.sqlserver.backup+recovery,sybase.public.sqlserver.general,sybase.public.sqlserver.internet
Lines: 15
NNTP-Posting-Host: GKrosner.ifc.org 164.114.180.220
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.sqlserver.backup+recovery:284 sybase.public.sqlserver.general:417 sybase.public.sqlserver.internet:209
Article PK: 1060806

I think it tells you not to specify a value for your IDENTITY column, because
Sybase generates a value for it automatically.

Raghavendra Kulkarni wrote:

> I get the below error when our application tries to run a stored procedure
> that is trying to insert a record in a table.
>
> "com.sybase.jdbc2.jdbc.SybSQLException: Explicit value specified for
> identity field in table 'mpstb_print_test' when IDENTITY_INSERT is set to
> OFF."
>
> Would appreciate anyone throwing light on the possible cause for such an
> error.
>
> Thanks in advance.
>
> Raghu