oracle18c

Creation of Oracle temporary table with same table structure to that of a existing table

若如初见. 提交于 2019-12-13 15:12:08
问题 How to create a global temporary table with same table structure to that of a existing table? I know this concept is available in SQL server like "select * into #temp123 from abc". But I want to perform the same in Oracle. 回答1: Global temporary tables in Oracle are very different from temporary tables in SQL Server. They are permanent data structures , it is merely the data in them which is temporary (limited to the session or transaction, depending on how a table is defined). Therefore, the

How to create manual JSON in Oracle 18c?

我与影子孤独终老i 提交于 2019-12-11 14:42:51
问题 I need to create manual json to send it as an input to a REST API. In past in 12c(v12.0.1.2), I was using APEX_JSON API and after doing some research found that Oracle 18c has Object Types in JSON I can't use SQL/PL_SQL functions as I need to create manual json. So can someone suggest where APEX_JSON is better or new API having JSON_OBJECT_T , JSON_ARRAY_T , etc are better in terms of performance and parsing? Here is my sample JSON which I need to create. In this JSON only routeStops array

how to calculate sum time with data type char in oracle

耗尽温柔 提交于 2019-12-10 20:00:13
问题 i am trying to create a query to sum record with data type char in oracle from 2 table different. I have table like this : table 1: name time_rent ---------------- ----------- james 07:30 name and time are char table 2: name time_expired ---------------- ----------- james 18:30 name and time are char how to display record using sum for get total time (duration), is it possible?. I coding and tested it in Oracle Live SQL with Oracle Database 18c Enterprise Edition. 回答1: WITH x AS ( SELECT t1