This file contains hidden or 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
library(RJDBC) | |
drv <-JDBC("oracle.jdbc.driver.OracleDriver","/Users/grahn/code/jdbc/ojdbc6.jar") | |
conn<-dbConnect(drv,"jdbc:oracle:thin:@grahn-dev.us.oracle.com:1521:orcl","scott","tiger") | |
data <-dbGetQuery(conn, "select * from emp") | |
write.table(data, file="emp.csv", sep = ",", row.names=FALSE) |
This file contains hidden or 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
-- | |
-- open EMP2 tab & browse DATA tab, notice there are 2 open cursors, noting the SQL_EXEC_ID numbers | |
-- | |
PROGRAM SQL_ID SQL_EXEC_ID CURSOR_TYPE SQL_TEXT | |
------------------------------------ ------------- ----------- --------------- ------------------------------------------------------------ | |
SQL Developer apdcq2s3sxn9y 16777216 OPEN SELECT ROWID "ROWID", ORA_ROWSCN "ORA_ROWSCN", EMPNO EMPNO, | |
[email protected] (P000) apdcq2s3sxn9y 16777216 OPEN-RECURSIVE SELECT ROWID "ROWID", ORA_ROWSCN "ORA_ROWSCN", EMPNO EMPNO, | |
[email protected] (P001) apdcq2s3sxn9y 16777216 OPEN-RECURSIVE SELECT ROWID "ROWID", ORA_ROWSCN "ORA_ROWSCN", EMPNO EMPNO, | |
SQL Developer apdcq2s3sxn9y 16777217 OPEN SELECT ROWID "ROWID", ORA_ROWSCN "ORA_ROWSCN", EMPNO EMPNO, |
This file contains hidden or 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
col CURSOR_TYPE for a15 | |
col PROGRAM for a36 | |
select | |
s.program, | |
o.sql_id, | |
o.sql_exec_id, | |
o.cursor_type, | |
o.sql_text | |
from |
This file contains hidden or 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
create table emp2 as select * from emp; | |
insert into emp2 select * from emp2; | |
insert into emp2 select * from emp2; | |
insert into emp2 select * from emp2; | |
insert into emp2 select * from emp2; | |
insert into emp2 select * from emp2; | |
insert into emp2 select * from emp2; | |
commit; | |
alter table emp2 parallel 2; |
This file contains hidden or 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 RecursiveCTE (rnum) AS | |
( | |
SELECT 1 AS rnum | |
FROM dual | |
UNION ALL | |
SELECT rnum + 1 | |
FROM RecursiveCTE | |
WHERE rnum < 24 | |
) | |
SELECT rnum |
This file contains hidden or 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
library(RJDBC) | |
# | |
# set up the JDBC connection | |
# configure this for your env | |
# | |
drv <-JDBC("oracle.jdbc.driver.OracleDriver","/Users/grahn/code/jdbc/ojdbc6.jar") | |
conn<-dbConnect(drv,"jdbc:oracle:thin:@zulu.us.oracle.com:1521:orcl","grahn","grahn") | |
# | |
# import the data into a data.frame |
This file contains hidden or 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
-- | |
-- triangle_counting.sql | |
-- | |
-- get flat file from http://www.vertica.com/benchmark/TriangleCounting/edges.txt.gz | |
-- gunzip & place in /tmp | |
-- | |
create or replace directory GRAPH_DATA as '/tmp'; | |
DROP TABLE ET_EDGES; |
NewerOlder