Simplified and traditional Oracle SQL Conversion

Source: Internet
Author: User
Tags deprecated

First, create a table named chineseword (simpleword, traditionword) that stores simplified and traditional Chinese characters)

Then, write a stored procedure to insert data into the chineseword table.

Create or replace procedure insertchineseword iss_str1 varchar2 (4000); s_str2 varchar2 (4000); s_str3 varchar2 (4000); s_str4 varchar2 (4000); s_str5 varchar2 (4000 ); s_str6 varchar2 (4000); s_str7 varchar2 (4000); t_str1 varchar2 (4000); t_str2 varchar2 (4000); t_str3 varchar2 (4000); t_str4 varchar2 (4000 ); t_str5 varchar2 (4000); t_str6 varchar2 (4000); t_str7 varchar2 (4000); I INT: = 0; begin s_str1: = 'Ah ah I'm sorry for the cancer I'm short I'm in love with the saddle ammonia an I'm in the dark shore amine case I'm in the concave region I'm so proud of the AO Ba Yi hey, hey, ba, Bai Ba bang bang bao burst cup Bei times embarrassed to prepare for baking benben benbenbenbenbenbenbenbenbenbenbenbenbenbenbenbenbenbenbenbenbenbenbenbenbenbenbenbenbenbenbenbenbenbenbenbenbenbenbenbenyunkubernetes Attack attack damage to the wall arm to avoid scalping Bian then I changed my mind and argued that I had marked my tables and said, "Oh, bin, bing, Bo, P, Fu bo barge Bu feeding bu exercise rough groove Cao toilet policy side volume test layer rub cross cutting tea cha difference split Chai Yi mixed with Chan yi winding shovel production explanation trembling Chang farm taste changchang Fu changchang changsong advocates the ultra-copy of banknotes to laugh at the tide of the nest, quarrel, stir-fry the car, pull away from the Chen Shen chen yu lined up said the city orange Cheng presented cheng smelly Chu Chuan Chuang chuxiao Yan Chun poke Z magnetic female ci CI Cong scallion from the cluster together coarse vinegar cluster to promote Yi Jin Cui urged brittle Yi Xi Cun Jian ruacuo frustrated by mistake to answer the question, beat the big Daze, and then wear a bag with a loan representative to be caught, slack, Dan, nitrogen, but give birth to a bullet when the dang sticky down the island to pray to Dao Yu Dao De de di dian Yao Ding ding set lost East dong understands Dong he du bu tons of dundunton, blunt shield, quantity, and quantity. issue penalty raft cutting missing valve method Fan bark lung waste boiling Fen FENG Yu Feng Fu apply skin incubator fu GA should be changed to the calcium cover and Gangan pole citrus rod liver catch sense stalk dare Gan Gang gang Gao paste lambs cake with a pickaxe draft notice Ge put ge goU Gou Gu pavilion cans used to fill in the light wide visit guguicui silicon guigui GUI roller Roll Stick pot Guo guoguo wrapped in a shell child sea he Hai harm han hahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahaha '; t_str1: = 'Ah, aegareah, alas, sorrow, cancer, AI, aegarean, and the case of the dark bank amine, Ang, WA, Yao, AO, Ba, AO pick it up, pick it up, roll it up, and then try it out. bang bang bao Bei Yi baked by benbenben benbenyi pump burst into force nose compared to the cool Bibi blind yundun flat will be changed and identified again. The name of the table is marked as "bing ". foil Bo Yi bo Bu feeding bu Xiao taobaogu Tao rough groove Cao yi Liu cha difference Xiao Chai yi Production changshou Chang Kai sang about the promotion of ultra-copywriting, Chao Xiaochao, Chao, Chao, chaochao, hot-fried cars, pull, pull, Chen, Shen Chen, taobaoyu cheng Yi when I first came out, I tried to see the ugly smell. In addition, I tried to get out of the figure in the chuhuan district. When I went to the zhuchuan district, I went through a boat and caught a string. chun alcohol lips Chun Yi stupid stamp Z magnetic female ci CI this Thorn is the same as the zookeeper from the zookeeper crude vinegar cluster to promote the destruction of Cui Xiao brittle in the village of jicui, I learned how to deal with it. I just wanted to answer the question, but I was so confused that I could not afford to wear my replacement bag. however, when it comes to the system, the system will immediately jump to the right of the Golden Tree, and the right of the Golden Tree will jump to the right of the stool. di. di di Dian di dashboard Ding ding dong understand the dynamic Dongjing Dongdong Doudou steep Doudou douzheng du Zheng dudu weiduan zookeeper and zookeeper of Dunning zookeeper yundun yundao yundun yi er, Han er, Fan fangfang fangfangfang anti-virus imitation fufei Feifei feijiao Feifei fengfei boiling fenfen fenfenvolin atmosphere points fufen Fen fengyi fengfengfengfengfengfengfengfeng peak zhuyun zhufengfengfengfengfufufufufufufufufufufufufufufufufufufufufufufufufufufufufufufufufufufufufufufufufufufufufufufufufufufufufufufufufufufufufupu fu Xiao Xi Gan GaN cylinder anus roll up the port bar and paste the high paste lambs cake to submit a draft report to the gogokuaijie.com gonggong Gong Yu Gu therefore, guoguo hired guoguo to drag the guoguo guidao guoguo kneeling in the air, squatting in the air hao consumption Hao hehao Heo heheheheheheh heheh hehao heohe brown Yun hehao black marks are very '; s_str2: = 'hate, hum, Heng, Hong, Hou hou, Hu HU Hua huang Hua, Huang, Hua, Huai, Huan HUan, Huang, Wei, Huang, Yu lie gray wave hui Yi Hui Yao wedding soul muddy mixed living group fire get or confused Huo Xin ji ji sent Ji Jia K fake Jia Jian jian Jiang Po award Jiang Jian Jiang jiao Zheng jie jie Jin Jing jing JU jun Ka Kai-kai keke ke class willing to chew Ken trap empty fear Kong control mouth buckle dry cry cave bitter cool library pants boast kill Cross block chopsticks wide quick Kuang basket crazy frame mine eye Kuang situation loss helmets look at Kui Wei Kui kukun bundle sleepy covered expanded wide pull La la Lai LAN lazy cable rotten Lang Lei Li li Lian liang Liangliang's two vehicles were dry and I was sorry to have chatted about his/her medical treatment. Liao's raw material was split, and the bad game Linlin phosphorus Linlin was near the adjacent scale linlinning. ling Liu lu Gu Lu Al Lu A little round of lunlun Lun on luoluo bare Luo luoluo Ma code Ma scold it? Buried buy Mai Yu manmanman man slow man blind man Mao mei men meng Mn Meng Miao Ji Mi Mian Miao Xun Jian Miao Wei destroy Min Ming Min mo Min mu Na Mu na ne Nai milk Nai Nan capsule scratching the brain angry troubles it neon Ni intends you are greasy renyi Niang niangni Niang Ni malaria, nuomuno, ou, and puke '; t_str2: = 'hate, hate, human, Heng, He, Huang, Hong, Hong, He, Hu, Zhou, Hu when the flowers and plants are full of water, the numbers of Huai xiaohuai and Huai Xiaoyu are still busy. huang Ye is a gray hacker, and his emblem is restored. He regrets hui and Yun. He will be a zombie. zookeeper-based computer abnormality-Zookeeper muscle weakness-Zookeeper Ji and Ji for the sacrifice, please do not worry about the death of your wife, Jia, and Jia, the master has been downgrading the jiajiao Jiao Tong and chews the food. jie Jin jie Xiao jing JU I decided to accept all the bacteria. Jun Kai-kakakha, gun, and Kai-Chen published the magazine Kan kan cut to see Kang Yi's anti-Kang Yu test, copy, and bake. ke cakeke ke Xiao kong A wide range of box-shaped Q & A, a helmet, and a kubernetes, A kubernetes. there are a number of different types of data. li lian Yi Ling Liang He he said ling Linlin Li Linlin Ling there is a wide range of problems in the market. the rate of chlorine production is very small. are you sure you want to make sure that you are too busy? no mei Miao, Meng Miao, Meng Miao, Miao, Mi Min miao Min mo mo mo Mu na which is a Mu Na Mu na yi ne Nai milk Nai Nan Han Ma Mu how about neeness nianyu nianye scalpers and cool moles and moles Nuu Nuan Nui '; s_str3: = 'Hey, you are afraid of panpan pan accompanied by Pei spray basin bang peng pi peng float coupons glance fight frequency poor products hire ping po pu during the exposure period, Qi qianqian Qian qiaoqiqiao cut eggplant and steal Qin poultry sleeping qinqing light hydrogen qingqing qing cyanogen qing Qiong poor Qiu seeking prison zookeeper district maggot qu drive Qu Yu qu to circle Quan Jie yi but que skirt group Ran the hustle and bustle of the earth make Rao disturbing the hot man Ren recognize the blade when throwing still sun Rong soft meat Ru Ruyi Ru fusoft yarui ruirui ruirun if the weak Sasa Gill s sai three umbrellas sansong funeral ssao sweep sierse Sensa sand Sasha Sha silly what sha screening Sun Shan Delete Shan shen Sheng Shi corpse shiya Shi shoushou Shou Shu brush and drop handsome tie Shuang who water sleep tax suck shun say Shuo si song sent song changsong search ship Su the so lock collapsed. He's her tutty, her tutty, her tuttan, Tan if you lie down in tangtang tang he tao he escaped to discuss sets of special Teng he ti tian Miao Yi pick a piece of yellow jump tie Hall listen to Ting boat Tong ketone pupil Tongtong bucket stab tube system pain stealing head convex bald Tutu tutuo Tuo tuyu Wawa wa so wan Wang Wei wei Wen Wei wuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwu xi Xia Xian XI xian Xiang Ma xiao '; t_str3: = 'Hey, peat, peat, panic, panic, Pan accompanied by Pei peng Ling piao ping po pu during the exposure period, Qi just in a timely fashion, I am sorry for the loss of money. she and Qinqin Qin qing Qiu prisoner qu Quan jie Zheng que skirt Ran attackers can throw the sun to throw the sun, Rong Fu RuO soft meat Ru Ruyi Ru insult milk rub into the Fuxi Yan ruirui zookeeper if the weak deployment of zookeeper three zookeeper scattered zookeeper Samson Sasa sansha Musha what silly Sha Sun Shan Xi Xiao Shao the snake tongue and the tongue have been attacked, and the Community has set up an arsenic application. The body of the body is deeply rooted in the spirit of Shen Ming, and he is very careful when the birth of the animal is promoted, and the province has been used for loss. shi Xiaoyi Shishi Shi Xi Shi the shoushoushoushoushoushoushoushoushoushoushoushoushoushou shoushou Shou Shu shushu, playing, drop, tie, shushuang, shushuang, water, sleep, suck, instant, Shun, say, shuosi si similar to zookeeper, Su the tunnel has been used by a shuttle, and the cable used has collapsed. She has been using the tlab to carry the tlab. tangtang tang he tao Xiao tang tong the shoot layer is used to shave and fill in Tian, lick it, pick it up, and snap it up. The post is a record of Ting Tong bucket stab tube system pain shot through the convex burst Tutu turbulent tugo push legs fade back swallowed Tun hip tutuo Tuo dig wawawawa WAA WAF wei Wen Wei Xi Su I have been holding the wowo, Wu, Wu Xi xi se Si Xi xianxiang I want to enjoy the oak statue in the Xiangxiang district '; s_str4: = 'xiao Xiao xing Xi Xiu xuXu xuxuan Xuan xuexiao Xue Xun crow duck ya Yan yan Yang page Yi ye yi yi Yin Ying ying Yong youyou youyouyu Youyu youyouyouyouyouyouyouyouyouyouyouyouyouyouyouyouyouyouyouyouyouyouyouyouyouyouyou yu yu Yuan Yue yun Xi zai again in my temporarily likes dirty burial by bad chisel algae jujube early bath flea noise soap stove dry responsibility how to increase the number of thieves in Zeze? I once presented the Zha jizang slag rolling and rolling the brakes, and how to crack the scam? Pick the Zhai's narrow debts. Zhai Zhan felt Zhan sticks to Zhan ti Zhan dip stack zhanzhan Zhan zhangzhang zhangzhangzhangzhangzhangzhangzhangzhangzhangzhangzhangzhangzhangzhangzhangzhang account zhanzhan expansion and obstacle zhazhao Zhao looking for Marsh Zhao cover Zhe zhe ge cane this zhen Zheng zhizhizhizhizhizhizhizhizhizhizhizhizhizhizhizhizhizhizhizhizhizhizhizhizhizhizhizhizhizhizhizhizhizhongzhongzhongzhong final swelling zhongzhong Zhongzhou Zhou Piao porridge axis elbow curse wrinkle Zhouzhou day burst Zhu Piao Zhu pig Zhu candle boil foresight Zhu living in the notice I wish to grasp the claw drag proprietary bricks to create and earn the pile Zhuang makeup hit the zhuanglike vertebral cone chasing actor pendant repair quasi catch Zhuo table Zhuo sub-capital consultation zi zuo Zuozuo was sitting in his seat, and he was very nervous. zookeeper zookeeper zookeeper has been in the queue for a long time. there are two major challenges: there are two different types of images. he is a senior hacker, a hacker, a hacker when there are many other regions and regions around the border '; t_str4: = 'xiao Xiao Xie Xiao xing Xiong Xiu Shu Xi XU Xu xuXu XU Xu Xuan jian Xue Xun yan yanyan yundun ye yanye Yizhi Yanyi Yizhi Yayi Yizhi yi Zheng Yi yi ying Yong Yu yu. yu Yuan yue, Yue, Yu, Yun, Yun, Yu, Yu how can I increase the number of hot spots in the morning when I have a noisy soap stove? How can I find the hot spots? zhai Zhan zhangzhangzhang Zhan HUANG Zhao looking for Marsh Zhao zhao cover Zhe Zhen Zheng zhizhi zhijiao Zhizhi zhizhi zhongzhong Zhongshu zhongzhong Zhongzhou Zhouzhou pizhou Piao porridge elbow curse Zhuzhou zhuzhu the main pillar of the worker is used to help the worker to build the system. Note: I wish to grab the claw and pull it. quasi-catch Zhuo table Zhuo Qian Zhuo Yu Zi zuozu zuochu please refer to the following example: please refer to the following link for more information: please refer to the following link for more information: please refer to the following link for more information: please refer to the following link for more information: there are too many attempts to be made between them '; s_str5: = 'zookeeper, Zookeeper and zookeeper there is no such thing as this. the vast numbers of consumers are very large. chicory pear peilane peilar please refer to the following link for more information: please refer to the following: taproprome tainii taproprome zookeeper yundun he was a hacker, a hacker. click here and then click it. even though I have been using oxadiazoles, I have been lying in the middle of the world. why? there is a huge amount of money in the market. there are two major problems in the future. he is a programmer of mine. please refer to the following examples for the following: i'm sorry, I'm sorry. even though the system was stunned, there was no such problem. zookeeper and zookeeper i'm sorry for the problem. even if you have a large number of zookeeper in the United States, there are two types of zookeeper in the United States. there are two major problems in the future. please refer to the following link for more information: she was a girl, she was a girl, she was a girl. zookeeper and zookeeper '; t_str5: = 'zookeeper zookeeper even though we have been making a huge mistake the vast numbers of consumers are very large. chicory pear Pear please refer to the following link for more information: please refer to the following: taproprome tainii taproprome zookeeper zookeeper and zookeeper he was a hacker. click here and then click here. even though I have been using oxadiazoles, I have been lying in the middle of the world. why? zookeeper zookeeper and zookeeper there are two major causes for this problem: there is a sudden increase in the number of zookeeper and zookeeper. please refer to the following link for more information: please refer to the following link for more information: I was stunned, and I was surprised when I was surprised. zookeeper was the prime minister of the Communist Party of China. i'm sorry for the problem. even if you have a large number of zookeeper in the United States, there are two types of zookeeper in the United States. there are two major problems in the future. please refer to the following link for more information: she was a girl, she was a girl, she was a girl zookeeper was born with zookeeper '; s_str6: = 'zookeeper, Zookeeper, and zookeeper. there is no such thing wei Yu, Xiao Ke, Xiao Yu, Xiao Huang these two websites are the most popular websites. zookeeper and zookeeper of the Communist Party of China zookeeper Maidan maifan Mahayana I have been a doctor of the Communist Party of China. there are always some flaws in the market. huang Hui, Huang, Yu zookeeper zookeeper injection of uranium chloride, argon, argon, and zookeeper zookeeper zookeeper phosphorus Deficiency zookeeper hub zookeeper stew zookeeper please refer to the following link for more information: even though they have been found zookeeper is the largest region in the United States. | the amount of indium in the United States is very small. zookeeper zookeeper cadmium engraved zookeeper please refer to the following link for more information: zookeeper zookeeper and zookeeper zookeeper and zookeeper very cute, very cute, and very cute. zookeeper and zookeeper and the chin of the jaw and the temporal lobe of zookeeper zookeeper zookeeper lizard '; t_str6: = 'zookeeper zookeeper please refer to the following link for more information: zookeeper zookeeper OF THE UNITED STATES xuanjicang is a very popular solution. there are two major challenges: zookeeper nianissima Niang Niigata seasma taomiao tailu tailun tailu there are too many large numbers of small numbers please refer to the following link for more information: I have been reading this article for some time. zookeeper zookeeper zookeeper zookeeper there is a huge amount of phosphorus in the market. zookeeper, Zookeeper and zookeeper in addition I have been reading this article for many years. there are just a few moments in the market. please refer to the following link for more information: please refer to the following link for more information: please refer to the following link for more information: please refer to the following link for more information: please refer to the following link for more information: if you fail to renew your account, you must renew your account. they are very cute. They are very cute. zookeeper zookeeper zookeeper zookeeper lizard '; s_str7: = 'zookeeper zookeeper inspector there is no such thing zookeeper zookeeper zookeeper and zookeeper zookeeper ransomware is a Chinese medicine product. I have been reading this article for some time. please refer to the following link for more information: catfish (catfish) Catfish (crocodile) Catfish (catfish) catfish keywords: I have been deprecated by yundun, and have been waiting for a long time '; t_str7: = 'zookeeper zookeeper zookeeper and zookeeper have been released. please refer to the following link for more information: zookeeper and zookeeper zookeeper and zookeeper zookeeper ransomware is a type of zookeeper, which is a type of fermented grains. there are two major causes for this problem: please refer to the following link for more information: in addition there are too many zookeeper there are two major problems in the process of clinical discovery: I have been deprecated by yundun, and have been waiting for a long time ';

for i in 1.. length(s_str1)   loop    insert into chineseword values(substr(s_str1,i,1), substr(t_str1, i, 1));   end loop;      for i in 1.. length(s_str2)   loop    insert into chineseword values(substr(s_str2,i,1), substr(t_str2, i, 1));   end loop;      for i in 1.. length(s_str3)   loop    insert into chineseword values(substr(s_str3,i,1), substr(t_str3, i, 1));   end loop;      for i in 1.. length(s_str4)   loop    insert into chineseword values(substr(s_str4,i,1), substr(t_str4, i, 1));   end loop;      for i in 1.. length(s_str5)   loop    insert into chineseword values(substr(s_str5,i,1), substr(t_str5, i, 1));   end loop;      for i in 1.. length(s_str6)   loop    insert into chineseword values(substr(s_str6,i,1), substr(t_str6, i, 1));   end loop;      for i in 1.. length(s_str7)   loop    insert into chineseword values(substr(s_str7,i,1), substr(t_str7, i, 1));   end loop;      commit;      EXCEPTION     WHEN NO_DATA_FOUND THEN       NULL;     WHEN OTHERS THEN       -- Consider logging the error and then re-raise       RAISE;END insertchineseword; 

 

Finally, write a function to replace simplified and traditional Chinese characters.

Create or replace function trans_chinese (p_inputstr in varchar2, p_inputtype in number) return varchar2 isv_ret varchar2 (300): = ''; I INT: = 0; v_str varchar2 (3 ); v_count INT: = 0; /*************************************** * *********************************** name: transform_chinese purpose: parameters: p_inputtype = 0 ==> simple Chinese transform to Tradition Chinese p_inputtype = 1 ==> Tradition Chinese transform to simple Chinese revisions: ver Date Author description --------- ---------- --------------- ------------------------------------ 1.0 1. created this function. notes: automatically available auto replace keywords: Object Name: transform_chinese sysdate: Date and Time: 10:29:10, and 10:29:10 Username: (set in Toad options, procedure editor) table Name: (set in the "New PL/SQL object" dialog) **************************************** * ***********************************/begin if p_inputstr is null or p_inputstr = ''then return NULL; end if; If p_inputtype = 0 then for I in 1 .. length (p_inputstr) loop select count (*) into v_count from chineseword where simpleword = substr (p_inputstr, I, 1 ); if v_count> 0 then select traditionword into v_str from chineseword where simpleword = substr (p_inputstr, I, 1); v_ret: = v_ret | v_str; else v_ret: = v_ret | substr (p_inputstr, I, 1); end if; end loop; else for I in 1 .. length (p_inputstr) loop select count (*) into v_count from chineseword where traditionword = substr (p_inputstr, I, 1 ); if v_count> 0 then select simpleword into v_str from chineseword where traditionword = substr (p_inputstr, I, 1); v_ret: = v_ret | v_str; else v_ret: = v_ret | substr (p_inputstr, I, 1); end if; end loop; end if; return v_ret; Exception when no_data_found then NULL; when others then -- consider logging the error and then re-raise; end trans_chinese;

Example:

Select trans_chinese ('ours ', 0) from dual

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.