오라클클럽 게시글 SQL 예쁘게 등록하는 법 0 37 5,214

by 마농 [2013.08.02 13:51:33]


오라클클럽 게시글 SQL 이쁘게 등록하는 법.

SQL문을 포맷에 맞게(이쁘게) 등록하려면 Code() 버튼을 클릭하여 SQL문장을 작성 하시면 됩니다.

라고...
위에 나와 있는 설명대로 하면 들여쓰기가 깨져서 보입니다.
원인 분석 결과 공백 두칸('  ')이 한칸(' ')으로 바뀌어 저장되더라구요.

오라클클럽 게시글 SQL 이쁘게 등록하는 법.
1. 텍스트 에디터 프로그램을 연다.(노○패드, 워○패드, 울○라에디트, 아○로에디트, 에디트플○스 등)
2. SQL문장을 이쁘게 작성하신 뒤
3. SQL문장을 전체 바꾸기를 한다 (공백한칸 ==> 공백두칸)
4. 위에서 설명한 방법대로 태그를 추가하고 등록

SQL 뿐 아니라 실행계획등 줄맞춰 들여쓰기가 중요한 코드에 적용 가능함.

by 부쉬맨 [2013.08.02 14:35:04]
난그냥 한칸내리고 하는데...해봐야겟당 나중에 올릴기회가있따면!!!

by 우리집아찌 [2013.08.02 14:42:32]

귀찮지만 그렇게 해야겠네요..

by 미카엘 [2013.08.02 14:52:28]
 
select '이쁜가요??' 
 from dual

by 용근님 [2013.08.02 17:05:15]
SELECT test
  FROM t
 WHERE 1 = 1
   AND tcol = tcol

by 우리집아찌 [2013.08.02 17:23:11]
 
-- TEST 용 
SELECT * FROM DUAL
 WHERE 1 = 2
 AND 2 = 2
 
-- TEST 용 
SELECT * FROM DUAL
 WHERE 1 = 2
   AND 2 = 2

by 케를로스 [2013.08.05 11:48:19]
select '그렇군요' 
 from dual
where 1=1;

by 타락천사 [2013.08.07 10:56:28]
SELECT * 
FROM GLOBLA_NAME

by 혼돈의카오스 [2013.08.23 18:43:08]
select '행복하세요'
from dual
where 1 = 1

by 김큐트 [2013.11.29 10:00:50]
 select '안녕하세요' from dual 

by 거북이 [2013.12.17 17:15:23]
 select '이렇게인가요?' from dual 

by woni_rang [2013.12.19 16:53:11]
select '행복하세요'
from dual 
where 1 = 1

by 시그너스7000 [2013.12.20 16:51:21]
 
SELECT * 
FROM DUAL

by 한상윤 [2014.03.27 17:31:23]
select '감사합니다'
from dual

by 힐포인트 [2014.04.02 17:44:06]
 select '좋은 팁이네요' 
 from dual 

by 토비라이프 [2014.05.21 17:54:15]

오잉..저는 똑같이 했는데 예를 누르면 아무 반응이 없네요


by 월화수목금금금 [2014.06.18 17:01:06]
select '조으다~' t1
from dual

 


by 김완소 [2014.08.09 17:33:35]
select '요걸 인제 알았네요,,' 
from dual

 


by 박민철 [2014.08.21 10:36:26]

SELECT  '아빠'
    FROM  DUAL
  WHERE  1  =  1

 


by 고니고니 [2014.12.01 13:07:31]
select '나이스'
  from dual

 


by 낭만캐치 [2015.01.06 19:36:20]

보안에 막히면 저것도 못하는건가..? 흠..;;

예 버튼이 안눌려요.,,


by 김정식 [2015.01.07 09:11:01]

브라우저에서 호환성 보기 설정을 해보실래요.. ^^


by 낭만캐치 [2015.01.07 11:47:25]



select 'gg' from dual

 


by 낭만캐치 [2015.01.07 11:47:53]

아하.. 호환성 문제였군요.. 감사합니다^^


by 돌빵 [2015.11.13 13:24:01]
--test 
  select code1 as col1
  from table1
  where id = '1234'
    and pw = '1234'

     

 


by 민호 [2016.09.28 16:24:17]
import java.sql.*;

public class JEdb{
   static Connection con = null;
   static{
      try{
         String url = "jdbc:edb://localhost:5444/edb";
         String usr = "edb";
         String pwd = "password";
         Class.forName("com.edb.Driver");

         con = DriverManager.getConnection(url, usr, pwd);
      }catch(Exception exp){
         exp.printStackTrace();
      }
   }

      public static void main(String argv[]) throws Exception{
         try{
            Statement stat = con.createStatement();
            ResultSet rs = stat.executeQuery("SELECT EMPNO,ENAME,JOB,MGR,HIREDATE FROM EMP");

            while(rs.next()){}

            stat.close();
            conn.close();
         }catch(Exception e){
            System.out.println(e);
         }
      }
}

 


by 민호 [2016.10.11 10:54:23]
empno   ename     job         mgr         hiredate
=====   =====     =====       =====       =====
7369    SMITH     CLERK       7902        1980-12-17
7499    ALLEN     SALESMAN    7698        1981-02-20
7521    WARD      SALESMAN    7698        1981-02-22
7566    JONES     MANAGER     7839        1981-04-02
7654    MARTIN    SALESMAN    7698        1981-09-28
7698    BLAKE     MANAGER     7839        1981-05-01
7782    CLARK     MANAGER     7839        1981-06-09
7788    SCOTT     ANALYST     7566        1987-04-19
7839    KING      PRESIDENT   0           1981-11-17
7844    TURNER    SALESMAN    7698        1981-09-08
7876    ADAMS     CLERK       7788        1987-05-23
7900    JAMES     CLERK       7698        1981-12-03
7902    FORD      ANALYST     7566        1981-12-03
7934    MILLER    CLERK       7782        1982-01-23

 


by 민호 [2016.10.11 14:43:40]
import java.sql.*;

public class JdbcTest {
        public static void main(String argv[]) throws Exception{
                String url = "jdbc:oracle:thin:@localhost:1521:orcl";
                String usr = “scott";
                String pwd = "welcome";

                Class.forName("oracle.jdbc.driver.OracleDriver");
                try {
                        Connection conn = DriverManager.getConnection(url,usr,pwd);
                        Statement stat = conn.createStatement();
                        ResultSet rs = stat.executeQuery("select * from student");

                        while(rs.next()){}
                        stat.close();
                        conn.close();
  } catch (Exception e){
                        System.out.println(e);
                }
        }
}

 


by 민호 [2016.10.11 14:48:35]
import java.sql.*;

public class JEdb {
   static Connection con = null;
   static{
      try{
         String url = “jdbc:edb://localhost:5444/edb”;
         String usr = “edb”;
         String pwd = “edb”;
         con = DriverManager.getConnection(url, usr, pwd);

         Class.forName(“com.edb.Driver”);
      }catch(Exception exp){
         exp.printStackTrace();
      }
   }
        public static void main(String argv[]) throws Exception{
            try {
                    Statement stat = con.createStatement();    
                    ResultSet rs = stat.executeQuery("select * from student");
  
                    while(rs.next()){}
                    stat.close();
                    conn.close();
              } catch (Exception e){
                        System.out.println(e);
              }
        }
}

 


by 민호 [2016.10.11 16:41:02]
SET max_parallel_worker_per_gather = 8;

EXPLAIN SELECT count(*) FROM partest;

 


by 민호 [2016.10.11 16:45:43]
SET idle_in_transaction_session_timeout = '2s';

BEGIN WORK;
-- sit idle for 3 seconds
SELECT 1;

 


by 민호 [2016.10.11 16:50:56]
SELECT * FROM information_schema.role_table_grants WHERE table_name='dept';

 


by 민호 [2016.10.19 11:28:55]
String url = "jdbc:edb://localhost:5444/edb;

 


by 민호 [2016.10.19 12:38:52]
create table passwords(
principal varchar2(90) primary key, 
ciphertext raw(9));

 


by 민호 [2016.10.19 12:41:06]
insert into passwords values('a', 'abc'), ('b', 'abcde');

 


by 민호 [2016.10.19 12:42:01]
create procedure set_password(username character varying) as
typ integer := DBMS_CRYPTO.DES_CBC_PKCS5;
key raw(128) := ‘my secret key’;
iv raw(100) := ‘my initialization vector’; 
encrypted raw(2048);
cleartext bytea;
begin
select ciphertext into cleartext from passwords where principal = username;
encrypted := dbms_crypto.encrypt(cleartext, typ, key, iv);
update passwords set ciphertext = encrypted where principal = username;
end;

 


by 민호 [2016.10.19 12:42:57]
select set_password('a');

 


by 민호 [2016.10.19 12:45:06]
create function get_password(username varchar2) return raw as
typ INTEGER := DBMS_CRYPTO.DES_CBC_PKCS5;
key RAW(128) := ‘my secret key’;
iv RAW(100) := ‘my initialization vector’;
password RAW(2048);
BEGIN
select ciphertext into password from passwords where principal = username;
return dbms_crypto.decrypt(password, typ, key, iv);
END;

 

댓글등록
SQL문을 포맷에 맞게(깔끔하게) 등록하려면 code() 버튼을 클릭하여 작성 하시면 됩니다.
로그인 사용자만 댓글을 작성 할 수 있습니다. 로그인, 회원가입