Trying to insert a record in a table of enterprise Developement environment

Hi,

    I am trying to insert a record to a tabke in my personal environment. It works well. But when I try to do the same in enterprise's developement environment, it throws an error. I have attached the screenshot of the error below.

Thanks in advance.

Hi Kaarthick,

Which database are you using Oracle or SQL?

  • Have you ever tried to delete commit line run again?
  • Is your primary attribute data type text or boolean? If it's boolean could you try insert 1 or 0

    Hope it helps.

    With best regards,
    F.Karatay

Hi kaarthick,

May I ask why you are inserting a record in such a strange way? Why are you using an SQL query instead of an Entity Action? What you're doing is definitely not the OutSystems way of doing things!

For a massive bulk of entries I can understand why you'd want to use an advanced sql....but for just 1 entry why not just use the default CRUD actions? Outsystems will (in most cases) perfrom the exact same query you are here.

There's also a committransaction action found in System, which also removes the need to use such a commit (please reconsider using a commit, throwing an exception will not rollback the database after a commit).

Kilian Hekhuis wrote:

Hi kaarthick,

May I ask why you are inserting a record in such a strange way? Why are you using an SQL query instead of an Entity Action? What you're doing is definitely not the OutSystems way of doing things!

Hi Kilian,

             I have used the actions in Outsystems. I did this for a single record to change in back end, it worked fine in my personal environment. My questions is there no way to add a single record to the entity using SQL in outsystems.?


Ferhat Karatay wrote:

Hi Kaarthick,

Which database are you using Oracle or SQL?

  • Have you ever tried to delete commit line run again?
  • Is your primary attribute data type text or boolean? If it's boolean could you try insert 1 or 0

    Hope it helps.

    With best regards,
    F.Karatay

Thanks for your reply

 I have done the delete command it works fine. Also tried with the boolean attribute as 1 or 0. Still I get the same error. But its strange not working on enterprise development environment and not in my personal environment.


kaarthick Velraj wrote:

Ferhat Karatay wrote:

Hi Kaarthick,

Which database are you using Oracle or SQL?

  • Have you ever tried to delete commit line run again?
  • Is your primary attribute data type text or boolean? If it's boolean could you try insert 1 or 0

    Hope it helps.

    With best regards,
    F.Karatay

Thanks for your reply

 I have done the delete command it works fine. Also tried with the boolean attribute as 1 or 0. Still I get the same error. But its strange not working on enterprise development environment and not in my personal environment.


Hi Kaarthick,

Personal environments have some limitations.
If you really need to know why it's happening I think you should ask to OutSystems support.

With best regards,
F.Karatay

kaarthick Velraj wrote:

sed the actions in Outsystems. I did this for a single record to change in back end, it worked fine in my personal environment. My questions is there no way to add a single record to the entity using SQL in outsystems.?

Hi Kaarthik,

It's not a matter of whether it's possible, it's a matter of what you should or shouldn't do in OutSystems. It's possible to bypass all the low-code facilities OutSystems offers and write apps using JavaScript and SQL and whatnot, but that's not the way the Platform should be used, and you won't be a good OutSystems developer doing so.

There's absolutely no good reason to use a SQL Statement to insert a single record, period. So don't do it. Use an Entity Action, as you should. Yes, there are special cases like bulk updates or deletes that might warrent using SQL, but in this case, don't.