Skip to content

Tag: plsql

Oracle PL/SQL Functions: “Invalid Datatype”

The following function checks to see if a zip code is present in a table called ZIPCODE: The schema for the ZIPCODE table is as follows: To test this function, I issued the following statement which should return false as the zip code passed as an argument is present in the ZIPCODE table: However, I receive t…

How to store multiple rows in a variable in pl/sql function?

I’m writing a pl/sql function. I need to select multiple rows from select statement: if i use: it only stores one value, but i need to store all values that this select returns. Given that this is a function i can’t just use simple select because i get error, “INTO – is expected.&#8221…

How do I group “or” in pl/sql

I have legacy sql query that selects bit masks (among other data), something like: How do I group this output like: That should be 3 Answer In order to do bit-wise logic you have to do a “bit” of math. (Bad puns are free around here :-). Oracle defines the BITAND function. To get a bitwise ‘…

PL/SQL: procedure to process a comparison between two tables

This is an example what i need : Table 1 : Table 2: A procedure that feeds a table3 as a result of comparison between the table 1 and table 2 Table 3: Please, i need help if someone had the same challenge 🙂 Answer Data setup: The below query would give you the differences

How to automate source control with Oracle database

I work in an Oracle instance that has hundreds of schemas and multiple developers. We have a development instance where developers can integrate their work before test or production. We want to have source control for all the DDL run in this integrated development database. Currently this is done through a pr…