Knowee
Questions
Features
Study Tools

Create a procedure named 'findAmount' which takes 2 input parameters namely, personName is type of varchar2, entryTime is type of timestamp and 1 output parameter namely, travelAmount double precision. This procedure should find the amount for the travel_payment made by the person on time whose personName and  entryTime  is passed as an input paramter.Hints:Procedure name : findAmountParameters : personName(varchar2),entryTime(timestamp),travelAmount(double precision)Submit

Question

Create a procedure named 'findAmount' which takes 2 input parameters namely, personName is type of varchar2, entryTime is type of timestamp and 1 output parameter namely, travelAmount double precision. This procedure should find the amount for the travel_payment made by the person on time whose personName and  entryTime  is passed as an input paramter.Hints:Procedure name : findAmountParameters : personName(varchar2),entryTime(timestamp),travelAmount(double precision)Submit

...expand
🧐 Not the exact question you are looking for?Go ask a question

Solution

It seems like you're asking for a procedure in SQL. Here's a basic structure of how you might define this procedure:

CREATE OR REPLACE PROCEDURE findAmount (
  personName IN VARCHAR2,
  entryTime IN TIMESTAMP,
  travelAmount OUT NUMBER
) AS 
BEGIN
  SELECT travel_payment
  INTO travelAmount
  FROM your_table_name
  WHERE name = personName AND time = entryTime;
EXCEPTION
  WHEN NO_DATA_FOUND THEN
    travelAmount := NULL;
END findAmount;

Please replace your_table_name with the actual name of your table. This procedure will find the travel_payment made by the person with the given personName and entryTime and assign it to the travelAmount output parameter. If no such payment is found, travelAmount will be set to NULL.

This problem has been solved

Similar Questions

Write a query to display  the sum of amount from the travel_payment table. Give an alias name as total_payment.Note:1. Display only the sum of amount from the travel_payment table.2. Specify the alias name without any mistake.3. Compare your executed result with the sample output given below.

Write a query to display the travel_card_id, entry_station_id and sum of amount received between the entry_time dates 21-Dec-2017 and 23-Dec-2017. Give an alias name as total_payment. Display the records sorted in ascending order based on the travel_card_id.

Write a query to display details of the travel_payment whose amount is greater than 30. Display the records in ascending order based on the entry_time.Note:1. Display all the columns present in the travel_payment table.2. Specify the condition and retrieve the correct rows in the result(condition need to be specified on amount column).3. You can compare your executed result with the sample output given below.4. Order by is mandatory

Display only the travel_card_id, entry_station_id and sum of amount received between the given entry_time dates from travel_payment table.2. entry_time field is of datatype TIMESTAMP. So the values of entry_time will have both date and time. So here you have truncate the date part alone from the entry_time and then check for the date condition.3. Specify the alias name without any mistake.4. Order by is mandatory5. Compare your executed result with the sample output given below.

QQ8Write a query to display the travel_card_id, entry_station_id and sum of amount received between the entry_time dates 21-Dec-2017 and 23-Dec-2017. Give an alias name as total_payment. Display the records sorted in ascending order based on the travel_card_id.Note:1. Display only the travel_card_id, entry_station_id and sum of amount received between the given entry_time dates from travel_payment table.2. entry_time field is of datatype TIMESTAMP. So the values of entry_time will have both date and time. So here you have truncate the date part alone from the entry_time and then check for the date condition.3. Specify the alias name without any mistake.4. Order by is mandatory5. Compare your executed result with the sample output given below.

1/1

Upgrade your grade with Knowee

Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.