Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

"Yes, and I feel bad about rendering their useless carci into dogfood..." -- Badger comics


computers / comp.sys.tandem / Re: DELETE WHERE CURRENT

SubjectAuthor
* DELETE WHERE CURRENTAdam Kamal
+* Re: DELETE WHERE CURRENTRandall
|`* Re: DELETE WHERE CURRENTAdam Kamal
| `- Re: DELETE WHERE CURRENTRandall
`- Re: DELETE WHERE CURRENTBill Honaker

1
DELETE WHERE CURRENT

<b245f7b8-72b0-4bdd-ab22-df49550e8cc9n@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=300&group=comp.sys.tandem#300

  copy link   Newsgroups: comp.sys.tandem
X-Received: by 2002:a37:6390:: with SMTP id x138mr5517819qkb.146.1639505128999;
Tue, 14 Dec 2021 10:05:28 -0800 (PST)
X-Received: by 2002:a25:e90a:: with SMTP id n10mr620631ybd.180.1639505128720;
Tue, 14 Dec 2021 10:05:28 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.sys.tandem
Date: Tue, 14 Dec 2021 10:05:28 -0800 (PST)
Injection-Info: google-groups.googlegroups.com; posting-host=50.204.224.200; posting-account=0NHiHgoAAAC-mY8P0yk1bd3zDKN8t6jB
NNTP-Posting-Host: 50.204.224.200
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <b245f7b8-72b0-4bdd-ab22-df49550e8cc9n@googlegroups.com>
Subject: DELETE WHERE CURRENT
From: abolk...@gmail.com (Adam Kamal)
Injection-Date: Tue, 14 Dec 2021 18:05:28 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 29
 by: Adam Kamal - Tue, 14 Dec 2021 18:05 UTC

Trying to find the syntax DELETE WHERE CURRENT, did not find any info.
Ultimately, I am READING 2 tables via inner join,
and then update the company # on the record. Since company# is a key, so will have to delete and reinsert with new company number.

I have few question

1- How would you declare the cursor? is it different than READ only cursor? I am getting error 8223 when perform the delete. Currently it's as below: does this looks correct?
EXEC SQL
DECLARE GET_OPEN_ITEM CURSOR FOR
SELECT A.COLUMN1
, B.COLUMN1
FROM =TABLE1 A, TABLE2 B
INNER JOIN TABLE1 ON TABLE2
WHERE A.COLUMN1 = B.COLUMN2
BROWSE ACCESS
END-EXEC

2- When I perform a record DELETE, I will need to write 2 different DELETE statements, once for each table, correct?

3- I tried to do a DELETE and INSERT without using DELETE WHERE CURRENT, just regular delete, it worked. But when I fetch I still get the same record I just delete and inserted with new company #. The thing is when the process try to delete again, I get error 100 , so I do not understand how it got fetched the second time. Mu guess its has to do with buffering .

Any idea or thoughts will be highly appreciated.

Re: DELETE WHERE CURRENT

<a7ff992f-a83b-4fad-9bc6-e43bc0b5c6f8n@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=301&group=comp.sys.tandem#301

  copy link   Newsgroups: comp.sys.tandem
X-Received: by 2002:a05:622a:1652:: with SMTP id y18mr8326413qtj.63.1639509326430;
Tue, 14 Dec 2021 11:15:26 -0800 (PST)
X-Received: by 2002:a25:a2c1:: with SMTP id c1mr1070735ybn.473.1639509326260;
Tue, 14 Dec 2021 11:15:26 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.sys.tandem
Date: Tue, 14 Dec 2021 11:15:26 -0800 (PST)
In-Reply-To: <b245f7b8-72b0-4bdd-ab22-df49550e8cc9n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2607:fea8:3ddf:f2b0:1d92:5b76:a185:3f41;
posting-account=6VebZwoAAAAgrpUtsowyjrKRLNlqxnXo
NNTP-Posting-Host: 2607:fea8:3ddf:f2b0:1d92:5b76:a185:3f41
References: <b245f7b8-72b0-4bdd-ab22-df49550e8cc9n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <a7ff992f-a83b-4fad-9bc6-e43bc0b5c6f8n@googlegroups.com>
Subject: Re: DELETE WHERE CURRENT
From: rsbec...@nexbridge.com (Randall)
Injection-Date: Tue, 14 Dec 2021 19:15:26 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 35
 by: Randall - Tue, 14 Dec 2021 19:15 UTC

On Tuesday, December 14, 2021 at 1:05:30 p.m. UTC-5, abol...@gmail.com wrote:
> Trying to find the syntax DELETE WHERE CURRENT, did not find any info.
> Ultimately, I am READING 2 tables via inner join,
> and then update the company # on the record. Since company# is a key, so will have to delete and reinsert with new company number.
>
> I have few question
>
> 1- How would you declare the cursor? is it different than READ only cursor? I am getting error 8223 when perform the delete. Currently it's as below: does this looks correct?
> EXEC SQL
> DECLARE GET_OPEN_ITEM CURSOR FOR
> SELECT A.COLUMN1
> , B.COLUMN1
> FROM =TABLE1 A, TABLE2 B
> INNER JOIN TABLE1 ON TABLE2
> WHERE A.COLUMN1 = B.COLUMN2
> BROWSE ACCESS
> END-EXEC
>
> 2- When I perform a record DELETE, I will need to write 2 different DELETE statements, once for each table, correct?
>
> 3- I tried to do a DELETE and INSERT without using DELETE WHERE CURRENT, just regular delete, it worked. But when I fetch I still get the same record I just delete and inserted with new company #. The thing is when the process try to delete again, I get error 100 , so I do not understand how it got fetched the second time. Mu guess its has to do with buffering .
>
> Any idea or thoughts will be highly appreciated.

It appears that your issue is that you are using BROWSE ACCESS. If you are doing transaction processing, use either default or EXCLUSIVE access. Then you should not get the record fetched after deleted.

Re: DELETE WHERE CURRENT

<k42irgh14gdm9rs2c13f2b5u8ohgpleoo6@4ax.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=302&group=comp.sys.tandem#302

  copy link   Newsgroups: comp.sys.tandem
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!feeder1.feed.usenet.farm!feed.usenet.farm!peer03.ams4!peer.am4.highwinds-media.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx98.iad.POSTED!not-for-mail
From: no_spam_...@x_i_d.com (Bill Honaker)
Newsgroups: comp.sys.tandem
Subject: Re: DELETE WHERE CURRENT
Organization: XID, Ltd.
Message-ID: <k42irgh14gdm9rs2c13f2b5u8ohgpleoo6@4ax.com>
References: <b245f7b8-72b0-4bdd-ab22-df49550e8cc9n@googlegroups.com>
X-Newsreader: Forte Agent 6.00/32.1186
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 38
X-Complaints-To: abuse@easynews.com
X-Complaints-Info: Please be sure to forward a copy of ALL headers otherwise we will be unable to process your complaint properly.
Date: Tue, 14 Dec 2021 15:18:27 -0600
X-Received-Bytes: 2996
 by: Bill Honaker - Tue, 14 Dec 2021 21:18 UTC

On Tue, 14 Dec 2021 10:05:28 -0800 (PST), Adam Kamal <abolkini@gmail.com> wrote:

>Trying to find the syntax DELETE WHERE CURRENT, did not find any info.
>Ultimately, I am READING 2 tables via inner join,
>and then update the company # on the record. Since company# is a key, so will have to delete and reinsert with new company number.
>
>I have few question
>
>1- How would you declare the cursor? is it different than READ only cursor? I am getting error 8223 when perform the delete. Currently it's as below: does this looks correct?
>EXEC SQL
> DECLARE GET_OPEN_ITEM CURSOR FOR
> SELECT A.COLUMN1
> , B.COLUMN1
> FROM =TABLE1 A, TABLE2 B
> INNER JOIN TABLE1 ON TABLE2
> WHERE A.COLUMN1 = B.COLUMN2
> BROWSE ACCESS
>END-EXEC
>
>2- When I perform a record DELETE, I will need to write 2 different DELETE statements, once for each table, correct?
>
>3- I tried to do a DELETE and INSERT without using DELETE WHERE CURRENT, just regular delete, it worked. But when I fetch I still get the same record I just delete and inserted with new company #. The thing is when the process try to delete again, I get error 100 , so I do not understand how it got fetched the second time. Mu guess its has to do with buffering .
>
>Any idea or thoughts will be highly appreciated.

According to the DECLASRE CURSOR documentatation in the SQL/MP Reference manual (page 230), if a SELECT in a DECLARE CURSOR udpates or deletes rows,
the FROM clause can only include one table or protection view, and connot include a JOIN operator.

You are probably better off executing the statement above and create a list of company numbers which you want to process.
Then loop through the list and delete/insert. Best to begin/commit your transactions with each delete/insert.

It would seem fromr your example you're working with a COBOL program, depending on how many companies you expect to update,
you may need to write to an Enscribe file (or even a text file). Also, you probably need to select ALL columns from the rows if you plan
to insert, I suspect 'A' and 'B' may not be enough.

If your program were in C you could allocate memory to keep the list in.

Bill

Re: DELETE WHERE CURRENT

<766f7f45-e13b-4bb7-859f-242e44ee6a86n@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=303&group=comp.sys.tandem#303

  copy link   Newsgroups: comp.sys.tandem
X-Received: by 2002:a0c:8031:: with SMTP id 46mr8872632qva.126.1639527231725;
Tue, 14 Dec 2021 16:13:51 -0800 (PST)
X-Received: by 2002:a25:9b43:: with SMTP id u3mr2539894ybo.589.1639527231451;
Tue, 14 Dec 2021 16:13:51 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.sys.tandem
Date: Tue, 14 Dec 2021 16:13:51 -0800 (PST)
In-Reply-To: <a7ff992f-a83b-4fad-9bc6-e43bc0b5c6f8n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=50.204.224.200; posting-account=0NHiHgoAAAC-mY8P0yk1bd3zDKN8t6jB
NNTP-Posting-Host: 50.204.224.200
References: <b245f7b8-72b0-4bdd-ab22-df49550e8cc9n@googlegroups.com> <a7ff992f-a83b-4fad-9bc6-e43bc0b5c6f8n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <766f7f45-e13b-4bb7-859f-242e44ee6a86n@googlegroups.com>
Subject: Re: DELETE WHERE CURRENT
From: abolk...@gmail.com (Adam Kamal)
Injection-Date: Wed, 15 Dec 2021 00:13:51 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 42
 by: Adam Kamal - Wed, 15 Dec 2021 00:13 UTC

On Tuesday, December 14, 2021 at 11:15:27 AM UTC-8, Randall wrote:
> On Tuesday, December 14, 2021 at 1:05:30 p.m. UTC-5, abol...@gmail.com wrote:
> > Trying to find the syntax DELETE WHERE CURRENT, did not find any info.
> > Ultimately, I am READING 2 tables via inner join,
> > and then update the company # on the record. Since company# is a key, so will have to delete and reinsert with new company number.
> >
> > I have few question
> >
> > 1- How would you declare the cursor? is it different than READ only cursor? I am getting error 8223 when perform the delete. Currently it's as below: does this looks correct?
> > EXEC SQL
> > DECLARE GET_OPEN_ITEM CURSOR FOR
> > SELECT A.COLUMN1
> > , B.COLUMN1
> > FROM =TABLE1 A, TABLE2 B
> > INNER JOIN TABLE1 ON TABLE2
> > WHERE A.COLUMN1 = B.COLUMN2
> > BROWSE ACCESS
> > END-EXEC
> >
> > 2- When I perform a record DELETE, I will need to write 2 different DELETE statements, once for each table, correct?
> >
> > 3- I tried to do a DELETE and INSERT without using DELETE WHERE CURRENT, just regular delete, it worked. But when I fetch I still get the same record I just delete and inserted with new company #. The thing is when the process try to delete again, I get error 100 , so I do not understand how it got fetched the second time. Mu guess its has to do with buffering .
> >
> > Any idea or thoughts will be highly appreciated.
> It appears that your issue is that you are using BROWSE ACCESS. If you are doing transaction processing, use either default or EXCLUSIVE access. Then you should not get the record fetched after deleted.

Hello Randall,
Changed the cursor BROWSE ACCESS to REPRATABLE ACCESS, but it does not seem to work. Program continues to pickup already processed record. I guess the buffer where the data is stored on OPEN cursor is changing when I delete/insert the record.

Re: DELETE WHERE CURRENT

<905d4a24-0890-4e4f-8bf1-8fc13d7f53b5n@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=304&group=comp.sys.tandem#304

  copy link   Newsgroups: comp.sys.tandem
X-Received: by 2002:ac8:5ad1:: with SMTP id d17mr13588190qtd.23.1639594068563;
Wed, 15 Dec 2021 10:47:48 -0800 (PST)
X-Received: by 2002:a25:b3c3:: with SMTP id x3mr8301997ybf.25.1639594068274;
Wed, 15 Dec 2021 10:47:48 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.sys.tandem
Date: Wed, 15 Dec 2021 10:47:48 -0800 (PST)
In-Reply-To: <766f7f45-e13b-4bb7-859f-242e44ee6a86n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=99.229.22.139; posting-account=6VebZwoAAAAgrpUtsowyjrKRLNlqxnXo
NNTP-Posting-Host: 99.229.22.139
References: <b245f7b8-72b0-4bdd-ab22-df49550e8cc9n@googlegroups.com>
<a7ff992f-a83b-4fad-9bc6-e43bc0b5c6f8n@googlegroups.com> <766f7f45-e13b-4bb7-859f-242e44ee6a86n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <905d4a24-0890-4e4f-8bf1-8fc13d7f53b5n@googlegroups.com>
Subject: Re: DELETE WHERE CURRENT
From: rsbec...@nexbridge.com (Randall)
Injection-Date: Wed, 15 Dec 2021 18:47:48 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 45
 by: Randall - Wed, 15 Dec 2021 18:47 UTC

On Tuesday, December 14, 2021 at 7:13:52 p.m. UTC-5, abol...@gmail.com wrote:
> On Tuesday, December 14, 2021 at 11:15:27 AM UTC-8, Randall wrote:
> > On Tuesday, December 14, 2021 at 1:05:30 p.m. UTC-5, abol...@gmail.com wrote:
> > > Trying to find the syntax DELETE WHERE CURRENT, did not find any info..
> > > Ultimately, I am READING 2 tables via inner join,
> > > and then update the company # on the record. Since company# is a key, so will have to delete and reinsert with new company number.
> > >
> > > I have few question
> > >
> > > 1- How would you declare the cursor? is it different than READ only cursor? I am getting error 8223 when perform the delete. Currently it's as below: does this looks correct?
> > > EXEC SQL
> > > DECLARE GET_OPEN_ITEM CURSOR FOR
> > > SELECT A.COLUMN1
> > > , B.COLUMN1
> > > FROM =TABLE1 A, TABLE2 B
> > > INNER JOIN TABLE1 ON TABLE2
> > > WHERE A.COLUMN1 = B.COLUMN2
> > > BROWSE ACCESS
> > > END-EXEC
> > >
> > > 2- When I perform a record DELETE, I will need to write 2 different DELETE statements, once for each table, correct?
> > >
> > > 3- I tried to do a DELETE and INSERT without using DELETE WHERE CURRENT, just regular delete, it worked. But when I fetch I still get the same record I just delete and inserted with new company #. The thing is when the process try to delete again, I get error 100 , so I do not understand how it got fetched the second time. Mu guess its has to do with buffering .
> > >
> > > Any idea or thoughts will be highly appreciated.
> > It appears that your issue is that you are using BROWSE ACCESS. If you are doing transaction processing, use either default or EXCLUSIVE access. Then you should not get the record fetched after deleted.
> Hello Randall,
> Changed the cursor BROWSE ACCESS to REPRATABLE ACCESS, but it does not seem to work. Program continues to pickup already processed record. I guess the buffer where the data is stored on OPEN cursor is changing when I delete/insert the record.

Do you have BEGIN WORK, COMMIT WORK, BEGIN WORK in between?

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor