Advertisement

03.18.2008 at 02:17PM PDT, ID: 23251841
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.0

Need help to make my first PLSQL block

Asked by myebay in PL / SQL, Oracle Database, SQL Query Syntax

Tags:

Hello,

I need your help to make a pl sql block to update 2 fields of my table (Order_id and item_id).

I need to use at least cursor, loop and update.

I have the following data:

PREVIOUS:

  ORDER_ID    ITEM_ID CUSTOMER_ID PRODUCT_ID ACTUAL_PRICE   QUANTITY      TOTAL ORDER_DAT SHIP_DATE OLD_SYS_REF
---------- ---------- ----------- ---------- ------------ ---------- ---------- --------- --------- -----------------------

      3997          1         222     100860                      12            08-OCT-00 20-MAR-01 TX-75205-JB:3997-1
      3997          2         222     100860                       7            08-OCT-00 20-MAR-01 TX-75205-JB:3997-2
      4244          3         222     100890                       5            08-OCT-00 20-MAR-01 CA-97544-JT:4244-3
      4244          2         222     100870                     500            08-OCT-00 20-MAR-01 CA-97544-JT:4244-2
      4244          1         222     100861                     100            08-OCT-00 20-MAR-01 CA-97544-JT:4244-1
      4260          2         222     100870                     500            20-MAR-01 25-MAR-01 CA-97544-JT:4244-2
      4260          1         222     100861                     100            20-MAR-01 25-MAR-01 CA-97544-JT:4244-1


I need the maximum id of an existing table to start the new order_id->
select max(order_id) from sales_order;

MAX(ORDER_ID)
-------------
          621



I need to change the order_id, I will give the same order_id for all the order_id for the same customer_id with the same
order_date and Ship_date.
I need at final to have to data in the good chronological order for the order_date.

After:
  ORDER_ID    ITEM_ID CUSTOMER_ID PRODUCT_ID ACTUAL_PRICE   QUANTITY      TOTAL ORDER_DAT SHIP_DATE OLD_SYS_REF
---------- ---------- ----------- ---------- ------------ ---------- ---------- --------- --------- -----------------------

      622          1         222     100860                      12            08-OCT-00 20-MAR-01 TX-75205-JB:3997-1
      622           2         222     100860                       7            08-OCT-00 20-MAR-01 TX-75205-JB:3997-2
      622           3         222     100890                       5            08-OCT-00 20-MAR-01 CA-97544-JT:4244-3
      622           4         222     100870                     500            08-OCT-00 20-MAR-01 CA-97544-JT:4244-2
      622           5         222     100861                     100            08-OCT-00 20-MAR-01 CA-97544-JT:4244-1
      623           1         222     100870                     500            20-MAR-01 25-MAR-01 CA-97544-JT:4244-2
      623           2         222     100861                     100            20-MAR-01 25-MAR-01 CA-97544-JT:4244-1

For all the same order_id, I'll same the item_id from 1 to 3 if there is 3 items,....


I really don't know how to process and I need to have finish it tomorrow :(
Start Free Trial
[+][-]03.18.2008 at 10:57PM PDT, ID: 21158822

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.18.2008 at 11:00PM PDT, ID: 21158837

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.18.2008 at 11:01PM PDT, ID: 21158841

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.18.2008 at 11:45PM PDT, ID: 21158975

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.19.2008 at 12:14AM PDT, ID: 21159086

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.19.2008 at 03:44AM PDT, ID: 21159888

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.19.2008 at 05:50AM PDT, ID: 21160916

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.19.2008 at 06:34AM PDT, ID: 21161319

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.19.2008 at 06:39AM PDT, ID: 21161374

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.19.2008 at 06:54AM PDT, ID: 21161525

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.19.2008 at 06:59AM PDT, ID: 21161567

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.19.2008 at 07:17AM PDT, ID: 21161788

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.19.2008 at 07:27AM PDT, ID: 21161881

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.19.2008 at 08:49AM PDT, ID: 21162713

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.19.2008 at 09:14AM PDT, ID: 21162945

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: PL / SQL, Oracle Database, SQL Query Syntax
Tags: oracle pl sql
Sign Up Now!
Solution Provided By: sdstuber
Participating Experts: 2
Solution Grade: A
 
 
[+][-]03.19.2008 at 10:21AM PDT, ID: 21163618

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-44 / EE_QW_2_20070628