0 Replies - 521 Views - Last Post: 01 June 2012 - 04:36 PM Rate Topic: -----

#1 code_firebug  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 01-June 12

Data Fabrication is my question.

Posted 01 June 2012 - 04:36 PM

I have created this code that inserts 24 rows into my PRICE table, i need it to understand how to fabricate the table in other to insert up to 135 rows in a single INSERT statement. I'll be really happy if anyone can help.

SELECT price_s1.NEXTVAL, i.item_id,
	        (
	            SELECT cl.common_lookup_id
	                FROM  common_lookup cl
	                WHERE cl.common_lookup_type = '5-DAY-RENTAL'
	        ),
	        'N',
	        CASE
	            WHEN (TRUNC(SYSDATE) - TRUNC(i.item_release_date)) > 30 THEN i.item_release_date
	            ELSE i.item_release_date 
	        END,
	        (
	            SELECT   p.start_date
	            FROM price p
	            WHERE p.end_date = p.start_date + 30
	        ),
	        (
	            SELECT
	                    CASE
	                        WHEN (TRUNC(SYSDATE) - TRUNC(i.item_release_date)) > 30 THEN 5
	                        ELSE TO_NUMBER(cl.common_lookup_code)
	                    END
	                FROM   common_lookup cl
	                WHERE   cl.common_lookup_type = '5-DAY-RENTAL'
	        ),
	        1, TRUNC(SYSDATE),1,TRUNC(SYSDATE)
	    FROM item i;


Is This A Good Question/Topic? 0
  • +

Page 1 of 1