138
Views
15
Comments
Deletion of empty record
Question

Hi


I'm trying to delete some empty records using sql but it's not working. Is there any possibility of deleting an empty record?

2025-04-22 05-54-18
Shashi Kant Shukla

Hi Manjusha,

Can you please share the sql you are trying.


Regards

-SK-

2020-06-08 02-42-28
Wasabi

Hi, Manjus:

# If all being well: the record is properly deleted

# No lock to that record

# the most possible cause is the lack of "commit".

regards 

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Hi Manjusha,

Like Shashi says, without your query, how can we know what goes wrong?

@Box: what kind of commit are you talking about? The Platform auto-commits database actions, so unless you have an Exception with a rollback, there's no need to commit anything.

2018-08-06 13-40-17
Ramakrushnarao Seera

Hi Manjusha,

Check if the entity has references in another table with Protect delete rule, then it won't allow you to delete parent entity data unless you have data in child entity, First clean the child entity data then clear the parent entity data..


thanks,

Ramakrushna Rao Seera

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

However, in that case he should get an error.

2020-06-08 02-42-28
Wasabi

In case you call a function and then go to other page, it will not committed..

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

No, that's not true, afaik. But to make sure I'll ask around.

2020-02-28 09-46-54
Eduardo Jauch

Hi @Box

Two different situations here.

Situation 1. You call a Screen Action, do something (like a delete in database) and navigate with an External URL. The Action will end and the transaction will be commited. The browser will receive the response with the indication to navigate to the new Screen.

Situation 2. You call a Screen Action, do something (like a delete in database) and navigate with Destination (server side navigation). The preparation of the other screen will be executed and at the end of the preparation of the next screen, the transaction will be commited.

So, the transaction will always be automatically commited, unless an exception happens and there is an Exception Handler with Rollback set to YES. 

Assuming the OP does not get an ERROR message, there are two things that can be happening here to the delete not happening.

1. The query is not causing an exception, but does not select the correct fields to delete.
2. There are an exception (be the syntax of the query or a DELETE rule being violated), and there is an Exception Handler with LOG set to NO and no essage sending to the screen.

Don't see other possibilities right now.

Cheers

2020-06-08 02-42-28
Wasabi

Hi Edu,

Thanks for a long string explanation. Did u try? I will retry on Monday.. using external db mysql.

Regards

2020-02-28 09-46-54
Eduardo Jauch

Box wrote:

Hi Edu,

Thanks for a long string explanation. Did u try? I will retry on Monday.. using external db mysql.

Regards

With OutSystems Database, yes.
I already tested this both with OutSystems database as well as External database. Although in both cases with SQL Server. Don't think he database matter.


2020-06-08 02-42-28
Wasabi

How if it navigates to external URL, would it be committed?

2020-02-28 09-46-54
Eduardo Jauch

Yes. In this case, at the end of the Action, as usual, because the External URL will navigate from the Browser, not from the Server Side (afaik).

2020-06-08 02-42-28
Wasabi

hi Edu,

I have retried the cases, unfortunately you are correct.

regards

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Hi Box,

First, Eduardo is called is "Eduardo". Unless he's given you the permission to abbreviate his name, please don't call him "Edu".

Secondly, I find it pretty fortunate he's correct. Embrace it as an opportunity to learn!

UserImage.jpg
Manjusha Kavitam

Thank you everyone

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.