Data Fabrication is my question.

Page 1 of 1

1 Replies - 505 Views - Last Post: 01 June 2012 - 04:47 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:35 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
  • +

Replies To: Data Fabrication is my question.

#2 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 8964
  • View blog
  • Posts: 33,624
  • Joined: 12-June 08

Re: Data Fabrication is my question.

Posted 01 June 2012 - 04:47 PM

Please do not create duplicate topics. Thanks.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1