PostgreSQL
I have a selection criteria, based on parameters I know that for this particular item it needs to call public.dothisprocedure another one could be public.dothatprocedure. I have looked at the Execute, but the that seems to execute selects or update sql statements only. I guess I want kind of Call Execute Call myUri() but it’s trying to fire the myUri procedure which of course doesn’t exist. Is there something like Eval ?
Tried Execute, not what I am expecting Tried Call myUri but wrong target… if someone has a clue or can point me in the right direction I would be most greatful.. Thanks
for example in T-SQL it’s just if @uri is the target procedure…
EXEC @uri @dt_from = @que_from_utc, @dt_to = @que_to_utc;
but I can’t seem to find anyway to do that in postgre ( I know how to add the parameters..) just need to know how to EXEC @uri..
2
Answers
Figured it out simpler in the end
EXECUTE 'CALL ' || planUri || '();';
it was just the CALL inside the string that I was missing.
But what you have is similar also, think I prefer your option, very similar to what I am trying to do in fact
I have a temporary table which is filled by a list of calculations plans.
I iterate through the list, and check if there is a uri ( procedure ) for that plan. If there is , then I call the procedure, once processed its removed from the list.
Now that this piece is in place, obv simple enough to for Functions and passing parameters in, just happy that this piece is working . Thanks
I don’t sure, but I have example from of my projects, I have list of procedures in management table, and then I run them from other procedure one by one.