Skip to content
Advertisement

oracle sql : “get or insert” stored procedure

I would like to do a stored procedure that receive an input param and then

  • if targeted table does not contains that value, a new row is created and then the id of the created row is returned
  • if targeted table already contain input param, the id of the row is returned

For moment I only manage to insert new row only if input param is new:

Do you know how to do this?

Advertisement

Answer

Seems to me like you want a stored function and not a procedure.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement