DB2020. 5. 21. 10:27

merge into 테이블명

       using dual

                  on ( deptcd = '1000'

                   and seqno = 1

                 ) -- pk값에 대한 정보

       when matched then

               update

                    set  deptnm = 'A부서'

 

       when not matched then

               inesrt (

                         deptcd

                       , seqno

                       , deptnm

              ) values (

                        '1000'

                       , 1

                       , 'A부서'

              )

 

데이터가 있는지 여부를 체크해서 없을경우에는 insert를 하고

데이터가 있을 경우에는 update를 해야하는 경우가 많을때 사용한다.

 

                         

                                

                                

'DB' 카테고리의 다른 글

text index, contains  (0) 2020.05.21
오라클 instr, substr을 이용한 특정문자열 자르기.  (0) 2020.05.21
두 날짜 시간의 차 구하기..  (0) 2013.07.30
오라클 Outer 조인시 주의점.  (0) 2013.07.09
Posted by 달려라곰간지
Javascript2013. 12. 10. 16:56

     obj_chart.ClearChart();  // 차트 초기화
     obj_chart.Header.Visible = true;      // Graph Header 정보 사용 여부
     obj_chart.Legend.Visible = true;


     obj_chart.Header.Font.Color = 0x000000;  // 차트 헤더 색깔.
     obj_chart.Header.Font.Size = 15;           // 차트 헤더 font size
     
     obj_chart.Legend.CheckBoxes = true;    //범례 series별 check여부(보였다 안보였다 하는 기능)
     obj_chart.Legend.Alignment = 0;            
     
     obj_chart.Panel.MarginTop = 15           //차트 위족 여백
     obj_chart.Panel.MarginLeft = 15;          // 차트 좌측 여백
     obj_chart.Panel.MarginRight = 0;        // 차트 우측여백
     obj_chart.Panel.MarginBottom = -1;    // 차트 하단여백
     obj_chart.Panel.BevelWidth = 0;        // 주위 테두리 넓이 0으로 설정

     obj_chart.Aspect.View3D  = false;      // 2d 로 표현하기

     obj_chart.Zoom.Enable    = false;        // zoom 사용하지 않기 (마우스 하단으로 드래그 zoomin, 마우스 상단으로 드래그 zoomout)
     obj_chart.Scroll.Enable   = false;      // scroll 사용하지 않기
     obj_chart.Legend.Visible  = true;     // 그래프 참조 박스 띄우지 않기(범례) 우측상단


     obj_chart.Legend.CustomPosition = true; // 범례 custom 위치 지정사용여부.
     obj_chart.Legend.Left = 10;                   // 범례 위치(좌측여백 10)
     obj_chart.Legend.Top  = 0;                   // 범례 위치(우측여백 0)

//      obj_chart.Panel.Gradient.Visible = true;      // 페널에 그라디언트 적용 ( 화면 바탕색 그라디언트)
//      obj_chart.Panel.Gradient.StartColor = 0x000000;  // 그라디언트 시작색깔
//      obj_chart.Panel.Gradient.EndColor = 0x404040;   // 그라디언트 종료색깔
     obj_chart.Environment.MouseWheelScroll = true;   // Graph 마우스 휠 사용 여부 (휠로 y좌표 이동 할건지 여부.)
     
     obj_chart.Axis.Bottom.Labels.Font.Size = 8; //하단축 Label 폰트 사이즈 조절
     obj_chart.Axis.Bottom.Labels.Font.Color = 0xffffff; //하단축 Label 폰트 사이즈 조절
//     obj_chart.Axis.Left.Labels.Font.Color = 0xffffff; //하단축 Label 폰트 사이즈 조절
//     obj_chart.Axis.Left.Labels.Font.Size = 8; //하단축 Label 폰트 사이즈 조절
//     obj_chart.Axis.Left.Labels.Font.Color = 0xffffff; //하단축 Label 폰트 사이즈 조절
//     
     obj_chart.Axis.Left.TicksInner.visible = true; //하단축 눈금 안쪽 표시 설정
     obj_chart.Axis.Bottom.TicksInner.visible = true; //하단축 눈금 안쪽 표시 설정

//     
     obj_chart.Axis.Visible = true;  // 왼쪽에 축..
     
     obj_chart.Axis.Left.Automatic = false;    //하단축 자동 설정(기본값)
     obj_chart.Axis.Left.Labels.Visible = true;   //하단축 Label 설정
     obj_chart.Axis.Left.Labels.multiline = true; //하단축 Label 2줄 설정
     obj_chart.Axis.Left.Labels.Font.Size = 1; //하단축 Label 폰트 사이즈 조절

     //obj_chart.Axis.Bottom.SetMinMax (0, 24);  //하단축 최소, 최대 길이 설정
     obj_chart.Axis.Left.Minimum = -1;
     obj_chart.Axis.Left.Maximum = 16;
     obj_chart.Axis.Left.Increment = 2;    //하단축 증가값 설정
     obj_chart.Axis.Left.MinorTickCount = 0;  //하단축 눈금 갯수 설정
     obj_chart.Axis.Left.TicksInner.visible = true; //하단축 눈금 안쪽 표시 설정
     
     obj_chart.Axis.Bottom.Automatic = false;    //하단축 자동 설정(기본값)
     obj_chart.Axis.Bottom.Labels.Visible = true;   //하단축 Label 설정
     obj_chart.Axis.Bottom.Labels.multiline = true; //하단축 Label 2줄 설정
     obj_chart.Axis.Bottom.Labels.Font.Size = 1; //하단축 Label 폰트 사이즈 조절

     //obj_chart.Axis.Bottom.SetMinMax (0, 24);  //하단축 최소, 최대 길이 설정
     obj_chart.Axis.Bottom.Minimum = 0;
     obj_chart.Axis.Bottom.Maximum = 10;
     obj_chart.Axis.Bottom.Increment = 1;    //하단축 증가값 설정
     obj_chart.Axis.Bottom.MinorTickCount = 0;  //하단축 눈금 갯수 설정
     obj_chart.Axis.Bottom.TicksInner.visible = true; //하단축 눈금 안쪽 표시 설정

for(var i = grd_list.fixedRows; i < grd_list.rows; i++) {
      flag = grd_list.valueMatrix(i, grd_list.colRef("flag"));
      title = grd_list.valueMatrix(i, grd_list.colRef("obspartnm"));
      
      if(flag == "1") {
//        grd_list.rowStyle(i, "all", "background-color") = "#bdddff"
       
      } else {
//        grd_list.rowStyle(i, "all", "background-color") = "#ffffff"
       
       Rnd1 = Math.random();
       Rnd2 = Math.random();
       Rnd3 = Math.random();
       cColor = window.rgb( (255 - 1) * Rnd1 + 1, (255 - 1) * Rnd2 + 1 , (255 -  1) * Rnd3 + 1); //랜덤한 색깔을 가져온다.


       
       var axis = obj_chart.Axis.AddCustom(false);
//        
       obj_chart.Axis.Custom(cnt).AxisPen.Color = cColor;
//        obj_chart.Axis.Custom(cnt).AxisPen.Title.Caption = title;
//        
//        obj_chart.Axis.Custom(cnt).Title.Font.Size  = 4;
//        obj_chart.Axis.Custom(cnt).Title.Font.Bold  = true;
       

       if(cnt == 0) {
        obj_chart.Axis.Custom(cnt).StartPosition   = 0;
        obj_chart.Axis.Custom(cnt).EndPosition     = 100;
        }
       

       //positionpercent 는 새로 axis가 생성될때마다 왼쪽으로 생성되도록 함..
       obj_chart.Axis.Custom(cnt).PositionPercent   = 1 - (3*(cnt+1));  (이것의 값에 따라 그 위치에 생성됨(값이 -여야만.. 차트 좌측 여백쪽에
       obj_chart.Axis.Custom(cnt).Automatic      = false;  // Axis자동생성X
       obj_chart.Axis.Custom(cnt).Maximum        = 17;    //축의 최대값 17
       obj_chart.Axis.Custom(cnt).Minimum        = 0;     // 최소값 0
       obj_chart.Axis.Custom(cnt).Increment    = 2;       // 증가값 2


       obj_chart.AddSeries(0);
       obj_chart.Series(cnt).Color = cColor;
       obj_chart.Series(cnt).Title = title;
       obj_chart.Series(cnt).VerticalAxisCustom = axis; // 혈압
       obj_chart.Series(cnt).Marks.Visible = true;        //값 타이틀 보여주는 것.(점표시위에 Hint명칭)

       obj_chart.Series(cnt).asLine.LinePen.Width = 2;            //해당 시리즈에 대한 선의 굵기
       obj_chart.Series(cnt).asLine.Pointer.Visible = true;       //해당 시리즈에대한 값위치 점.표시여부
       obj_chart.Series(cnt).asLine.Pointer.Style = 1;              //해당 시리즈의 점의 스타일.. 1은 둥근원..그외는 해보시길..
       obj_chart.Series(cnt).asLine.Pointer.VerticalSize = 3;    // 해당 값의 위치점의 세로사이즈
       obj_chart.Series(cnt).asLine.Pointer.HorizontalSize = 3; //해당값의 위치점의 가로사이즈
       
//        
       var total;
       for(var j = grd_list.colRef("total1"); j <= grd_list.colRef("total13"); j++) {
        total = grd_list.valueMatrix(i, j);
        if(total != 0 && total != null && total != "") {
         obj_chart.Series(cnt).AddXY(j-1 , parseInt(total), total, cColor); //Line그래프는 AddXY로 표시
        } else {
         
        }
       }
       cnt++;
       
      }
     } 

 

 

 

'Javascript' 카테고리의 다른 글

트러스트 폼 tchart 관련 정리(작업진행중)  (0) 2013.10.02
Posted by 달려라곰간지
Javascript2013. 10. 2. 13:41

1. tchart object 추가...추가된 오브젝트 명이 Chart1일경우.

 

//차트의 상, 좌, 우, 하의 여백을 설정한다.
     Chart1.Panel.MarginTop = 0;
     Chart1.Panel.MarginLeft = 0;
     Chart1.Panel.MarginRight =0;
     Chart1.Panel.MarginBottom = 0;

   

     Chart1.Panel.BevelWidth = 0;        // 주위 테두리 넓이 0으로 설정

     Chart1.Header.Visible = false;      // Graph Header 정보 사용 여부
     Chart1.Aspect.View3D  = false;      // 2d 로 표현하기

    

    Chart1.Zoom.Enable  = true;        // zoom여부 마우스 하단으로 드래그 zoomin, 마우스 상단으로 드래그 zoomout)
     Chart1.Scroll.Enable   = true;      // scroll 사용하지 않기
     Chart1.Legend.Visible  = true;     // 그래프 참조 박스 띄우지 않기(범례) 우측상단
     

     Chart1.Panel.Gradient.Visible = true;      // 페널에 그라디언트 적용
     Chart1.Panel.Gradient.StartColor = 0x404040;  // 그라디언트 시작색깔
     Chart1.Panel.Gradient.EndColor = 0x404040;   // 그라디언트 종료색깔
     Chart1.Environment.MouseWheelScroll = true;   // Graph 마우스 휠 사용 여부

     //하단축 칸 수 정하기와 눈금 없애기
     Chart1.Axis.Bottom.Automatic = false;    //하단축 자동 설정(기본값)
     Chart1.Axis.Bottom.Labels.Visible = true;   //하단축 Label 설정
     Chart1.Axis.Bottom.Labels.multiline = true; //하단축 Label 2줄 설정
     Chart1.Axis.Bottom.Labels.Font.Size = 1; //하단축 Label 폰트 사이즈 조절

     //Chart1.Axis.Bottom.SetMinMax (0, 24);  //하단축 최소, 최대 길이 설정
     Chart1.Axis.Bottom.Minimum = 0;
     Chart1.Axis.Bottom.Maximum = length + 4;
     Chart1.Axis.Bottom.Increment = 2;    //하단축 증가값 설정
     Chart1.Axis.Bottom.MinorTickCount = 20;  //하단축 눈금 갯수 설정
     Chart1.Axis.Bottom.TicksInner.visible = false; //하단축 눈금 안쪽 표시 설정
     
     Chart1.Axis.Visible = true;
     Chart1.Header.Text.Add("My FirstLine");

 

//차트 생성부분

//차트 생성시에 AddSeries()안의 파라메터의 종류에 따라 추가되는 그래프의 종류가 달라진다.

//0: 라인그래프 1 : 막대그래프. 5: 파이그래프.

for(var i = 0; i < length; i++) {
      Chart1.AddSeries(1);
      Chart1.Series(i).Color = aColor[i]; //생성한 차트축의 색상. ex) 0xff0000

      Chart1.Series(i).asBar.BarStyle = 0; //bar의 모양.
      Chart1.Series(i).asBar.BarWidth = 5; //bar의 굵기
      Chart1.Series(i).Title = grd_inpt.valueMatrix(i+1, grd_inpt.colRef("deptengabbr")); //bar축의 이름
      Chart1.Series(i).AddXY(i +3, parseInt(grd_inpt.valueMatrix(i +1, grd_inpt.colRef("gadong"))),"", aColor[i]);

     //막대차트는 AddXY함수를 이용하여 그린다.

    //Chart1.Series(0).AddXY(  x축의 값   ,  Y축값, "", 막대색깔); //3번째 파라메터는 사실 모르겠다.


     }

 

Chart2.AddSeries(5);
     
     Chart2.Series(0).Add(100, "5급", aColor[0]);
     Chart2.Series(0).Add(80, "4급", aColor[1]);
     Chart2.Series(0).Add(20, "3급", aColor[2]);
     Chart2.Series(0).Add(10, "2급", aColor[3]);

 


 

Posted by 달려라곰간지