# user_db_resource_data

datas:
  CREATE TABLE  employees  (
           EmployeeID int(10) unsigned NOT NULL default '0',
           Name varchar(45) collate utf8_unicode_ci NOT NULL default '',
           Office varchar(10) collate utf8_unicode_ci NOT NULL default '',
           CreateTime timestamp NOT NULL default CURRENT_TIMESTAMP,
           PRIMARY KEY  ('EmployeeID')
          ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci


datas:
  CREATE TABLE  employees  (
           EmployeeID int(10) unsigned NOT NULL default '0',
           Name varchar(45) collate utf8_unicode_ci NOT NULL default '',
           Office varchar(10) collate utf8_unicode_ci NOT NULL default '',
           CreateTime timestamp NOT NULL default CURRENT_TIMESTAMP,
           PRIMARY KEY  ('EmployeeID')


datas:
  CREATE TABLE  employees  (
           EmployeeID int(10) unsigned NOT NULL default '0',
           Name varchar(45) collate utf8_unicode_ci NOT NULL default '',
           Office varchar(10) collate utf8_unicode_ci NOT NULL default '',
           CreateTime timestamp NOT NULL default CURRENT_TIMESTAMP,
           PRIMARY KEY  ('EmployeeID')
        )


datas:
  CREATE
    TABLE employees(
      EmployeeID INT(10) unsigned NOT NULL DEFAULT '0'
      ,Name VARCHAR(45) collate  NOT NULL DEFAULT ''
      ,Office VARCHAR(10) collate NOT NULL DEFAULT ''
      ,CreateTime TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
      ,PRIMARY KEY ('EmployeeID')
    )


datas:
  CREATE
    TABLE employees(
      EmployeeID INT(10) unsigned NOT NULL DEFAULT '0'
      ,Name VARCHAR(45) NOT NULL DEFAULT ''
      ,Office VARCHAR(10) NOT NULL DEFAULT ''
      ,CreateTime TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
      ,PRIMARY KEY ('EmployeeID')
    )


datas:
  CREATE
    TABLE employees(
      EmployeeID INT(10) unsigned NOT NULL DEFAULT '0'
      ,Name VARCHAR(45) NOT NULL DEFAULT ''
      ,Office VARCHAR(10) NOT NULL DEFAULT ''
      ,CreateTime TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
    )


datas:
  CREATE PROCEDURE WhoAreThey(
  OUT error VARCHAR(128),
  IN office VARCHAR(10)) 
  BEGIN 
  SET error = NULL


datas:
  CREATE
    PROCEDURE WhoAreThey(
      OUT error VARCHAR(128)
      ,IN office VARCHAR(10)
    ) BEGIN
  SET
    error = NULL


datas:
   SELECT address_id, address, address2, district, city_id, postal_code, phone, last_update 
   FROM address limit 0,1000


datas:
  CREATE
    TABLE employees2(
      EmployeeID INT(10) unsigned NOT NULL DEFAULT '0'
      ,Name VARCHAR(45) NOT NULL DEFAULT ''
      ,Office VARCHAR(10) NOT NULL DEFAULT ''
      ,CreateTime TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
    )


datas:
   SELECT   
           column_name field,
           column_type type,
           is_nullable "null",
           column_key "key",
           column_default "default",
           extra,
           column_comment "comment"
  	FROM information_schema.columns limit 0,1000


datas:
  SELECT object_name,
  position,
  DECODE (data_type, 'REF CURSOR', 'SYS_REFCURSOR', data_type) data_type,
  overload,
  argument_name,
  data_level,
  data_length,
  data_precision,
  data_scale,
  type_name,
  in_out,
  object_id,
  sequence
  FROM all_arguments
  WHERE object_id = 33932
  ORDER BY Object_Name, Overload, Sequence


datas:
  SELECT object_name,
  position,
  DECODE (data_type, 'REF CURSOR', 'SYS_REFCURSOR', data_type) data_type,
  overload,
  argument_name,
  data_level,
  data_length,
  data_precision,
  data_scale,
  type_name,
  in_out,
  object_id,
  sequence
  FROM all_arguments
  ORDER BY Object_Name, Overload, Sequence where ROWNUM > 0 and ROWNUM <= 1000


datas:
  SELECT object_name,
  position,
  DECODE (data_type, 'REF CURSOR', 'SYS_REFCURSOR', data_type) data_type,
  overload,
  argument_name,
  data_level,
  data_length,
  data_precision,
  data_scale,
  type_name,
  in_out,
  object_id,
  sequence
  FROM all_arguments where ROWNUM > 0 and ROWNUM <= 1000


datas:
  SELECT object_type, object_id
  FROM sys.user_objects
  WHERE object_name = 'P_ACCARD'
  AND object_type IN ('PACKAGE', 'PROCEDURE', 'FUNCTION')

  Proc=['secure_dml']


datas:
  SELECT object_type, object_id
  FROM sys.user_objects
  WHERE object_name = 'P_ACCARD'
  AND object_type IN ('PACKAGE', 'PROCEDURE', 'FUNCTION')
  Proc=['secure_dml']


datas:
  SELECT object_type, object_id
  FROM sys.user_objects
  WHERE object_name = 'SECURE_DML'
  AND object_type IN ('PACKAGE', 'PROCEDURE', 'FUNCTION')


datas:
  SELECT object_name,
  position,
  DECODE (data_type, 'REF CURSOR', 'SYS_REFCURSOR', data_type) data_type,
  overload,
  argument_name,
  data_level,
  data_length,
  data_precision,
  data_scale,
  type_name,
  in_out,
  object_id,
  sequence
  FROM all_arguments
  WHERE object_id = 12118
  ORDER BY Object_Name, Overload, Sequence


datas:
  SELECT TEXT
  FROM SYS.USER_SOURCE
  WHERE NAME = 'SECURE_DML' AND TYPE = 'PROCEDURE'
  ORDER BY LINE

  CREATE PROCEDURE simpleproc (OUT param1 INT) 
   BEGIN  
    SELECT COUNT(*) INTO param1 FROM JOBS


datas:
  SELECT object_type, object_id
  FROM sys.user_objects
  WHERE object_name = 'simpleproc'
  AND object_type IN ('PACKAGE', 'PROCEDURE', 'FUNCTION')


datas:
  SELECT object_type, object_id
  FROM sys.user_objects
  WHERE object_name = 'SIMPLEPROC'
  AND object_type IN ('PACKAGE', 'PROCEDURE', 'FUNCTION')


datas:
  SELECT object_name,
  position,
  DECODE (data_type, 'REF CURSOR', 'SYS_REFCURSOR', data_type) data_type,
  overload,
  argument_name,
  data_level,
  data_length,
  data_precision,
  data_scale,
  type_name,
  in_out,
  object_id,
  sequence
  FROM all_arguments
  WHERE object_id = 14146
  ORDER BY Object_Name, Overload, Sequence


datas:
  SELECT object_type, object_id, *
  FROM sys.user_objects
  WHERE object_name = 'SIMPLEPROC'
  AND object_type IN ('PACKAGE', 'PROCEDURE', 'FUNCTION')


datas:
  SELECT  *
  FROM sys.user_objects
  WHERE object_name = 'SIMPLEPROC'
  AND object_type IN ('PACKAGE', 'PROCEDURE', 'FUNCTION')


datas:
  /* 프로시져 소스 */
  SELECT b.text as source_text
  FROM user_procedures a INNER JOIN user_source b
  ON a.object_name = b.name
  WHERE 1 = 1
  AND a.object_name = upper('SIMPLEPROC')
  AND b.TYPE = upper('PROCEDURE')
  ORDER BY b.line


datas:
  SELECT b.text as source_text
  FROM user_procedures a INNER JOIN user_source b
  ON a.object_name = b.name
  WHERE 1 = 1
  AND a.object_name = upper('SIMPLEPROC')
  AND b.TYPE = upper('PROCEDURE')
  ORDER BY b.line


datas:
  SELECT  *
  FROM sys.user_objects
  WHERE object_name = 'SECURE_DML'
  AND object_type IN ('PACKAGE', 'PROCEDURE', 'FUNCTION')


datas:
  /* 에디터에서 주석 먹도록  */
  SELECT b.text as source_text
  FROM user_procedures a INNER JOIN user_source b
  ON a.object_name = b.name
  WHERE 1 = 1
  AND a.object_name = upper('SECURE_DML')
  AND b.TYPE = upper('PROCEDURE')
  ORDER BY b.line


datas:
  SELECT b.text as source_text
  FROM user_procedures a INNER JOIN user_source b
  ON a.object_name = b.name
  WHERE 1 = 1
  AND a.object_name = upper('SECURE_DML')
  AND b.TYPE = upper('PROCEDURE')
  ORDER BY b.line


datas:
  SELECT b.text as source_text
  FROM user_procedures a INNER JOIN user_source b
  ON a.object_name = b.name
  WHERE 1 = 1
  AND a.object_name = upper('ADD_JOB_HISTORY')
  AND b.TYPE = upper('PROCEDURE')
  ORDER BY b.line


datas:
  /** vkjdf */
  SELECT b.text as source_text
  FROM user_procedures a INNER JOIN user_source b
  ON a.object_name = b.name
  WHERE 1 = 1
  AND a.object_name = upper('ADD_JOB_HISTORY')
  AND b.TYPE = upper('PROCEDURE')
  ORDER BY b.line


datas:
  -- PROCEDURE문 생성
  CREATE PROCEDURE SIMPLEPROC (OUT param1 INT) 
   BEGIN  
    SELECT COUNT(*) INTO param1 FROM JOBS;  
   END;
   
   -- SECURE_DML
   -- ADD_JOB_HISTORY
   
   -- PROCEDURE 정보
  SELECT  *
  FROM sys.user_objects
  WHERE object_name = 'SECURE_DML'
  AND object_type IN ('PACKAGE', 'PROCEDURE', 'FUNCTION')
  ;


  -- PROCDURE TEXT
  SELECT TEXT
  FROM SYS.USER_SOURCE
  WHERE NAME = 'SIMPLEPROC' AND TYPE = 'PROCEDURE'
  ORDER BY LINE;


  SELECT TEXT
  FROM SYS.USER_SOURCE
  WHERE NAME = 'SECURE_DML' AND TYPE = 'PROCEDURE'
  ORDER BY LINE;


  -- 프로시져 소스
  /* vkjdf */
  SELECT b.text as source_text
  FROM user_procedures a INNER JOIN user_source b
  ON a.object_name = b.name
  WHERE 1 = 1
  AND a.object_name = upper('ADD_JOB_HISTORY')
  AND b.TYPE = upper('PROCEDURE')
  ORDER BY b.line;


datas:
  /* vkjdf */
  SELECT b.text as source_text
  FROM user_procedures a INNER JOIN user_source b
  ON a.object_name = b.name
  WHERE 1 = 1
  AND a.object_name = upper('ADD_JOB_HISTORY')
  AND b.TYPE = upper('PROCEDURE')
  ORDER BY b.line


datas:
  CREATE
    TABLE employees2(
      EmployeeID INT(10) unsigned NOT NULL DEFAULT '0'
      ,Name VARCHAR(45) NOT NULL DEFAULT ''
      ,Office VARCHAR(10) NOT NULL DEFAULT ''
      ,CreateTime TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
    )
  ;
  SELECT
      *
    FROM
      staff
  ;

  /* store */
  SELECT
      *
    FROM
      store
  ;

  select * from city;


datas:
  SELECT
      LOCATION_ID
      ,STREET_ADDRESS
      ,POSTAL_CODE
      ,CITY
      ,STATE_PROVINCE
      ,COUNTRY_ID
    FROM
      LOCATIONS where ROWNUM > 0 and ROWNUM <= 1000


