ORACLE

-- long 타입을 clob 타입으로 변경후 자가 복제

 

long 타입문제인지.

table1 자체에 에러가 발생

table 1  과 똑같은 table2 를 만들어서 table2 는 clob 만들었다.

table1 도 long 에서 clob 으로 변경  table1 을 table2  로 복사

 

 

DECLARE
BEGIN
   DECLARE
      CURSOR CURSOR_NAME
      IS
         SELECT

PRODUCT_ID, PRODUCT_NAME, PRICE, DESCRIPTION, PICTURE_URL, REGDATE, AMOUNT, PRODUCT_STATE, BIG_DESCRIPTION,
                CATEGORY_IDX, CATEGORY_BNO, CATEGORY_RNO, DELIVER, DELIVER_MONEY, UPDATEDATE,VIEW_COUNT
         

 FROM product2;
 

 

 BEGIN
      FOR I IN CURSOR_NAME
      LOOP
         INSERT INTO

product2

(

PRODUCT_ID, PRODUCT_NAME, PRICE, DESCRIPTION, PICTURE_URL, REGDATE, AMOUNT, PRODUCT_STATE, BIG_DESCRIPTION,
                CATEGORY_IDX, CATEGORY_BNO, CATEGORY_RNO, DELIVER, DELIVER_MONEY, UPDATEDATE,VIEW_COUNT
                )
              VALUES (

seq_product.NEXTVAL,  I.PRODUCT_NAME, I.PRICE,  I.DESCRIPTION,  I.PICTURE_URL,   I.REGDATE,
                     
                      I.AMOUNT,  I.PRODUCT_STATE, I.BIG_DESCRIPTION,  I.CATEGORY_IDX, I.CATEGORY_BNO,
                      I.CATEGORY_RNO,   I.DELIVER,I.DELIVER_MONEY,  I.UPDATEDATE,
                       I.VIEW_COUNT

);
         
      END LOOP;
   END;
END;

 

 

DECLARE
BEGIN
   DECLARE
      CURSOR CURSOR_NAME
      IS
         SELECT 

PRODUCT_ID, PRODUCT_NAME, PRICE, DESCRIPTION, PICTURE_URL, REGDATE, AMOUNT, PRODUCT_STATE, BIG_DESCRIPTION,
                CATEGORY_IDX, CATEGORY_BNO, CATEGORY_RNO, DELIVER, DELIVER_MONEY, UPDATEDATE,VIEW_COUNT
          

 FROM product2;
 



 BEGIN
      FOR I IN CURSOR_NAME
      LOOP
         INSERT INTO

product2

(

PRODUCT_ID, PRODUCT_NAME, PRICE, DESCRIPTION, PICTURE_URL, REGDATE, AMOUNT, PRODUCT_STATE, BIG_DESCRIPTION,
                CATEGORY_IDX, CATEGORY_BNO, CATEGORY_RNO, DELIVER, DELIVER_MONEY, UPDATEDATE,VIEW_COUNT
                )
              VALUES (

seq_product.NEXTVAL,  I.PRODUCT_NAME, I.PRICE,  I.DESCRIPTION,  I.PICTURE_URL,   I.REGDATE,
                     
                      I.AMOUNT,  I.PRODUCT_STATE, I.BIG_DESCRIPTION,  I.CATEGORY_IDX, I.CATEGORY_BNO,
                      I.CATEGORY_RNO,   I.DELIVER,I.DELIVER_MONEY,  I.UPDATEDATE,
                       I.VIEW_COUNT

);
         
      END LOOP;
   END;
END;

 

oracle

 

about author

PHRASE

Level 60  머나먼나라

일각이 삼추(三秋) 같다 , 일각이 삼 년의 세월같이 여겨진다는 뜻으로, 기다리는 마음이 매우 간절함을 이르는 말.

댓글 ( 4)

댓글 남기기

작성

ORACLE 목록    more