Hello I want to ask what is the best practise to do. First example try to retrieve my data through exceptions I use this code in my main application and is working fine but I dont know if its good practise to code inside the exceptions blocks SECOND EXAMPLE TRY TO RETRIEVE DATA WITH CASES AND SELECT WITH COUNT. Answer
Tag: plsql
Returning values from 2 select statements in Oracle Procedure
Homework question that I’m stuck on. I need to create a Procedure called dept_info with a department id as the IN parameter with department name and full name (concat of first and last name) of the manager of that department as the OUT parameters to be passed back to the invoking program. the procedure should be within the PL SQL
Using declared variables in SQL Oracle query FOR LOOP
I’m attempting to write a query script where I declare a variable and then use them in a select statement in Oracle SQL. Basically script should check if parent tables’ entries are used in referenced table or not. if not –> delete the entry from REF table. So far I have this So far LOG_MSG(‘Parent table: ‘ || tableName.table_name ||
how to fetch email address from oracle database
Hi All i am trying to fetch certain email patterns from oracle db 11g i have used the below queries Unfortunately i have to scan through the complete schemas in order to fetch the value (@pqr.de) where ever it exists in which ever column and table it is residing , ideally this activity is to list out inactive email addresses
Populating rows in table with previous row value oracle sql
Here above the data is grouped by person then their duties are listed : I need a way to get the data to look like this using oracle sql : having a bit of trouble iterating over every row… dont mind if its plsql – sql prefered tho Tried a few things… but it goes back to null after the
Oracle XMLTYPE extract root prolog value
I have sample Query with XML like below: Output: I am trying to fetch the values below within the query or a new query: Is there any way to do that? Any help / direction appreciated. Answer You just have to complete your first XMLTABLE query (h) in this way:
How to Loop department names
Oracle SQL Developer I want to Loop department id and department names starting from dep_id = 10 and till 50th department. Departments are increasing by 10, so, there are 5 departments from 10 to 50. Here’s my code And here is the output, But as you can see the Administration row is repeating itself. The output should be like this
PL/SQL Dynamic SQL : Table name not valid
I’m currently learning PL/SQL. I need to create a PL/SQL block to create a backup of all my tables like this : myTable -> myTable_old. Here’s what I got right now : DECLARE Cursor c IS SELECT …
Loop through JSON array in PLSQL 12.1
I have JSON array inside varchar DECLARE JsonArray varchar2(1000); arrayCars varchar2(1000); BEGIN JsonArray :={“Cars”: [{“name”:”Honda”, “color”:&…
Error(8,1): PLS-00103: Encountered the symbol “SET”
I’m trying to create a function using oracle, it should be working fine but i keep getting the following error: Error(8,1): PLS-00103: Encountered the symbol “SET” here is my Function: Answer The problem is where do you put this command: SET SERVEROUT ON; cause its inside the function declaration. You should try to take it outside the function: