SQL & PL/SQL :: Calculates Value Of Product Sold
Nov 25, 2011
Stored Procedure: Receives the MFR and PRODUCT identifying the product sold as well as the Quantity purchased by the customer.
Calculates the value of the product sold (looks up the cost of the product in the products table and multiplies by the quantity sold)
Returns the calculated value.
View 12 Replies
ADVERTISEMENT
Nov 12, 2012
Problem 1: Write a procedure with no parameters. The procedure will let you know if the current day is a weekday or a weekend. Execute the procedure.this is what i have so far:
CREATE OR REPLACE PROCEDURE check_day
IS
current_day DATE;
BEGIN
[code][...
Problem 2: Write a procedure that calculates a factorial using a value provided by the user. Write an anonymous program unit that asks the user to enter a value and executes the procedure.
View 1 Replies
View Related
Mar 7, 2013
When to use Cartecian product???? is there any special cases to use cartecian product?
View 2 Replies
View Related
Jul 29, 2010
how to find the product of the values in the column.. assume that the column has number(2) as its data type..
as we use sum(colname) for the sum of the values in the column there s no function to find the product.
View 3 Replies
View Related
Dec 14, 2011
I am trying to query a Oracle database table that contains sample records like the one below...
DATE LOCN PROD1 PROD2
09/12/2011 L1 6 2
09/12/2011 L2 3 7
10/12/2011 L1 4 1
10/12/2011 L2 3 3
11/12/2011 L1 2 2
11/12/2011 L2 2 0
12/12/2011 L1 4 1
12/12/2011 L2 5 0
I am trying to use the Oracle Sum() to get a grouping by DATE, LOCATION, SUM(PROD1+PROD2) for DATE periods 10/12/2011 and 11/12/2011. Below is the desired end result.
DATE LOC1 LOC2
10/12/2011 5 6
11/12/2011 4 2
View 1 Replies
View Related
Sep 28, 2012
I am new to PL/SQL environment.. ( USING PL/SQL Oracle)
SELECT TABLE1.PRODUCTID, TABLE1.TYPE , TABLE1.PRODUCT, TABLE2.#SOLD
FROM TR.TABLE1
INNER JOIN
PR.TABLE2
ON (TR. PRODUCTID = PRODUCTID )
Query result.
Product ID Product Type #Sold
1 Fruit Banana 2
2 Food Rice 4
3 Food Sugar 6
4 Fruit Orange 2
5 Fruit Apple 10
6 Food Sugar 12
7 Food Corn 3
8 Fruit Apple 5
9 Fruit Banana 2
10 Food Sugar 1
11 Fruit Banana 5
12 Food Sugar 7
But would like to add Four More Column and group by by PRODUCT.Final Result will look like :
{Product} , {Type} , {#Sold} , 0 to 3 , 4 to 9 , >10 Total Sold
, {Corn} , 3 , , ,
, {Rice} , , 4 , ,
, {Sugar} , , , , 26
{Food} , , , , , 33
, {Apple} , , , , 15
, {Banana} , , , 9 ,
, {Orange} , , 2 , ,
{Fruit} , , , , , 36 }
View 9 Replies
View Related
Jun 24, 2011
Is there a way to find customers purchased only single product from the following table?
cusno Product Date
----- ------ ----
121 ES 03/12
121 NT 30/12
131 ST 03/12
13 WT 04/12
150 ES 05/12
150 ES 06/12
150 ES 07/12
160 MN 05/12
160 ES 06/12
160 ES 07/12
162 NT 08/12
I need a query to display only 150 and 162 as they have purchased only one product.
View 2 Replies
View Related
Feb 11, 2011
so here is the query : For every state, list the most popular product. Here is the query I have so far :
SELECT C.State, P.Product_Name, Count(*) cnt FROM Product P, Customer C, OrderTable O, LineItem L WHERE C.CID = O.CID AND O.OID = L.OID AND L.PID = P.PID GROUP BY C.State, P.Product_Name;
Result :
STATE PRODUCT_NAME COUNT(*)
---------- -------------------- ----------
New Jersey Computer 3
Texas Computer 1
New Jersey Speaker 2
I would need the result to only say New Jersey Computer and Texas Computer because I only want a list of the states with the product name that is sold the most in each state.All I need to do is have the query only select the product name with the max count for each state...
View 4 Replies
View Related
Jun 18, 2013
I have oracle10g installable in .rar format. I have unzipped it and started installer through setup.exe file, but in the secnd step itself it is asking product.xml file location , i searched entire installables but could not find any thing with such name, installing this oracle 10g on windows 2003 server.
View 12 Replies
View Related
Jan 13, 2011
I have the following tables: -
CREATE TABLEtest_articles
(idNUMBER(9),
code VARCHAR2(20),
description VARCHAR2(40),
uom_group_id NUMBER(9),
in_exchange NUMBER(1) DEFAULT 0);
[code]....
However, I'd also like it to return any product that doesn't have a TEST_UOM_GROUP, for example the 'Bud'.I've hit a brick wall and just keep going around in circles and not acheiving the result I'm after!how to either change the SQL Query.
View 22 Replies
View Related
Jun 19, 2012
Bulk of Microsoft Application is running on windows server 2003 (OS) , is it possible to run parallel an oracle application on the same server .
View 4 Replies
View Related
Apr 30, 2010
I have table in Oracle with one column PRODUCT. Column PRODUCT have following values -
Account Management
Active Directory
Adobe Acrobat Reader
NT Account
Application Security
[code]....
I am designing application where I need to search for PRODUCT based upon user's input. Lets say user wants search on 'Laptop Account Broken'. I want to search for all products which contains any of words in user's input. So based upon user's input I want output like below.
Expected Output:
Account Management
NT Account
WebSite Account
HP Laptop
View 2 Replies
View Related
Jan 20, 2010
I have just migrated my database from oracle7 to Oracle9i. My application is still on forms 4.5 and reports 2.5.
i am having a problem after the migration. I am able to run my forms, but i cannot run my reports from my form (button). i am having the error : "frm-41211 integration error: SSL failure running another product". I want to mention that i am able to run the report from the report builder.
View 6 Replies
View Related
May 22, 2013
Oracle version: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit
OS: Linux Fedora Core 17 (x86_64)
I was practicing on Recursive Subquery Factoring based on oracle examples available in the documentation URL....I was working on an example which prints the hierarchy of each manager with his/her related employees. Here is how I proceed.
WITH tmptab(empId, mgrId, lvl) AS
(
SELECT employee_id, manager_id, 0 lvl
FROM employees
WHERE manager_id IS NULL
UNION ALL
SELECT employee_id, manager_id, lvl+1
FROM employees, tmptab
WHERE (manager_id = empId)
[code]....
107 rows selected.
SQL> However, by accident, I noticed that if instead of putting a comma between the table names I put CROSS JOIN, the very same query behaves differently.That is, if instead of writing
UNION ALL
SELECT employee_id, manager_id, lvl+1
FROM employees, tmptab
WHERE (manager_id = empId)I write
. . .
UNION ALL
SELECT employee_id, manager_id, lvl+1
FROM employees CROSS JOIN tmptab
WHERE (manager_id = empId)I get the following error message
ERROR at line 4: ORA-32044: cycle detected while executing recursive WITH query
I remember, oracle supports both comme notation and CROSS JOIN for Cartesian product (= cross product). For example
SQL> WITH tmptab1 AS
2 (
3 SELECT 'a1' AS colval FROM DUAL UNION ALL
4 SELECT 'a2' AS colval FROM DUAL UNION ALL
5 SELECT 'a3' AS colval FROM DUAL
6 ),
[code]....
SQL> So if both comma notated and CROSS JOIN have the same semantic, why I get a cycle for the above mentioned recursive subquery factoring whereas the very same query works pretty well with comma between the table names instead of CROSS JOIN? Because if a cycle is detected (ancestor = current element) this means that the product with CROSS JOIN notation is generating some duplicates which are absent in the result of the comma notated Cartesian product.
View 9 Replies
View Related
Feb 5, 2013
I have a form with a button for "Print Report " when I click button following error occurred :
FRM-41211 :integration error : SSL failure running another product
View 1 Replies
View Related
Sep 14, 2011
"Integration error: SSL failure running another product" with HP Deskjet D2680.We are using 10gR2, Forms6i, and Report6i. The server is Windows 2003 Server, and the OS of the printer is XPIn one of our module, upon calling one report we always encounter Integration error: SSL failure running another product. Sometimes when we do not encounter it, the spooling takes too much time and it takes 6minutes just to print the first page of the report, succeeding pages takes 2-3minutes in interval.
At first we thought that the memory of the PC is the problem, but we tried to connect it to a 2gig RAM Win7 laptop, another laptop with 1gig RAM XP, and a 1g RAM Desktop. We tested 5 computers but the same problem occurs.
The problem is not encountered after we tried other HP Printer(HP 3940, 6988, & D4360). I just want to know the problem with the HP Deskjet D2680.
View 2 Replies
View Related
Apr 18, 2010
in oracle instalation when Product-Specific Prerequisite Checks window appears it show me theres a warning with checking network configration as shown in pic.theres a sites says that its not necessary to make it succeeded and its ok to leave it. should i leave this warning or it should be succeeded?
View 9 Replies
View Related
Dec 17, 2010
I have got 2 users as user1 and user2.I have used the following statements from user 'user1':
create role GENEVAOBJECTS;
grant select, insert, update, delete on PRODUCT to GENEVAOBJECTS;
grant GENEVAOBJECTS to user2;
In the above statements, product is a table. Now, I could able to access this table from user 'user2'. But however if I write a procedure in user2 schema accessing the table product, then the procedure is not getting compiled.
create or replace procedure test_prc as
v_test number(9);
begin
select product_id into v_test
from PRODUCT where rownum=1;
[code]...
why I cannot access that table from procedure?
View 8 Replies
View Related
Apr 24, 2012
I have a sale invoice form with 3 data blocks.
Data block 1- master_blk : For date/customer of sale invoice
Data block 2- detail_blk1 (detail of the master block - For products and qty)
Data block 3- detail_blk2 (detail of DETAIL_BLK1 For entering serial numbers of products)
My requirement is that whatever quantity user enter in data block 2 against each product he must enter equal number of serial numbers of that product in data block 3.
For this I have created on item (cnt_iteml : to count product's serial numbers in block3 ) in data block 2, and on summary item (t_serial_no ) in block3.
Whenever user changes in quantity, cnt_iteml: item is populated with t_serial_no in block3 of that product by following trigger on quantity column.
POST-Change Trigger ( quantity column )
:stock_transactions.cnt_itl:=:serial_numbers.t_serial_no;
Following trigger is written on block level at data block-3 to populate cnt_iteml with t_serial_no.
PRE-RECORD
IF GET_BLOCK_PROPERTY('SERIAL_NUMBERS',STATUS) IN ('CHANGED') THEN
:stock_transactions.cnt_itl:=:serial_numbers.t_serial_no;
END IF;
Above triggers are fulfilling my requirement except following condition.
If user after entering serial numbers in block 3 and without saving goes back to block2 and try to navigate to another record he gets a message asking him to save changes by forms. At this time if user presses no then cnt_itl item is not been populated with t_serial_no item's value.
What I want in above condition is that if user was inserting new record cnt_it item should be populated with 0, so that he shouldn't be able to save this record. And If he was updating then cnt_itl item should be populated with actual no of records in database against that product.
View 2 Replies
View Related
Apr 25, 2011
There is a requirement in my database that I want to restrict the user from directly running queries on database from third party tools such as pl/sql developer and toad.
There is a utility in SQL product_user_profile through which this can be done but it is only restricted if you run the query through sql plus. If I want to restrict and (give suppose select,insert) to a user for directly running queries through PL/SQL.
View 1 Replies
View Related
Dec 14, 2011
Im trying to list the products list of a client grouped by type of the product. Ex:
product type
prod.A acid
prod.B flavour
prod.C acid
prod.D cleaner
prod.E flavour
I want to list something as:
Acid
Prod.A
Prod.C
Cleaner
prod.D
Flavour
prod.B
prod.E
View 1 Replies
View Related
Dec 7, 2011
I'm trying to write a procedure that displays customerID, customer name, product name, and the total quantity of products the customer purchased, and the total amount the customer paid.Here's the relevant Schema tables:
CREATE TABLE Product (
Product_ID NUMBER(6) NOT NULL,
Description VARCHAR2(30),
Product_Code CHAR(4));
[code]....
Now I'm trying to wrap the above query in procedure code. I believe that I need a cursor, but I don't know what kind of cursor variable to store the result of the SELECT statement in because the query selects columns from several different tables, and I'm not sure how to terminate the FOR loop (but I think probably I can use the EXIT WHEN cursor%NOTFOUND;Here's the procedure code I have written thus far:
CREATE OR REPLACE PROCEDURE find_customer_statistics IS
DECLARE
TYPE cust_stats IS REF CURSOR; weak ref cursor declaration
SELECT sales_order.customer_id, customer.name, product.description, SUM(line_item.quantity),
SUM(line_item.subtotal)
FROM sales_order, customer, product, line_item
WHERE customer.customer_id = sales_order.customer_id
AND line_item.order_id = sales_order.order_id
[code]....
View 7 Replies
View Related