I have a table People, having people_id,people_name,people_lastname. I am facing difficulties creating a pl/sql function to display all the rows of that table. I have done this much so far Answer One option is to return refcursor:
Tag: oracle
Too many open connections on sending Email
I’m trying to send email to every users from DB. I use a loop to get the message text per user as I loop need to call the send_email. But I got an error saying: ORA-30678: too many open connections …
Oracle SQL merge tables side by side
I have 3 select queries which i would like to merge side by side. The common column is name. I dont want to use UNION ALL solutions since my select queries might have many columns. name columna e1 1 name columnb h1 2 name columnc t1 3 The output i am looking for is: name columna columnb columnc e1 1
Select count on Oracle Query based on distinct condition
I am newbie with oracle pl/sql, right now using oracle sqldeveloper, i need help for my homework, how to make the column number 2, 3, 4, 5, 6, … count based on first value column, the DISTINCT OWNER ? can anyone help me? or suggest me with some hint? this is wrong, i need the count n other column based
Transpose in ORACLE SQL (Convert 6 columns into 3 Columns)
I’ve an output like the below. I want that to be converted into the below Where ID is the count of TOTAL, HIGH, SENT, WAITING, DATE. I have been contemplating for a while and couldn’t get what I want. Can any one please help in ORACLE SQL? Thanks in advance. Answer Here’s one option:
Oracle SQL/PLSQL: Hierarchical recursive query
I have asked very similar questions before but still haven’t achieved the correct result… third times the charm but I now have a stable parent-child relationship to work with. Every row in the multi-level data set has a cost. For a specific row I need to find the lowest level and roll-up the cost.…
How do I split column into 2 based on certain conditions in Oracle SQL?
I have a table of 250k worth of data and out of this data I have 1000 rows that have the same data in every column bar one reference column which is different. What I would like to do is split the reference column if certain conditions are met, and if these conditions are not met, the reference value can
Choose one value from several columns and create a new column with the chosen value in Oracle SQL Developer
I am trying to build a SQL query where I create a new column that contains a chosen value form several columns. The rows of the columns are all null except one which is the desired value to put in the new column. An example could be as the following: Thank you! Answer As promptly commented by jarlh, you can
Using Oracle SQL to join duplicate counts to an existing subquery
I have been asked to build a query that runs quality checks for data on a certain state test. I have the following query that creates a variable named ‘Flag’ to identify cases where there are issues. The main query is really in a subquery, and I filter out all records where there isn’t a fla…
IS NULL in CASE in predicates
tell me pls, that’s real – use the CASE construct, where the expression with IS NULL/IS NOT NULL will be returned in TNEN? I have a procedure in a package that receives an input parameter and it is …