Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Delete rows without moving to delete buffer

831 views
Skip to first unread message

louisantony

unread,
Jun 6, 2008, 10:53:43 AM6/6/08
to
Is there any method with which we can delete rows from
datawindow without moving rows to delete buffer?

Jason 'Bug' Fenter [TeamSybase]

unread,
Jun 6, 2008, 10:55:13 AM6/6/08
to
RowsDiscard()

This will *not* remove the rows from the database.

louisantony

unread,
Jun 6, 2008, 10:59:54 AM6/6/08
to
Thanks for the answer. But I need to remove rows from
database also.

Arthur Hefti

unread,
Jun 6, 2008, 11:01:49 AM6/6/08
to
Why don't you want to move them to the delete buffer?
If not you have to loop through you rows and use embedded SQL to delete the
rows from the db.

Arthur

<Louis Antony> wrote in message news:484950ea.3b7...@sybase.com...

Arthur Hefti

unread,
Jun 6, 2008, 11:08:42 AM6/6/08
to
A datawindow only deletes rows from the db when they are in the deleted
buffer....

<Louis Antony> wrote in message news:48495294.3bc...@sybase.com...
>I had to face this question in an interview and they want it
> to be done with datawindow; not with any embeded sql
> statements.

louisantony

unread,
Jun 6, 2008, 11:07:00 AM6/6/08
to
I had to face this question in an interview and they want it
to be done with datawindow; not with any embeded sql
statements.

> Why don't you want to move them to the delete buffer?

HarryLai

unread,
Jun 6, 2008, 12:05:46 PM6/6/08
to
How about ...

1. Move the rows to another datawindow or datastore, and detele these rows whent save?

2. Add one column to table for mark the rows that need to delete (e.g.: del_flag = 1), then delete these rows in trigger after save.


<Louis Antony> 撰寫於郵件新聞:48495294.3bc...@sybase.com...

Jerry Siegel [TeamSybase]

unread,
Jun 6, 2008, 5:50:42 PM6/6/08
to
Mess with the DDL in SQLPreview?

<Louis Antony> wrote in message news:48495294.3bc...@sybase.com...

Arnd Schmidt

unread,
Jun 7, 2008, 8:12:10 AM6/7/08
to
>Mess with the DDL in SQLPreview?
Interesting short answer as a question, but without explanation.

When will DDL be used in SQLPreview?

Arnd

Jerry Siegel [TeamSybase]

unread,
Jun 7, 2008, 11:07:44 PM6/7/08
to
Senior moment! Would you believe DML?

"Arnd Schmidt" <arnd.s...@gmx.de> wrote in message
news:uiuk44lhs02piu5vm...@4ax.com...

Chris Pollach

unread,
Jun 9, 2008, 7:44:15 AM6/9/08
to
Hi Louis;

You were posed an interesting question! This is how I would do it ...

1) Add a computed SQL column (ie: cc_delete)
2) Add a filter to the DWO to filter where cc_delete = 'Y'
3) When the user requests a Delete - set the computed column to "Y" and it
should disappear.

When a physical delete is required ... move the filter buffer to the Delete
buffer and perform an Update. The interesting bonus behind this approach is
to cancel all the pending deletes by just setting the Filter to "" if the
user wants to back out of the multi-row delete sequence. :-)

HTH

--
Regards ... Chris
ISUG - NA RUG Director
http://chrispollach.pbdjmagazine.com


<Louis Antony> wrote in message news:48495294.3bc...@sybase.com...

Arnd Schmidt

unread,
Jun 9, 2008, 4:51:53 PM6/9/08
to
Because moving rows to the delete buffer will violate the "subject",
why not using use a stored procedure-update?
The SP deletes the rows in the database where @cc_delete = "Y"
and after successfull Update() perform a row discard on cc_delete = "Y" rows
in the filter.

Maybe the folks had a framework, where they used such an approach.

I used a framework where _all_ DB transactions were done via
stored procdures, but the framework did not used the built-in DW SP features.
Instead there was a repository based service class, that does a match
against a tag based security sytsem to get the rights and the to be used procedure
for an insert / update / delete. For sure, if no SP was configured for the
user, the insert, delete or save buttons and also dw features where automatically
disabled by the framework.


Arnd

Jerry Siegel [TeamSybase]

unread,
Jun 9, 2008, 5:19:48 PM6/9/08
to
I'm beginning to think it was a trick question! The DW generates a delete if
and only if the row is in the delete buffer, and the only way to get around
that is to twiddle the SQL in SQLPreview or write your own, embedded or in
an SP.

"Arnd Schmidt" <arnd.s...@gmx.de> wrote in message

news:ud4r44hqstd5i1i1i...@4ax.com...

Jerry Siegel [TeamSybase]

unread,
Jun 9, 2008, 5:29:03 PM6/9/08
to
Except for a changed key column with the option set to delete and insert
rather than update in place.

"Jerry Siegel [TeamSybase]" <jNOsSPAMsiegel@yahoo!.com> wrote in message
news:484d9e74$1@forums-1-dub...

Chris Pollach

unread,
Jun 10, 2008, 7:16:51 AM6/10/08
to
As long as you never move DBMS engines - that approach is a good one! :-)


"Arnd Schmidt" <arnd.s...@gmx.de> wrote in message
news:ud4r44hqstd5i1i1i...@4ax.com...

Arnd Schmidt

unread,
Jun 10, 2008, 3:00:13 PM6/10/08
to
To allow changing a key column (primary key) was not an option.
All PKs were invisible or non editalbe columns for the end user.
Also the SPs checked the "generic" last modified user/date informations
that has been previously retrieved.

Did you see some scenarios where key modification were used in this way (delete / insert)?

I am really interested when this could make sense.

Arnd

Jerry Siegel [TeamSybase]

unread,
Jun 10, 2008, 3:12:05 PM6/10/08
to
I don't believe I ever used the delete/insert option - always synthetic
keys, so it was never needed.
Could be the way to go if you needed to cascade delete referential integity
related rows, which no longer connected because the natural key changed.

"Arnd Schmidt" <arnd.s...@gmx.de> wrote in message

news:q7jt44lu4duf0r9kg...@4ax.com...

Arnd Schmidt

unread,
Jun 10, 2008, 3:48:21 PM6/10/08
to
I am glad you also never seen or used this feature ;-)

Also to force a cascading delete when changing the natural key,
is something I have never seen.

Arnd

0 new messages