Skip to Main Content

Oracle Developer Tools for VS Code

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

New Release: 19.3.3. Lots of features! Try it out and let us know what you think

Christian.Shay -OracleOct 1 2020 — edited Oct 8 2020

Please let me know what you think.
We have added SQL*Plus support. See these web pages:
SQL*Plus common commands: https://www.oracle.com/database/technologies/appdev/dotnet/odtvscodesqlplus.html
SQL*Plus Reference:
https://www.oracle.com/database/technologies/appdev/dotnet/odtvscodesqlplusref.html
More features from the changelog:
Changes in version 19.3.3
Connection Dialog enhancements: Set/Change the current schema, improved proxy user connection UI
Improved connection failure detection with an option to reconnect
Support for macOS connections to Oracle Autonomous Database over TLS
Support for database connections using LDAP
Browse other schemas ("Other Users" node) in Oracle Explorer tree control
SQL History and Bookmarks
Limited SQL*Plus support
Detection and warning of unsupported SQL*Plus commands in scripts (and child scripts)
SQL*Plus CONNECT command associates the file with a connection
Preservation of all session associated properties from execution to execution
Autocommit On/Off setting
Autocompletion of SQL*Plus commands
Autocompletion of procedure/function parameters
Intellisense/Autocomplete performance enhancements
Syntax coloring for SQL and PL/SQL keywords and SQL*Plus commands/variables
Append new results to existing results window
Toolbar buttons to cancel running query and to clear results window
Setting to automatically clear results window after each execution
Remember previous selections in some UI elements and offer as defaults
Support for REFCURSOR variables and implicit cursors
Visual Studio Code theme support for Light/Dark/High Contrast themes

Comments

Paulzip

This looks like a half house JSON document. Is this actual document JSON?

Paulzip

Here you go, something like this. I'm splitting on the braces, rather than the content.

with data(clb) as (
 select 
'{

adam smith

class:abcd

}

{

xxxyyyy

class:abcd

}

{

zzzz

class:abcd

}'
 from dual 
)
, sections(num, clb, start_, end_) as (
 select level, clb, instr(clb, '{', 1, level), instr(clb, '}', 1, level)
 from data
 connect by instr(clb, '}', 1, level) > 0
)
select num, substr(clb, start_, end_-start_+1) str
from sections
aetl

Hello Paulzip,

Your code is working correctly but i couldn't explain my problem.Yes it is an actual json .Here is a sample jscon code. i have a json file like this . When i tried to insert this it raised check constraint error . Becasue there are two "_id" values .İf i insert id by id not in same time it worked .İ want to split braches every "class_..."

{
"_id" : "1000099721",
"id" : [
{
"value" : "55555",
"schemeName" : "MSISDN",
"schemeAgencyName" : "xx"
},
{
"value" : "12416408",
"schemeName" : "CustomerId",
"schemeAgencyName" : "xx"
},
{
"value" : "441630",
"schemeName" : "OTP",
"schemeAgencyName" : "xx"
}
],
"_class" : "model.salesorder.SalesOrderVBO"
}
{
"_id" : "1000099721",
"id" : [
{
"value" : "6666",
"schemeName" : "MSISDN",
"schemeAgencyName" : "xx"
},
{
"value" : "12416408",
"schemeName" : "CustomerId",
"schemeAgencyName" : "xx"
},
{
"value" : "441630",
"schemeName" : "OTP",
"schemeAgencyName" : "xx"
},
{
"value" : "ffa357ee-9759-42ab-8a98-30ea9d410319",
"schemeName" : "ShoppingCartId",
"schemeAgencyName" : "xx"
},
{
"value" : "1000099721",
"schemeName" : "OrderId",
"schemeAgencyName" : "xx"
}
],
"_class" : "model.salesorder.SalesOrderVBO"
}

BluShadow

So, as it's actual JSON you're dealing with, have you considered using the Oracle built-in functionality for JSON data?
JSON Developer's Guide (0 Bytes)

Paulzip

Then why didn't you say it was JSON rather than post an example that wasn't? It just wastes people, like myself's time.

Which Oracle version?

aetl

Oracle 12.2

Paulzip
Answer

Again, your JSON isn't valid. It's an array and you don't have an array marker around it or a comma between the array items. You need to take more care in your posts.

with data(jsn) as (
 select 
 '[ 
  {
  "_id":"1000099721",
  "id":[
   {
     "value":"55555",
     "schemeName":"MSISDN",
     "schemeAgencyName":"xx"
   },
   {
     "value":"12416408",
     "schemeName":"CustomerId",
     "schemeAgencyName":"xx"
   },
   {
     "value":"441630",
     "schemeName":"OTP",
     "schemeAgencyName":"xx"
   }
  ],
  "_class":"model.salesorder.SalesOrderVBO"
}
,{
  "_id":"1000099721",
  "id":[
   {
     "value":"6666",
     "schemeName":"MSISDN",
     "schemeAgencyName":"xx"
   },
   {
     "value":"12416408",
     "schemeName":"CustomerId",
     "schemeAgencyName":"xx"
   },
   {
     "value":"441630",
     "schemeName":"OTP",
     "schemeAgencyName":"xx"
   },
   {
     "value":"ffa357ee-9759-42ab-8a98-30ea9d410319",
     "schemeName":"ShoppingCartId",
     "schemeAgencyName":"xx"
   },
   {
     "value":"1000099721",
     "schemeName":"OrderId",
     "schemeAgencyName":"xx"
   }
  ],
  "_class":"model.salesorder.SalesOrderVBO"
}
]'
from dual
)
select c.*
from data d, 
   json_table (
     d.jsn
   , '$[*]'
     columns (
       order_pos for ordinality
     , id varchar2(30) path '$."_id"'
     , nested path '$[*]'
       columns (
         content varchar2(4000 byte) format json path '$'
       ) 
     )
   ) c
/

ORDER_POS    ID               CONTENT
1            1000099721       {"_id":"1000099721","id":[{"value":"55555","schemeName":"MSISDN","schemeAgencyName":"xx"},{"value":"12416408","schemeName":"CustomerId","schemeAgencyName":"xx"},{"value":"441630","schemeName":"OTP","schemeAgencyName":"xx"}],"_class":"model.salesorder.SalesOrderVBO"}
2            1000099721       {"_id":"1000099721","id":[{"value":"6666","schemeName":"MSISDN","schemeAgencyName":"xx"},{"value":"12416408","schemeName":"CustomerId","schemeAgencyName":"xx"},{"value":"441630","schemeName":"OTP","schemeAgencyName":"xx"},{"value":"ffa357ee-9759-42ab-8a98-30ea9d410319","schemeName":"ShoppingCartId","schemeAgencyName":"xx"},{"value":"1000099721","schemeName":"OrderId","schemeAgencyName":"xx"}],"_class":"model.salesorder.SalesOrderVBO"} 


Marked as Answer by aetl · Nov 27 2020
1 - 7
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Mar 20 2024
Added on Oct 1 2020
67 comments
1,640 views