Skip to content
Advertisement

List of Record type matching issue Oracle

I want to check if a workspace is not available in all_workspace table then create new workspace.
My requirement is if p_workspace is not matching the list of value of v_workspace then it should create new one.

It gives me error after creation.

If I run that workspace individually then its working. but when I am passing through block with checking availability then its not working.

Please help anyone.

Advertisement

Answer

Is there a reason that you need dynamic SQL, a collection, and a loop to iterate over the collection? It sounds like you just want to check whether the row exists which can be done with a simple count (you could make the check more efficient by writing it as a where exists but that’s probably not important here)

Of course, you could also just skip the check, call CreateWorkspace, and handle the exception when it already exists. If you expect that the vast majority of the time you’re going to create the workspace, that might be more efficient.

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