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.

Cascade Delete Fails

10 posts in General Discussion Last posting was on 2011-05-26 09:14:47.0Z
Chris Hargett Posted on 2010-01-04 21:16:35.0Z
From: Chris Hargett <chriswhargett@nc.rr.com>
User-Agent: Thunderbird 2.0.0.23 (Windows/20090812)
MIME-Version: 1.0
Newsgroups: ianywhere.public.general
Subject: Cascade Delete Fails
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4b425ab3$1@forums-1-dub>
Date: 4 Jan 2010 13:16:35 -0800
X-Trace: forums-1-dub 1262639795 10.22.241.152 (4 Jan 2010 13:16:35 -0800)
X-Original-Trace: 4 Jan 2010 13:16:35 -0800, vip152.sybase.com
Lines: 45
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:7849
Article PK: 6882

I'm having problems with cascade deletes in SQL Anywhere 11
(11.0.1.2331). I have the following tables and relationships.

Reconciliation:1 ClientBankAccount:635
\__ ClientBankAccountReconciliation:635__/
\__ClientBankAccountReconciliationDetail:635 DepositLog:23,106
\__DepositLogReconciliation:22,286___________/

All the relationships from top to bottom are one to many with a rule of
cascade delete. The colons indicate the current cardinality. The problem
appears to be with the DepositLogReconciliation table (an associative
between tables ClientBankAccountReconciliationDetail and DepositLog).
When I execute the statement:

DELETE FROM RECONCILIATION;

I get:

Could not execute statement.
No primary key value for foreign key
'ClientBankAccountReconciliationDetailKey' in table
'DepositLogReconciliation'
SLQCODE=-194, ODBC 3 State="23000"
Line 1, Column 1

If I execute a subsequent rollback, it reports success. That is until I
close the iSQL window when I get the message:

Could not commit changes before disconnecting.
No primary key value for foreign key
'ClientBankAccountReconciliationDetailKey' in table
'DepositLogReconciliation'
SLQCODE=-194, ODBC 3 State="23000"
Line 1, Column 1

While analyzing the problem I wrote some code to loop through deleting
all ClientBankAccountReconciliations one at a time ignoring exceptions.
What I ended up with was one ClientBankAccountReconciliation row with
126 DepositLogReconciliation rows attached. When I ran the loop again
without doing a commit, nothing changed. I still had 1 CBAR and 126
DLRs. When I committed the work and then ran the loop again, the final
CBAR and DLRs got deleted.

Anybody out there having this problem or know what I'm doing wrong or
how I can work around this problem?


Glenn Paulley [Sybase iAnywhere] Posted on 2010-01-04 22:48:24.0Z
From: "Glenn Paulley [Sybase iAnywhere]" <paulley@ianywhere.com>
Reply-To: paulley@ianywhere.com
Organization: Sybase iAnywhere
User-Agent: Thunderbird 2.0.0.23 (Windows/20090812)
MIME-Version: 1.0
Newsgroups: ianywhere.public.general
Subject: Re: Cascade Delete Fails
References: <4b425ab3$1@forums-1-dub>
In-Reply-To: <4b425ab3$1@forums-1-dub>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4b427038$1@forums-1-dub>
Date: 4 Jan 2010 14:48:24 -0800
X-Trace: forums-1-dub 1262645304 10.22.241.152 (4 Jan 2010 14:48:24 -0800)
X-Original-Trace: 4 Jan 2010 14:48:24 -0800, vip152.sybase.com
Lines: 69
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:7850
Article PK: 6888

What is your setting of the WAIT_FOR_COMMIT option?

Glenn

Chris Hargett wrote:
> I'm having problems with cascade deletes in SQL Anywhere 11
> (11.0.1.2331). I have the following tables and relationships.
>
> Reconciliation:1 ClientBankAccount:635
> \__ ClientBankAccountReconciliation:635__/
> \__ClientBankAccountReconciliationDetail:635 DepositLog:23,106
> \__DepositLogReconciliation:22,286___________/
>
> All the relationships from top to bottom are one to many with a rule of
> cascade delete. The colons indicate the current cardinality. The problem
> appears to be with the DepositLogReconciliation table (an associative
> between tables ClientBankAccountReconciliationDetail and DepositLog).
> When I execute the statement:
>
> DELETE FROM RECONCILIATION;
>
> I get:
>
> Could not execute statement.
> No primary key value for foreign key
> 'ClientBankAccountReconciliationDetailKey' in table
> 'DepositLogReconciliation'
> SLQCODE=-194, ODBC 3 State="23000"
> Line 1, Column 1
>
> If I execute a subsequent rollback, it reports success. That is until I
> close the iSQL window when I get the message:
>
> Could not commit changes before disconnecting.
> No primary key value for foreign key
> 'ClientBankAccountReconciliationDetailKey' in table
> 'DepositLogReconciliation'
> SLQCODE=-194, ODBC 3 State="23000"
> Line 1, Column 1
>
> While analyzing the problem I wrote some code to loop through deleting
> all ClientBankAccountReconciliations one at a time ignoring exceptions.
> What I ended up with was one ClientBankAccountReconciliation row with
> 126 DepositLogReconciliation rows attached. When I ran the loop again
> without doing a commit, nothing changed. I still had 1 CBAR and 126
> DLRs. When I committed the work and then ran the loop again, the final
> CBAR and DLRs got deleted.
>
> Anybody out there having this problem or know what I'm doing wrong or
> how I can work around this problem?

--
Glenn Paulley
Director, Engineering (Query Processing)
Sybase iAnywhere

Blog: http://iablog.sybase.com/paulley

EBF's and Patches: http://downloads.sybase.com
choose SQL Anywhere Studio >> change 'time frame' to all

To Submit Bug Reports: http://case-express.sybase.com

SQL Anywhere Studio Supported Platforms and Support Status
http://my.sybase.com/detail?id=1002288

Whitepapers, TechDocs, and bug fixes are all available through the
Sybase iAnywhere pages at
http://www.sybase.com/products/databasemanagement/sqlanywhere/technicalsupport


Chris Hargett Posted on 2010-01-04 23:19:36.0Z
Message-ID: <4B427782.70402@nc.rr.com>
From: Chris Hargett <chriswhargett@nc.rr.com>
User-Agent: Thunderbird 2.0.0.23 (Windows/20090812)
MIME-Version: 1.0
Newsgroups: ianywhere.public.general
To: paulley@ianywhere.com
Subject: Re: Cascade Delete Fails
References: <4b425ab3$1@forums-1-dub> <4b427038$1@forums-1-dub>
In-Reply-To: <4b427038$1@forums-1-dub>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Date: 4 Jan 2010 15:19:36 -0800
X-Trace: forums-1-dub 1262647176 10.22.241.152 (4 Jan 2010 15:19:36 -0800)
X-Original-Trace: 4 Jan 2010 15:19:36 -0800, vip152.sybase.com
Lines: 70
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:7852
Article PK: 6884

Here is some additional info. I'm in the process of setting up a client.
I have 7 transmittal files that could be used in the process of building
data into these tables. The following lists the success or failure I had
in using the transmittals to insert and delete the data.

Data Inserted Data Deleted
Jun ok ok
Jul ok ok
Aug ok fail
Sep ok fail
Oct ok fail
Nov ok ok
Dec ok ok

June would cause the least amount of data to be created. December the
most. In other words, the amount of data incrementally increases.

Glenn Paulley [Sybase iAnywhere] wrote:
> What is your setting of the WAIT_FOR_COMMIT option?
>
> Glenn
>
> Chris Hargett wrote:
>> I'm having problems with cascade deletes in SQL Anywhere 11
>> (11.0.1.2331). I have the following tables and relationships.
>>
>> Reconciliation:1 ClientBankAccount:635
>> \__ ClientBankAccountReconciliation:635__/
>> \__ClientBankAccountReconciliationDetail:635 DepositLog:23,106
>> \__DepositLogReconciliation:22,286___________/
>>
>> All the relationships from top to bottom are one to many with a rule
>> of cascade delete. The colons indicate the current cardinality. The
>> problem appears to be with the DepositLogReconciliation table (an
>> associative between tables ClientBankAccountReconciliationDetail and
>> DepositLog). When I execute the statement:
>>
>> DELETE FROM RECONCILIATION;
>>
>> I get:
>>
>> Could not execute statement.
>> No primary key value for foreign key
>> 'ClientBankAccountReconciliationDetailKey' in table
>> 'DepositLogReconciliation'
>> SLQCODE=-194, ODBC 3 State="23000"
>> Line 1, Column 1
>>
>> If I execute a subsequent rollback, it reports success. That is until
>> I close the iSQL window when I get the message:
>>
>> Could not commit changes before disconnecting.
>> No primary key value for foreign key
>> 'ClientBankAccountReconciliationDetailKey' in table
>> 'DepositLogReconciliation'
>> SLQCODE=-194, ODBC 3 State="23000"
>> Line 1, Column 1
>>
>> While analyzing the problem I wrote some code to loop through deleting
>> all ClientBankAccountReconciliations one at a time ignoring
>> exceptions. What I ended up with was one
>> ClientBankAccountReconciliation row with 126 DepositLogReconciliation
>> rows attached. When I ran the loop again without doing a commit,
>> nothing changed. I still had 1 CBAR and 126 DLRs. When I committed the
>> work and then ran the loop again, the final CBAR and DLRs got deleted.
>>
>> Anybody out there having this problem or know what I'm doing wrong or
>> how I can work around this problem?
>


Chris Hargett Posted on 2010-01-04 23:09:48.0Z
Message-ID: <4B427538.7050607@nc.rr.com>
From: Chris Hargett <chriswhargett@nc.rr.com>
User-Agent: Thunderbird 2.0.0.23 (Windows/20090812)
MIME-Version: 1.0
Newsgroups: ianywhere.public.general
To: paulley@ianywhere.com
Subject: Re: Cascade Delete Fails
References: <4b425ab3$1@forums-1-dub> <4b427038$1@forums-1-dub>
In-Reply-To: <4b427038$1@forums-1-dub>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Date: 4 Jan 2010 15:09:48 -0800
X-Trace: forums-1-dub 1262646588 10.22.241.152 (4 Jan 2010 15:09:48 -0800)
X-Original-Trace: 4 Jan 2010 15:09:48 -0800, vip152.sybase.com
Lines: 55
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:7851
Article PK: 6887

Initially, it was no wait. I changed it to WAIT_FOR_COMMIT and tried it
getting the same error at commit time.

Glenn Paulley [Sybase iAnywhere] wrote:
> What is your setting of the WAIT_FOR_COMMIT option?
>
> Glenn
>
> Chris Hargett wrote:
>> I'm having problems with cascade deletes in SQL Anywhere 11
>> (11.0.1.2331). I have the following tables and relationships.
>>
>> Reconciliation:1 ClientBankAccount:635
>> \__ ClientBankAccountReconciliation:635__/
>> \__ClientBankAccountReconciliationDetail:635 DepositLog:23,106
>> \__DepositLogReconciliation:22,286___________/
>>
>> All the relationships from top to bottom are one to many with a rule
>> of cascade delete. The colons indicate the current cardinality. The
>> problem appears to be with the DepositLogReconciliation table (an
>> associative between tables ClientBankAccountReconciliationDetail and
>> DepositLog). When I execute the statement:
>>
>> DELETE FROM RECONCILIATION;
>>
>> I get:
>>
>> Could not execute statement.
>> No primary key value for foreign key
>> 'ClientBankAccountReconciliationDetailKey' in table
>> 'DepositLogReconciliation'
>> SLQCODE=-194, ODBC 3 State="23000"
>> Line 1, Column 1
>>
>> If I execute a subsequent rollback, it reports success. That is until
>> I close the iSQL window when I get the message:
>>
>> Could not commit changes before disconnecting.
>> No primary key value for foreign key
>> 'ClientBankAccountReconciliationDetailKey' in table
>> 'DepositLogReconciliation'
>> SLQCODE=-194, ODBC 3 State="23000"
>> Line 1, Column 1
>>
>> While analyzing the problem I wrote some code to loop through deleting
>> all ClientBankAccountReconciliations one at a time ignoring
>> exceptions. What I ended up with was one
>> ClientBankAccountReconciliation row with 126 DepositLogReconciliation
>> rows attached. When I ran the loop again without doing a commit,
>> nothing changed. I still had 1 CBAR and 126 DLRs. When I committed the
>> work and then ran the loop again, the final CBAR and DLRs got deleted.
>>
>> Anybody out there having this problem or know what I'm doing wrong or
>> how I can work around this problem?
>


Glenn Paulley [Sybase iAnywhere] Posted on 2010-01-05 14:41:52.0Z
From: "Glenn Paulley [Sybase iAnywhere]" <paulley@ianywhere.com>
Reply-To: paulley@ianywhere.com
Organization: Sybase iAnywhere
User-Agent: Thunderbird 2.0.0.23 (Windows/20090812)
MIME-Version: 1.0
Newsgroups: ianywhere.public.general
Subject: Re: Cascade Delete Fails
References: <4b425ab3$1@forums-1-dub> <4b427038$1@forums-1-dub> <4B427538.7050607@nc.rr.com>
In-Reply-To: <4B427538.7050607@nc.rr.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4b434fb0@forums-1-dub>
Date: 5 Jan 2010 06:41:52 -0800
X-Trace: forums-1-dub 1262702512 10.22.241.152 (5 Jan 2010 06:41:52 -0800)
X-Original-Trace: 5 Jan 2010 06:41:52 -0800, vip152.sybase.com
Lines: 80
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:7855
Article PK: 6883

Does your database successfully pass validation?

Glenn

Chris Hargett wrote:
> Initially, it was no wait. I changed it to WAIT_FOR_COMMIT and tried it
> getting the same error at commit time.
>
> Glenn Paulley [Sybase iAnywhere] wrote:
>> What is your setting of the WAIT_FOR_COMMIT option?
>>
>> Glenn
>>
>> Chris Hargett wrote:
>>> I'm having problems with cascade deletes in SQL Anywhere 11
>>> (11.0.1.2331). I have the following tables and relationships.
>>>
>>> Reconciliation:1 ClientBankAccount:635
>>> \__ ClientBankAccountReconciliation:635__/
>>> \__ClientBankAccountReconciliationDetail:635 DepositLog:23,106
>>> \__DepositLogReconciliation:22,286___________/
>>>
>>> All the relationships from top to bottom are one to many with a rule
>>> of cascade delete. The colons indicate the current cardinality. The
>>> problem appears to be with the DepositLogReconciliation table (an
>>> associative between tables ClientBankAccountReconciliationDetail and
>>> DepositLog). When I execute the statement:
>>>
>>> DELETE FROM RECONCILIATION;
>>>
>>> I get:
>>>
>>> Could not execute statement.
>>> No primary key value for foreign key
>>> 'ClientBankAccountReconciliationDetailKey' in table
>>> 'DepositLogReconciliation'
>>> SLQCODE=-194, ODBC 3 State="23000"
>>> Line 1, Column 1
>>>
>>> If I execute a subsequent rollback, it reports success. That is until
>>> I close the iSQL window when I get the message:
>>>
>>> Could not commit changes before disconnecting.
>>> No primary key value for foreign key
>>> 'ClientBankAccountReconciliationDetailKey' in table
>>> 'DepositLogReconciliation'
>>> SLQCODE=-194, ODBC 3 State="23000"
>>> Line 1, Column 1
>>>
>>> While analyzing the problem I wrote some code to loop through
>>> deleting all ClientBankAccountReconciliations one at a time ignoring
>>> exceptions. What I ended up with was one
>>> ClientBankAccountReconciliation row with 126 DepositLogReconciliation
>>> rows attached. When I ran the loop again without doing a commit,
>>> nothing changed. I still had 1 CBAR and 126 DLRs. When I committed
>>> the work and then ran the loop again, the final CBAR and DLRs got
>>> deleted.
>>>
>>> Anybody out there having this problem or know what I'm doing wrong or
>>> how I can work around this problem?
>>

--
Glenn Paulley
Director, Engineering (Query Processing)
Sybase iAnywhere

Blog: http://iablog.sybase.com/paulley

EBF's and Patches: http://downloads.sybase.com
choose SQL Anywhere Studio >> change 'time frame' to all

To Submit Bug Reports: http://case-express.sybase.com

SQL Anywhere Studio Supported Platforms and Support Status
http://my.sybase.com/detail?id=1002288

Whitepapers, TechDocs, and bug fixes are all available through the
Sybase iAnywhere pages at
http://www.sybase.com/products/databasemanagement/sqlanywhere/technicalsupport


Chris Hargett Posted on 2010-01-05 15:57:07.0Z
Message-ID: <4B43614D.1020309@nc.rr.com>
From: Chris Hargett <chriswhargett@nc.rr.com>
User-Agent: Thunderbird 2.0.0.23 (Windows/20090812)
MIME-Version: 1.0
Newsgroups: ianywhere.public.general
To: paulley@ianywhere.com
Subject: Re: Cascade Delete Fails
References: <4b425ab3$1@forums-1-dub> <4b427038$1@forums-1-dub> <4B427538.7050607@nc.rr.com> <4b434fb0@forums-1-dub>
In-Reply-To: <4b434fb0@forums-1-dub>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Date: 5 Jan 2010 07:57:07 -0800
X-Trace: forums-1-dub 1262707027 10.22.241.152 (5 Jan 2010 07:57:07 -0800)
X-Original-Trace: 5 Jan 2010 07:57:07 -0800, vip152.sybase.com
Lines: 67
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:7856
Article PK: 6889

Yes, before the delete. No, after the delete. Fails on the
DepositLogReconciliation table.

Glenn Paulley [Sybase iAnywhere] wrote:
> Does your database successfully pass validation?
>
> Glenn
>
> Chris Hargett wrote:
>> Initially, it was no wait. I changed it to WAIT_FOR_COMMIT and tried
>> it getting the same error at commit time.
>>
>> Glenn Paulley [Sybase iAnywhere] wrote:
>>> What is your setting of the WAIT_FOR_COMMIT option?
>>>
>>> Glenn
>>>
>>> Chris Hargett wrote:
>>>> I'm having problems with cascade deletes in SQL Anywhere 11
>>>> (11.0.1.2331). I have the following tables and relationships.
>>>>
>>>> Reconciliation:1 ClientBankAccount:635
>>>> \__ ClientBankAccountReconciliation:635__/
>>>> \__ClientBankAccountReconciliationDetail:635 DepositLog:23,106
>>>> \__DepositLogReconciliation:22,286___________/
>>>>
>>>> All the relationships from top to bottom are one to many with a rule
>>>> of cascade delete. The colons indicate the current cardinality. The
>>>> problem appears to be with the DepositLogReconciliation table (an
>>>> associative between tables ClientBankAccountReconciliationDetail and
>>>> DepositLog). When I execute the statement:
>>>>
>>>> DELETE FROM RECONCILIATION;
>>>>
>>>> I get:
>>>>
>>>> Could not execute statement.
>>>> No primary key value for foreign key
>>>> 'ClientBankAccountReconciliationDetailKey' in table
>>>> 'DepositLogReconciliation'
>>>> SLQCODE=-194, ODBC 3 State="23000"
>>>> Line 1, Column 1
>>>>
>>>> If I execute a subsequent rollback, it reports success. That is
>>>> until I close the iSQL window when I get the message:
>>>>
>>>> Could not commit changes before disconnecting.
>>>> No primary key value for foreign key
>>>> 'ClientBankAccountReconciliationDetailKey' in table
>>>> 'DepositLogReconciliation'
>>>> SLQCODE=-194, ODBC 3 State="23000"
>>>> Line 1, Column 1
>>>>
>>>> While analyzing the problem I wrote some code to loop through
>>>> deleting all ClientBankAccountReconciliations one at a time ignoring
>>>> exceptions. What I ended up with was one
>>>> ClientBankAccountReconciliation row with 126
>>>> DepositLogReconciliation rows attached. When I ran the loop again
>>>> without doing a commit, nothing changed. I still had 1 CBAR and 126
>>>> DLRs. When I committed the work and then ran the loop again, the
>>>> final CBAR and DLRs got deleted.
>>>>
>>>> Anybody out there having this problem or know what I'm doing wrong
>>>> or how I can work around this problem?
>>>
>


Chris Hargett Posted on 2010-01-05 18:18:32.0Z
Message-ID: <4B438272.2060702@nc.rr.com>
From: Chris Hargett <chriswhargett@nc.rr.com>
User-Agent: Thunderbird 2.0.0.23 (Windows/20090812)
MIME-Version: 1.0
Newsgroups: ianywhere.public.general
To: paulley@ianywhere.com
Subject: Re: Cascade Delete Fails
References: <4b425ab3$1@forums-1-dub> <4b427038$1@forums-1-dub> <4B427538.7050607@nc.rr.com> <4b434fb0@forums-1-dub>
In-Reply-To: <4b434fb0@forums-1-dub>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Date: 5 Jan 2010 10:18:32 -0800
X-Trace: forums-1-dub 1262715512 10.22.241.152 (5 Jan 2010 10:18:32 -0800)
X-Original-Trace: 5 Jan 2010 10:18:32 -0800, vip152.sybase.com
Lines: 68
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:7859
Article PK: 6893

Yes, before the delete. No, after the delete. Fails on the
DepositLogReconciliation table.

Glenn Paulley [Sybase iAnywhere] wrote:
> Does your database successfully pass validation?
>
> Glenn
>
> Chris Hargett wrote:
>> Initially, it was no wait. I changed it to WAIT_FOR_COMMIT and tried
>> it getting the same error at commit time.
>>
>> Glenn Paulley [Sybase iAnywhere] wrote:
>>> What is your setting of the WAIT_FOR_COMMIT option?
>>>
>>> Glenn
>>>
>>> Chris Hargett wrote:
>>>> I'm having problems with cascade deletes in SQL Anywhere 11
>>>> (11.0.1.2331). I have the following tables and relationships.
>>>>
>>>> Reconciliation:1 ClientBankAccount:635
>>>> \__ ClientBankAccountReconciliation:635__/
>>>> \__ClientBankAccountReconciliationDetail:635 DepositLog:23,106
>>>> \__DepositLogReconciliation:22,286___________/
>>>>
>>>> All the relationships from top to bottom are one to many with a rule
>>>> of cascade delete. The colons indicate the current cardinality. The
>>>> problem appears to be with the DepositLogReconciliation table (an
>>>> associative between tables ClientBankAccountReconciliationDetail and
>>>> DepositLog). When I execute the statement:
>>>>
>>>> DELETE FROM RECONCILIATION;
>>>>
>>>> I get:
>>>>
>>>> Could not execute statement.
>>>> No primary key value for foreign key
>>>> 'ClientBankAccountReconciliationDetailKey' in table
>>>> 'DepositLogReconciliation'
>>>> SLQCODE=-194, ODBC 3 State="23000"
>>>> Line 1, Column 1
>>>>
>>>> If I execute a subsequent rollback, it reports success. That is
>>>> until I close the iSQL window when I get the message:
>>>>
>>>> Could not commit changes before disconnecting.
>>>> No primary key value for foreign key
>>>> 'ClientBankAccountReconciliationDetailKey' in table
>>>> 'DepositLogReconciliation'
>>>> SLQCODE=-194, ODBC 3 State="23000"
>>>> Line 1, Column 1
>>>>
>>>> While analyzing the problem I wrote some code to loop through
>>>> deleting all ClientBankAccountReconciliations one at a time ignoring
>>>> exceptions. What I ended up with was one
>>>> ClientBankAccountReconciliation row with 126
>>>> DepositLogReconciliation rows attached. When I ran the loop again
>>>> without doing a commit, nothing changed. I still had 1 CBAR and 126
>>>> DLRs. When I committed the work and then ran the loop again, the
>>>> final CBAR and DLRs got deleted.
>>>>
>>>> Anybody out there having this problem or know what I'm doing wrong
>>>> or how I can work around this problem?
>>>
>


Jeff Albion [Sybase iAnywhere] Posted on 2010-01-05 21:42:14.0Z
From: "Jeff Albion [Sybase iAnywhere]" <firstname.lastname@ianywhere.com>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.5) Gecko/20091204 Thunderbird/3.0
MIME-Version: 1.0
Newsgroups: ianywhere.public.general
Subject: Re: Cascade Delete Fails
References: <4b425ab3$1@forums-1-dub> <4b427038$1@forums-1-dub> <4B427538.7050607@nc.rr.com> <4b434fb0@forums-1-dub> <4B438272.2060702@nc.rr.com>
In-Reply-To: <4B438272.2060702@nc.rr.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4b43b236$1@forums-1-dub>
Date: 5 Jan 2010 13:42:14 -0800
X-Trace: forums-1-dub 1262727734 10.22.241.152 (5 Jan 2010 13:42:14 -0800)
X-Original-Trace: 5 Jan 2010 13:42:14 -0800, vip152.sybase.com
Lines: 23
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:7861
Article PK: 6892

Hi Chris,

I have sent you an e-mail to follow-up on this issue. Please let me know
if you didn't receive it. Hopefully we can determine if there is a data
corruption issue or if there is another problem to address.

Thanks!

On 1/5/2010 1:18 PM, Chris Hargett wrote:
>
> Yes, before the delete. No, after the delete. Fails on the
> DepositLogReconciliation table.

--
Jeff Albion, Sybase iAnywhere

iAnywhere Developer Community :
http://www.sybase.com/developer/library/sql-anywhere-techcorner
iAnywhere Documentation : http://www.ianywhere.com/developer/product_manuals
SQL Anywhere Patches and EBFs :
http://downloads.sybase.com/swd/summary.do?baseprod=144&client=ianywhere&timeframe=0
Report a Bug/Open a Case : http://case-express.sybase.com/cx/


Jeff Albion [Sybase iAnywhere] Posted on 2010-01-13 19:26:34.0Z
From: "Jeff Albion [Sybase iAnywhere]" <firstname.lastname@ianywhere.com>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.5) Gecko/20091204 Thunderbird/3.0
MIME-Version: 1.0
Newsgroups: ianywhere.public.general
Subject: Re: Cascade Delete Fails
References: <4b425ab3$1@forums-1-dub> <4b427038$1@forums-1-dub> <4B427538.7050607@nc.rr.com> <4b434fb0@forums-1-dub> <4B438272.2060702@nc.rr.com> <4b43b236$1@forums-1-dub>
In-Reply-To: <4b43b236$1@forums-1-dub>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4b4e1e6a@forums-1-dub>
Date: 13 Jan 2010 11:26:34 -0800
X-Trace: forums-1-dub 1263410794 10.22.241.152 (13 Jan 2010 11:26:34 -0800)
X-Original-Trace: 13 Jan 2010 11:26:34 -0800, vip152.sybase.com
Lines: 21
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:7873
Article PK: 6906

This issue is an instance of CR #606024 (
http://search.sybase.com/kbx/changerequests?bug_id=606024 ). The
software should be upgraded past 11.0.1.2354 and the database index must
be rebuilt for this issue to be fixed.

Regards,

On 1/5/2010 4:42 PM, Jeff Albion [Sybase iAnywhere] wrote:
> I have sent you an e-mail to follow-up on this issue. Please let me know
> if you didn't receive it. Hopefully we can determine if there is a data
> corruption issue or if there is another problem to address.

--
Jeff Albion, Sybase iAnywhere

iAnywhere Developer Community :
http://www.sybase.com/developer/library/sql-anywhere-techcorner
iAnywhere Documentation : http://www.ianywhere.com/developer/product_manuals
SQL Anywhere Patches and EBFs :
http://downloads.sybase.com/swd/summary.do?baseprod=144&client=ianywhere&timeframe=0
Report a Bug/Open a Case : http://case-express.sybase.com/cx/


test Posted on 2011-05-26 09:14:47.0Z
From: "test" <mashoud@gmail.com>
Newsgroups: ianywhere.public.general
References: <4b425ab3$1@forums-1-dub>
Subject: Re: Cascade Delete Fails
Lines: 50
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4dde1a07@forums-1-dub>
Date: 26 May 2011 02:14:47 -0700
X-Trace: forums-1-dub 1306401287 10.22.241.152 (26 May 2011 02:14:47 -0700)
X-Original-Trace: 26 May 2011 02:14:47 -0700, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:8142
Article PK: 7160


"Chris Hargett" <chriswhargett@nc.rr.com> wrote in message
news:4b425ab3$1@forums-1-dub...
> I'm having problems with cascade deletes in SQL Anywhere 11 (11.0.1.2331).
> I have the following tables and relationships.
>
> Reconciliation:1 ClientBankAccount:635
> \__ ClientBankAccountReconciliation:635__/
> \__ClientBankAccountReconciliationDetail:635 DepositLog:23,106
> \__DepositLogReconciliation:22,286___________/
>
> All the relationships from top to bottom are one to many with a rule of
> cascade delete. The colons indicate the current cardinality. The problem
> appears to be with the DepositLogReconciliation table (an associative
> between tables ClientBankAccountReconciliationDetail and DepositLog). When
> I execute the statement:
>
> DELETE FROM RECONCILIATION;
>
> I get:
>
> Could not execute statement.
> No primary key value for foreign key
> 'ClientBankAccountReconciliationDetailKey' in table
> 'DepositLogReconciliation'
> SLQCODE=-194, ODBC 3 State="23000"
> Line 1, Column 1
>
> If I execute a subsequent rollback, it reports success. That is until I
> close the iSQL window when I get the message:
>
> Could not commit changes before disconnecting.
> No primary key value for foreign key
> 'ClientBankAccountReconciliationDetailKey' in table
> 'DepositLogReconciliation'
> SLQCODE=-194, ODBC 3 State="23000"
> Line 1, Column 1
>
> While analyzing the problem I wrote some code to loop through deleting all
> ClientBankAccountReconciliations one at a time ignoring exceptions. What I
> ended up with was one ClientBankAccountReconciliation row with 126
> DepositLogReconciliation rows attached. When I ran the loop again without
> doing a commit, nothing changed. I still had 1 CBAR and 126 DLRs. When I
> committed the work and then ran the loop again, the final CBAR and DLRs
> got deleted.
>
> Anybody out there having this problem or know what I'm doing wrong or how
> I can work around this problem?