Deletion of empty record

Deletion of empty record

  

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?

Hi Manjusha,

Can you please share the sql you are trying.


Regards

-SK-

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 

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.

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

However, in that case he should get an error.

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

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

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

Hi Edu,

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

Regards

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.


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

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).

hi Edu,

I have retried the cases, unfortunately you are correct.

regards

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!

Thank you everyone