Is it possible to execute a view with a stored procedure? My procedure should first run the views (I have 2 in total) and then am combining these 2 views data into a different table for applying transformations. Something like this: Answer What do you call “execute a view with stored procedure”? How are views “triggered”? If you meant to
Tag: plsql
How to search for a month that is input by the user
I am working on some homework and have been stuck on this for a week. I have tried using TO_CHAR, MONTH(search), and EXTRACT(MONTH from…) and they all end up with either identifier ‘JAN'(the month I am searching for) is not declared, or expression is of the wrong type. This assignment is to display all the rows for pledges made in
Creating a trigger with SELECT Function
Good day everyone, I’m having trouble making my trigger work. As far as the functionality of the body and how it behaves, it does exactly as I intended for it to behave. However, when I start to fire the trigger, it returns an error in which Triggers should not have a SELECT statement from inside the main body. I’m still
Extracting multiple values from BLOB as XML
I have an XML like this in a BLOB column: As you can see the year can be either in the event level or at country level. There can be multiple events and multiple countries per event. This whole XML is stored in a BLOB column in Oracle. I need to extract the value of the year or better check
Sum whole column plus a single row of another column and display in a third column
here is my problem i do have a query the returns to me this table what i need is to sum all the organic_value where the previa is the same + financial_value of each month so the final table would be any tips how to tackle this problem? Answer That’s a window sum:
passing sys_refcursor from function to sys_refcursor out parameter in procedure
I have problem with outputting results from the sys_refcursor returned from the function stored in the variable crs_scenarios. I then want to pass this collection of data to the output parameter pout_result. I get the error PLS-00487: Invalid reference to variable ‘POUT_RESULT’. Can you advise me please, how to solve this issue? Thanks a lot! Answer Sys_refcursor is only a
Sum up all values from a list PLSQL
I want to sum up all values from a INDEX BY TABLE list. In the list there are values like this: 24000, 4500, 7890 and so on. This is the code: Answer Lets assume that you have an associated array and you want to sum up the values within it. And, lets also assume that the associative array’s index is
subquery calculate days between dates
Sub query, SQL, Oracle I’m new to sub queries and hoping to get some assistance. My thought was the sub query would run first and then the outer query would execute based on the sub query filter of trans_code = ‘ABC’. The query works but it pulls all dates from all transaction codes, trans_code ‘ABC’ and ‘DEF’ ect. The end
Reading BLOB column in oracle table
I have a table tbl which has below columns: When I run below query it works fine: But when I run below it throws error: I mean to say, if I select only 1 blob column to read , then date filter works fine. But when I select both BLOB columns with date filter in where clause, it throws below
Add value of type B to type A of same org_id
I have a table like this Now I want to select values from this table for each org_id, type but for type A i want to add value of type B of same org_id to type A. My query should return this In this case, when ORG_ID is 1 and TYPE is ‘A’, I have to add that organization’s type