๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
DB/Oracle

์˜ค๋ผํด ๋ฌธ์ž์—ด ์ž๋ฅด๊ธฐ (SUBSTR ํ•จ์ˆ˜)

by yunamom 2022. 2. 3.
๋ฐ˜์‘ํ˜•

 

์˜ค๋ผํด์—์„œ SUBSTR ํ•จ์ˆ˜๋Š” ๋ฌธ์ž์—ด์„ ์ž๋ฅผ๋•Œ ์‚ฌ์šฉํ•˜๋Š” ๊ธฐ๋ณธ ํ•จ์ˆ˜์ด๋‹ค.

SUBSTR = ๋ฌธ์ž ๋‹จ์œ„

SUBSTRB = ๋ฐ”์ดํŠธ ๋‹จ์œ„

 

 

SUBSTR ํ•จ์ˆ˜ (๋ฌธ์ž๋‹จ์œ„)

-ํ•จ์ˆ˜ : SUBSTR("์ปฌ๋Ÿผ๋ช…","์‹œ์ž‘์œ„์น˜","๊ธธ์ด")

 

SUBSTRB ํ•จ์ˆ˜ (๋ฐ”์ดํŠธ๋‹จ์œ„)

-ํ•จ์ˆ˜ : SUBSTRB("์ปฌ๋Ÿผ๋ช…","์‹œ์ž‘์œ„์น˜","๊ธธ์ด")

SUBSTRB ํ•จ์ˆ˜๋Š” ๋ฐ”์ดํŠธ ๋‹จ์œ„๋กœ ๋ฌธ์ž์—ด์„ ์ž๋ฅผ๋•Œ ์‚ฌ์šฉํ•œ๋‹ค. ํ•œ๊ธ€ ๊ฐ™์€ ๊ฒฝ์šฐ ๋ฌธ์ž๋‹จ์œ„๋กœ ์ž๋ฅผ๋•Œ ๊นจ์ง€๋Š” ๊ฒฝ์šฐ๊ฐ€ ์žˆ๋‹ค.

์ด๋Ÿด๋•Œ๋Š” ๋ฐ”์ดํŠธ ๋‹จ์œ„๋กœ ์ž๋ฅด๋ฉด ๊นจ์ง€๋Š”๊ฑธ ๋ฐฉ์ง€ํ•  ์ˆ˜ ์žˆ๋‹ค. ์˜ค๋ผํด ์„ธํŒ…์— ๋”ฐ๋ผ์„œ ํ•œ๊ธ€์ด 3byte ๋˜๋Š” 2byte ์ผ์ˆ˜ ์žˆ์œผ๋‹ˆ

์•„๋ž˜์˜ ๋ฌธ์ž์…‹ ์ฟผ๋ฆฌ๋กœ ์˜ค๋ผํด ์„ธํŒ…์„ ํ™•์ธํ• ์ˆ˜์žˆ๋‹ค.

 

SELECT*FROM nls_database_parameters WHERE parameter LIKE '%CHARACTERSET%';

[3byte VALUE]

NLS_CHARACTERSET = AL32UTF8

 

[2byte VALUE]

NLS_CHARACTERSET = K016MSWIN949

 

300x250

์ฝ”๋“œ