This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static String toJson(DetailAST ast) throws IOException { | |
int nodeId = ROOT_NODE_ID; | |
Stack<Integer> parentNodeIdStack = new Stack<>(); | |
parentNodeIdStack.push(nodeId); // root node id | |
DetailAST currentNode = ast; | |
StringWriter writer = new StringWriter(); | |
JsonGenerator jsonGenerator = JSON_FACTORY.createJsonGenerator(writer).useDefaultPrettyPrinter(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.sql.Connection; | |
import java.sql.PreparedStatement; | |
import java.sql.ResultSet; | |
import java.sql.SQLException; | |
import java.sql.Types; | |
import java.util.HashMap; | |
import java.util.Map; | |
import javax.sql.DataSource; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WITH dates AS ( | |
select distinct FS_PERM_SEC_ID, | |
sieve2.utils_pkg.sv_businessday(sysdate-1) D0, | |
sieve2.utils_pkg.add_businessdays(sysdate, -5) D7, | |
sieve2.utils_pkg.sv_businessday(add_months(sysdate, -1)) M1, | |
sieve2.utils_pkg.sv_businessday(add_months(sysdate, -3)) M3, | |
sieve2.utils_pkg.sv_businessday(add_months(sysdate, -12)) Y1 | |
from THEMES.SECURITIES_MAPPING_TEMP mapping | |
) | |
select dates.fs_perm_sec_id, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select FS_PERM_SEC_ID, period, avg(p_price) avg_price from ( | |
select FS_PERM_SEC_ID, p_price, SECURITY_PRICE_DATE, 'DAY' period | |
from FSDF_PRICE_EOD.FP_BASIC_BD where FS_PERM_SEC_ID = 'XQC8FD-S-ES' and | |
SECURITY_PRICE_DATE between sieve2.UTILS_PKG.add_businessdays(sysdate, -1) and sysdate | |
union all | |
select FS_PERM_SEC_ID, p_price, SECURITY_PRICE_DATE, 'WEEK' period | |
from FSDF_PRICE_EOD.FP_BASIC_BD where FS_PERM_SEC_ID = 'XQC8FD-S-ES' and | |
SECURITY_PRICE_DATE between sieve2.UTILS_PKG.add_businessdays(sysdate, -7) and sysdate | |
union all | |
select FS_PERM_SEC_ID, p_price, SECURITY_PRICE_DATE, 'MONTH' period |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select FS_PERM_SEC_ID, avg(p_price) avg_price, 'DAY' period | |
from FSDF_PRICE_EOD.FP_BASIC_BD where FS_PERM_SEC_ID = 'XQC8FD-S-ES' | |
and SECURITY_PRICE_DATE between sieve2.UTILS_PKG.add_businessdays(sysdate, -1) and sysdate | |
group by FS_PERM_SEC_ID | |
UNION ALL | |
select FS_PERM_SEC_ID, avg(p_price) avg_price, 'WEEK' period | |
from FSDF_PRICE_EOD.FP_BASIC_BD where FS_PERM_SEC_ID = 'XQC8FD-S-ES' | |
and SECURITY_PRICE_DATE between sieve2.UTILS_PKG.add_businessdays(sysdate, -7) and sysdate | |
group by FS_PERM_SEC_ID | |
UNION ALL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--select sum(Megabytes) from ( | |
SELECT | |
owner, table_name, TRUNC(sum(bytes)/1024/1024) Megabytes | |
FROM | |
(SELECT segment_name table_name, owner, bytes | |
FROM dba_segments | |
WHERE segment_type = 'TABLE' | |
UNION ALL | |
SELECT i.table_name, i.owner, s.bytes | |
FROM dba_indexes i, dba_segments s |
NewerOlder