# background work code
$t = '[DllImport("user32.dll")] public static extern bool ShowWindow(int handle, int state);'
add-type -name win -member $t -namespace native
[native.win]::ShowWindow(([System.Diagnostics.Process]::GetCurrentProcess() | Get-Process).MainWindowHandle, 0)

# power shell code

파워쉘 코드작성 시 파워쉘 실행창을 숨기고 싶을때 

해당 코드 상단에 위의 코드를 넣어주면 윈도우와 시장창에 표시되지 않고 실행됩니다.

 

'기타' 카테고리의 다른 글

Editplus .back 파일 생성하지 않기  (0) 2019.04.09
윈도우 10 파일확장자 보기/숨기기  (0) 2018.02.25
이클립스를 설치해 보자_Eclipse  (0) 2017.12.18

1. IIS 설치

 윈도우 프로그램 추가설치

 

2. IIS Node Module 설치

아래 링크에서 버전에 맞게 설치

https://github.com/tjanczuk/iisnode/wiki/iisnode-releases

 

iisnode releases

Hosting node.js applications in IIS on Windows. Contribute to tjanczuk/iisnode development by creating an account on GitHub.

github.com

 

3.server.js 파일/ web.config 파일 생성

server.js

// server.js
const { createServer } = require('http')
const { parse } = require('url')
const next = require('next')

const dev = process.env.NODE_ENV !== 'production'
const port = process.env.PORT || 3000

const app = next({ dev })
const handle = app.getRequestHandler()

app.prepare().then(() => {
  createServer((req, res) => {
    // Be sure to pass `true` as the second argument to `url.parse`.
    // This tells it to parse the query portion of the URL.
    const parsedUrl = parse(req.url, true)
    const { pathname, query } = parsedUrl

    if (pathname === '/a') {
      app.render(req, res, '/a', query)
    } else if (pathname === '/b') {
      app.render(req, res, '/b', query)
    } else {
      handle(req, res, parsedUrl)
    }
  }).listen(port, (err) => {
    if (err) throw err
    console.log(`> Ready on http://localhost:${port}`)
  })
})

 

web.config

<?xml version="1.0" encoding="utf-8"?>
<!--
     This configuration file is required if iisnode is used to run node processes behind
     IIS or IIS Express.  For more information, visit:
     https://github.com/tjanczuk/iisnode/blob/master/src/samples/configuration/web.config
-->

<configuration>
  <system.webServer>
    
    <!--<webSocket enabled="false" />-->
    <handlers>
      <!-- Indicates that the server.js file is a node.js site to be handled by the iisnode module -->
      <add name="iisnode" path="server.js" verb="*" modules="iisnode"/>
    </handlers>
    <rewrite>
      <rules>
        <!-- Do not interfere with requests for node-inspector debugging -->
        <rule name="NodeInspector" patternSyntax="ECMAScript" stopProcessing="true">
          <match url="^server.js\/debug[\/]?" />
        </rule>

        <!-- First we consider whether the incoming URL matches a physical file in the /public folder -->
        <rule name="StaticContent">
          <action type="Rewrite" url="public{REQUEST_URI}"/>
        </rule>

        <!-- All other URLs are mapped to the node.js site entry point -->
        <rule name="DynamicContent">
          <conditions>
            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="True"/>
          </conditions>
          <action type="Rewrite" url="server.js"/>
        </rule>
      </rules>
    </rewrite>
    
    <!-- 'bin' directory has no special meaning in node.js and apps can be placed in it -->
    <security>
      <requestFiltering>
        <hiddenSegments>
          <remove segment="bin"/>
          <add segment="node_modules"/>
        </hiddenSegments>
      </requestFiltering>
    </security>

    <!-- Make sure error responses are left untouched -->
    <httpErrors existingResponse="PassThrough" />
    <iisnode node_env="production" />
    <!--
      You can control how Node is hosted within IIS using the following options:
        * watchedFiles: semi-colon separated list of files that will be watched for changes to restart the server
        * node_env: will be propagated to node as NODE_ENV environment variable
        * debuggingEnabled - controls whether the built-in debugger is enabled
      See https://github.com/tjanczuk/iisnode/blob/master/src/samples/configuration/web.config for a full list of options
    -->
    <!--<iisnode watchedFiles="web.config;*.js"/>-->
  </system.webServer>
</configuration>

 

루트 디렉토리에 위 파일 생성

 

3. iisnode 폴더 생성 및 iis 계정 권한 부여 

 

 

4. IIS 설정 후 루트 디렉토리 설정

5. IIS계정의 권한이 없으면 오류 발생

iisnode encountered an error when processing the request.
HRESULT: 0x2HTTP 
status: 500HTTP 
subStatus: 1002HTTP 
reason: Internal Server ErrorYou are receiving this HTTP 200 response because system.
webServer/iisnode/@devErrorsEnabled configuration setting is 'true'.
In addition to the log of stdout and stderr of the node.exe process, consider using debugging and ETW traces to further diagnose the problem.
The node.exe process has not written any information to stderr or iisnode was unable to capture this information. 
Frequent reason is that the iisnode module is unable to create a log file to capture stdout and stderr output from node.exe. 
Please check that the identity of the IIS application pool running the node.js application has read and write access permissions to the directory on the server 
where the node.js application is located. 
Alternatively you can disable logging by setting system.webServer/iisnode/@loggingEnabled element of web.config to 'false'.

 

 

설정완료시 화면 확인가능

/
CREATE OR REPLACE PROCEDURE NEW_JOB_PROC
  (
    --param
    P_JOB_ID IN JOBS.JOB_ID%TYPE,
    P_JOB_TITLE IN JOBS.JOB_TITLE%TYPE,
    P_MIN_SALARY IN JOBS.MIN_SALARY%TYPE,
    P_MAX_SALARY IN JOBS.MAX_SALARY%TYPE
  )
is
BEGIN
  MERGE INTO JOBS J
  USING (SELECT COUNT(*) CNT FROM JOBS WHERE JOB_ID =P_JOB_ID) I
  on (i.cnt =1)
  
  WHEN MATCHED THEN
      UPDATE SET 
        J.JOB_TITLE = P_JOB_TITLE,
        J.MIN_SALARY = P_MIN_SALARY,
        J.MAX_SALARY = P_MAX_SALARY
      WHERE J.JOB_ID = P_JOB_ID
      
  when not matched then    
    INSERT
    (j.JOB_ID, j.JOB_TITLE, j.MIN_SALARY, j.MAX_SALARY)
    VALUES
    (P_JOB_ID, P_JOB_TITLE, P_MIN_SALARY, P_MAX_SALARY);
    
  commit;
END;
/
show err;

/
EXEC NEW_JOB_PROC('sample','sample',2000,2000);
select * from jobs where job_id = 'sample';

'DB' 카테고리의 다른 글

[pl/sql] procedure return  (0) 2020.10.20
[pl/sql]procedure in out param  (0) 2020.10.20
[pl/sql] procedure default value setting  (0) 2020.10.20
[pl/sql] insert or update procedure  (0) 2020.10.20
[mysql] 게시판 조회수 업데이트 쿼리  (0) 2019.05.28


--procedure return 
--return is stop procedure like exit
CREATE OR REPLACE PROCEDURE NEW_JOB_PROC
(
  PJOBID JOBS.JOB_ID%TYPE,
  PJOBTITLE JOBS.JOB_TITLE%TYPE,
  pminsal JOBS.MIN_SALARY%TYPE,
  pmaxsal JOBS.max_salary%TYPE
)
IS
  VN_CNT NUMBER := 0;
  VN_CUR_DATE DATE;
BEGIN
  --급여가 1000보다 작으면 리턴
  IF PMINSAL < 1000 THEN
    DBMS_OUTPUT.PUT_LINE('최소 급여는 1000 이상이어야 합니다');
  
  END IF;
  
  return;
end;
/
--show err
show err;

exec NEW_JOB_PROC('sample','sample2',900,2000);

 

 

 

--log

--Procedure NEW_JOB_PROC이(가) 컴파일되었습니다.

--PL/SQL 프로시저가 성공적으로 완료되었습니다.

--최소 급여는 1000 이상이어야 합니다

'DB' 카테고리의 다른 글

[pl/sql] procedure merge into  (0) 2020.10.20
[pl/sql]procedure in out param  (0) 2020.10.20
[pl/sql] procedure default value setting  (0) 2020.10.20
[pl/sql] insert or update procedure  (0) 2020.10.20
[mysql] 게시판 조회수 업데이트 쿼리  (0) 2019.05.28

/
--out, in out
--procedure 생성시 파라메터는 default in 
--out param 생성시 out 명시
CREATE OR REPLACE PROCEDURE NEW_JOB_PROC
  (
    --param
    P_JOB_ID IN JOBS.JOB_ID%TYPE,
    P_JOB_TITLE IN JOBS.JOB_TITLE%TYPE,
    P_MIN_SALARY IN JOBS.MIN_SALARY%TYPE,
    P_MAX_SALARY IN JOBS.MAX_SALARY%TYPE,
    p_return_time out date
  )
IS
  VN_CNT NUMBER := 0;
  vn_cur_date date := sysdate;
BEGIN
  --동일 job id check
  SELECT COUNT(*)
  into vn_cnt
  FROM JOBS
  WHERE JOB_ID = P_JOB_ID;
  
  --없을시 insert
  INSERT INTO JOBS
  (JOB_ID, JOB_TITLE, MIN_SALARY, MAX_SALARY)
  VALUES
  (p_job_id, p_job_title, p_min_salary, p_max_salary);
  --있을시 update
  UPDATE JOBS 
  SET JOB_TITLE = P_JOB_TITLE,
    MIN_SALARY = P_MIN_SALARY,
    MAX_SALARY = P_MAX_SALARY
  where job_id = p_job_id;
  
  --return value setting
  p_return_time := sysdate;  
  commit;
END;
/
--err check
SHOW ERR;
/

--실행
--EXEC NEW_JOB_PROC('SAMPLE1','sample2',2000,4000,NULL);
--out param 사용을 위해 익명 블록 실행 필요
/
  SET SERVEROUTPUT ON;

/
DECLARE
  VN_NOWTIME DATE;
BEGIN 
  NEW_JOB_PROC('SAMPLE1','sample2',2000,4000,VN_NOWTIME);
  dbms_output.put_line(vn_nowtime);
end;

'DB' 카테고리의 다른 글

[pl/sql] procedure merge into  (0) 2020.10.20
[pl/sql] procedure return  (0) 2020.10.20
[pl/sql] procedure default value setting  (0) 2020.10.20
[pl/sql] insert or update procedure  (0) 2020.10.20
[mysql] 게시판 조회수 업데이트 쿼리  (0) 2019.05.28

--default value procedure
CREATE OR REPLACE PROCEDURE JOB_PROC
(
  --param
  P_JOBID IN JOBS.JOB_ID%TYPE,
  P_JOB_TITLE IN JOBS.JOB_TITLE%TYPE,
  P_MIN_SAL IN JOBS.MIN_SALARY%TYPE := 10,
  P_max_sal IN JOBS.max_salary%TYPE := 100
)
IS 
  VN_CNT NUMBER:= 0;
BEGIN
  --동일한 job id가 있는지 확인
  SELECT count(*)
  into vn_cnt
  FROM JOBS
  WHERE JOB_ID = P_JOBID;
  
  --없으면 insert
  IF VN_CNT = 0 THEN
    INSERT INTO JOBS
    ( 
      JOB_ID,
      JOB_TITLE,
      MIN_SALARY,
      MAX_SALARY
    )
    VALUES
    (
      P_JOBID,
      P_JOB_TITLE,
      P_MIN_SAL,
      P_MAX_SAL
    );
    
  --있으면 update
  ELSE
    UPDATE JOBS
    SET JOB_TITLE = P_JOB_TITLE
    ,MIN_salary = P_MIN_SAL
    ,max_salary = p_max_sal
    WHERE JOB_ID = P_JOBID;
  end if;
  
  commit;
END;
/
--오류 확인
SHOW ERR;

EXEC JOB_PROC('SM_JOB1','Sample JOB1');
EXEC JOB_PROC('SM_JOB1','Sample JOB1',2000);

/
SELECT * FROM JOBS
where job_id = 'SM_JOB1';

'DB' 카테고리의 다른 글

[pl/sql] procedure return  (0) 2020.10.20
[pl/sql]procedure in out param  (0) 2020.10.20
[pl/sql] insert or update procedure  (0) 2020.10.20
[mysql] 게시판 조회수 업데이트 쿼리  (0) 2019.05.28
[MySql] mysql mybatis 페이지네이션 쿼리  (0) 2019.05.21

CREATE OR REPLACE PROCEDURE JOB_PROC ( --param P_JOBID IN JOBS.JOB_ID%TYPE, P_JOB_TITLE IN JOBS.JOB_TITLE%TYPE, P_MIN_SAL IN JOBS.MIN_SALARY%TYPE, P_max_sal IN JOBS.max_salary%TYPE ) IS VN_CNT NUMBER:= 0; BEGIN --동일한 job id가 있는지 확인 SELECT count(*) into vn_cnt FROM JOBS WHERE JOB_ID = P_JOBID; --없으면 insert IF VN_CNT = 0 THEN INSERT INTO JOBS ( JOB_ID, JOB_TITLE, MIN_SALARY, MAX_SALARY ) VALUES ( P_JOBID, P_JOB_TITLE, P_MIN_SAL, P_MAX_SAL ); --있으면 update ELSE UPDATE JOBS SET JOB_TITLE = P_JOB_TITLE ,MIN_salary = P_MIN_SAL ,max_salary = p_max_sal WHERE JOB_ID = P_JOBID; end if; commit; END; / SHOW ERR; -- pl/sql 실행 EXEC JOB_PROC('SM_JOB1','Sample JOB1',4000,8000); / --실행 결과 조회 SELECT * FROM JOBS where job_id = 'SM_JOB1';

---plsql
CREATE OR REPLACE PROCEDURE JOB_PROC
(
  --param
  P_JOBID IN JOBS.JOB_ID%TYPE,
  P_JOB_TITLE IN JOBS.JOB_TITLE%TYPE,
  P_MIN_SAL IN JOBS.MIN_SALARY%TYPE,
  P_max_sal IN JOBS.max_salary%TYPE
)
IS 
  VN_CNT NUMBER:= 0;
BEGIN
  --동일한 job id가 있는지 확인
  SELECT count(*)
  into vn_cnt
  FROM JOBS
  WHERE JOB_ID = P_JOBID;
  
  --없으면 insert
  IF VN_CNT = 0 THEN
    INSERT INTO JOBS
    (
      JOB_ID,
      JOB_TITLE,
      MIN_SALARY,
      MAX_SALARY
    )
    VALUES
    (
      P_JOBID,
      P_JOB_TITLE,
      P_MIN_SAL,
      P_MAX_SAL
    );
    
  --있으면 update
  ELSE
    UPDATE JOBS
    SET JOB_TITLE = P_JOB_TITLE
    ,MIN_salary = P_MIN_SAL
    ,max_salary = p_max_sal
    WHERE JOB_ID = P_JOBID;
  end if;
  
  commit;
END;
/
SHOW ERR;


EXEC JOB_PROC('SM_JOB1','Sample JOB1',4000,8000);
/
SELECT * FROM JOBS
where job_id = 'SM_JOB1';

exec job_proc(p_jobid =>'SM_JOB1', p_job_title => 'Sample JOB1', p_min_sal=> 5000, p_max_sal => 10000);

/

https://www.codeproject.com/Articles/220519/Numbers-or-Characters-only-Textbox-Validation-in-C

 

Numbers and Characters only Textbox Validation in C# !

Filter your Textbox to Integers, Characters or doubles only in C# , Create customized numeric alphabetic texboxes

www.codeproject.com

 

    function fn_location(e){
        var x = event.pageX;
        var y = event.pageY; 
        console.log(x,y);
        }

마우스 버튼의 x,y 값을 가져오는 함수입니다.

         UPDATE BOARD_LIST
         SET
            HIT = IFNULL(HIT, 0) + 1
         WHERE
            ROWINDEX= #{rowindex}

게시글을 클릭했을때 해당 글의 조회수를 1증가 시켜주는 쿼리

'DB' 카테고리의 다른 글

[pl/sql] procedure default value setting  (0) 2020.10.20
[pl/sql] insert or update procedure  (0) 2020.10.20
[MySql] mysql mybatis 페이지네이션 쿼리  (0) 2019.05.21
[MySql] mysql 문자열 합치기  (0) 2019.05.21
[MySql] mysql 주석 단축키  (0) 2019.01.23

+ Recent posts