Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Conversion from oracle json to Damien json

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Oracle side:

CREATE VIEW "FJMP". "MP_ATTEND_APPLY_ALL_VIEW" ("ATTEND_ID", "ATTEND_TYPE", "ATTEND_NAME", "PERSON_CODE", "PERSON_NAME", "APPLY_FALG", "APPLY_DATE", "APPRAISE_LEVEL", "APPRAISE_DATE", "APPRAISE_FLAG", "STR1", "STR2", "STR3", "STR4", "APPLY_FALG_NAME")

AS

SELECT A. ATTENDpressed TYPEL A. ATTENDPROTENCHAR (APPRAISE_DATE,'YYYY-MM-DD') CHAR (ATTENDELL) APPRAISE_DATE,APPRAISE_FLAG

JSON_ARRAY (

JSON_OBJECT (

KEY 'title' VALUE' "applicant" 'FORMAT JSON

KEY 'content' VALUE' "'| | REPLACE (PERSON_NAME,'-','-') | |'" 'FORMAT JSON)

JSON_OBJECT (

KEY 'title' VALUE' "Application time" 'FORMAT JSON

KEY 'content' VALUE' "'| TO_CHAR (A.APPLYcopyright date) | |" 'FORMAT JSON)) |

JSON_OBJECT (

KEY 'title' VALUE' "destination" 'FORMAT JSON

KEY 'content' VALUE' "'| | B.DESTIN_ADDR | |'" 'FORMAT JSON)

JSON_OBJECT (

KEY 'title' VALUE' "apply for use" 'FORMAT JSON

KEY 'content' VALUE' "'| | B.CONTENT | |'" 'FORMAT JSON)

) STR1,'' STR2,'' STR3,'' STR4

-- 'applicant:' | | PERSON_NAME STR1,' application time:'| | TO_CHAR (A.ApplyDATEGravity YYYMMI DD') STR2,' destination:'| | B.DESTIN_ADDR STR3,' File Abstract:'| | SUBSTR (B.CONTENT.1Jue 20) | | '...' STR4

DECODE (APPLY_FALG,'0',' has not been approved','1 has been approved','2 has failed', and'3 has been revoked') APPLY_FALG_NAME

FROM MP_ATTEND A,MP_ATTEND_APPLY_CAR B

WHERE A.ATTEND_ID=B.ATTEND_ID

Da Mengduan:

CREATE VIEW "FJMP". "MP_ATTEND_APPLY_ALL_VIEW" ("ATTEND_ID", "ATTEND_TYPE", "ATTEND_NAME", "PERSON_CODE", "PERSON_NAME", "APPLY_FALG", "APPLY_DATE", "APPRAISE_LEVEL", "APPRAISE_DATE", "APPRAISE_FLAG", "STR1", "STR2", "STR3", "STR4", "APPLY_FALG_NAME")

AS

SELECT A. ATTENDpressed TYPEL A. ATTENDPROTENCHAR (APPRAISE_DATE,'YYYY-MM-DD') CHAR (ATTENDELL) APPRAISE_DATE,APPRAISE_FLAG

'{[

{

"title": "applicant"

"content": "'| | REPLACE (PERSON_NAME,'-','-') | |'"}

{

"title": "Application time"

"content": "'| TO_CHAR (A.APPLYMuMMI DD') |'"}

{

"title": "destination"

"content": "'| | B.DESTIN_ADDR | |'"}

{

"title": "Application for use"

"content": "'| | B.CONTENT | |'"}]

} 'STR1,'' STR2,'' STR3,'' STR4

-- 'applicant:' | | PERSON_NAME STR1,' application time:'| | TO_CHAR (A.ApplyDATEGravity YYYMMI DD') STR2,' destination:'| | B.DESTIN_ADDR STR3,' File Abstract:'| | SUBSTR (B.CONTENT.1Jue 20) | | '...' STR4

DECODE (APPLY_FALG,'0',' has not been approved','1 has been approved','2 has failed', and'3 has been revoked') APPLY_FALG_NAME

FROM MP_ATTEND A,MP_ATTEND_APPLY_CAR B

WHERE A.ATTEND_ID=B.ATTEND_ID

Note: (Dameng)

1. The whole json needs to be enclosed in single quotation marks

two。 Format of processing function: "'| | sysdate | |'"

3. Objects use braces {}, arrays use square braces []

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 291

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report