Home » SQL & PL/SQL » SQL & PL/SQL » Query PL/SQL Urgent
Query PL/SQL Urgent [message #684082] Fri, 02 April 2021 03:14 Go to next message
Vins82
Messages: 1
Registered: April 2021
Junior Member
Hello to all
i need help with a query in pl / sql
if someone can give me a suggestion, basically I should do a query in which having a table composed of two fields order_name, cashier_code and number_pallet in input from a form as shown in the example image
M1 001

M2 001
002

M3 002
003
As per attached image
Input M1 loads and validates M1, M2
Input M2 loads and valid M2
I should make a query if I insert M1 example I can accept the pallet_number only if the order_code exists both in M1 and M2 but not in M3 because the code 001 does not exist in M3 since it is not a primary key we do not know a priori for the next one pass which cash_code will go to take
and so on if I insert M2 the code linked to it 001.002 they are not both inside M1 and M3 I accept only M2 as shown in the image
Thanks for your availability
Re: Query PL/SQL Urgent [message #684083 is a reply to message #684082] Fri, 02 April 2021 03:56 Go to previous message
Michel Cadot
Messages: 67887
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Welcome to the forum.
Please read the OraFAQ Forum Guide and How to use [code] tags and make your code easier to read.
Indent the code, use code tags and align the columns in result.

Also always post your Oracle version, with 4 decimals (query v$version), as often solution depends on it.

With any SQL or PL/SQL question, please, post a working Test case: create table (including all constraints) and insert statements along with the result you want with these data then we will be able work with your table and data. Explain with words and sentences the rules that lead to this result.

Previous Topic: filtering for records based on select criteria
Next Topic: Oracle Sql statements
Goto Forum:
  


Current Time: Mon Jun 21 23:32:30 CDT 2021