Oracle

How can I change the SID of an Oracle XE instance

半世苍凉 提交于 2021-02-04 12:11:49
问题 I needed to change the SID of an Oracle XE database (not the Service Name) to match a production database. When I tried searching online, most of the pages were describing changing or adding a service name through tnsnames.ora; that's not what I needed to do. 回答1: The asktom article has the answer, but the formatting and verbosity makes it hard to follow, so here's a summary: [XE_HOME] means where Oracle XE is installed. Normally this is C:\oraclexe\app\oracle\product\10.2.0\server . Make

Connect by in Oracle SQL

穿精又带淫゛_ 提交于 2021-02-04 12:09:34
问题 Suppose that we have following tables create table Employee( 2 EMPNO NUMBER(3), 3 ENAME VARCHAR2(15 BYTE), 4 HIREDATE DATE, 5 ORIG_SALARY NUMBER(6), 6 CURR_SALARY NUMBER(6), 7 REGION VARCHAR2(1 BYTE), 8 MANAGER_ID NUMBER(3) 9 ) and create table job ( 2 EMPNO NUMBER(3), 3 jobtitle VARCHAR2(20 BYTE) 4 ) 5 / I am interested in what the below query does SELECT empno, manager_id, ename 2 FROM employee 3 START WITH empno = 1 4 CONNECT BY PRIOR empno = manager_id; As I understood this code selects

Connect by in Oracle SQL

戏子无情 提交于 2021-02-04 12:09:23
问题 Suppose that we have following tables create table Employee( 2 EMPNO NUMBER(3), 3 ENAME VARCHAR2(15 BYTE), 4 HIREDATE DATE, 5 ORIG_SALARY NUMBER(6), 6 CURR_SALARY NUMBER(6), 7 REGION VARCHAR2(1 BYTE), 8 MANAGER_ID NUMBER(3) 9 ) and create table job ( 2 EMPNO NUMBER(3), 3 jobtitle VARCHAR2(20 BYTE) 4 ) 5 / I am interested in what the below query does SELECT empno, manager_id, ename 2 FROM employee 3 START WITH empno = 1 4 CONNECT BY PRIOR empno = manager_id; As I understood this code selects

Connect by in Oracle SQL

拈花ヽ惹草 提交于 2021-02-04 12:08:38
问题 Suppose that we have following tables create table Employee( 2 EMPNO NUMBER(3), 3 ENAME VARCHAR2(15 BYTE), 4 HIREDATE DATE, 5 ORIG_SALARY NUMBER(6), 6 CURR_SALARY NUMBER(6), 7 REGION VARCHAR2(1 BYTE), 8 MANAGER_ID NUMBER(3) 9 ) and create table job ( 2 EMPNO NUMBER(3), 3 jobtitle VARCHAR2(20 BYTE) 4 ) 5 / I am interested in what the below query does SELECT empno, manager_id, ename 2 FROM employee 3 START WITH empno = 1 4 CONNECT BY PRIOR empno = manager_id; As I understood this code selects

Connect by in Oracle SQL

风流意气都作罢 提交于 2021-02-04 12:08:27
问题 Suppose that we have following tables create table Employee( 2 EMPNO NUMBER(3), 3 ENAME VARCHAR2(15 BYTE), 4 HIREDATE DATE, 5 ORIG_SALARY NUMBER(6), 6 CURR_SALARY NUMBER(6), 7 REGION VARCHAR2(1 BYTE), 8 MANAGER_ID NUMBER(3) 9 ) and create table job ( 2 EMPNO NUMBER(3), 3 jobtitle VARCHAR2(20 BYTE) 4 ) 5 / I am interested in what the below query does SELECT empno, manager_id, ename 2 FROM employee 3 START WITH empno = 1 4 CONNECT BY PRIOR empno = manager_id; As I understood this code selects

Why is static ddl not allowed in PL/SQL?

感情迁移 提交于 2021-02-04 11:38:06
问题 In an Oracle PL/SQL block, why is dynamic sql allowed begin execute immediate 'drop table table_name'; end; but static is not? begin drop table table_name; end; I hope the answer is more insightful than "because that's how the language works". 回答1: The answer is PL/SQL does not support dynamic polymorphism. it only supports static polymorphism because All PL/SQL generats a "DIANA" -> Descriptive Intermediate Attributed Notation for Ada , a tree-structured intermediate language. DIANA is used

Duration of data in a Global Temporary table?

孤人 提交于 2021-02-04 10:25:07
问题 Can someone please tell me: how long will data be there in a Global Temporary table? 回答1: They can be SESSION based (data survives a commit but not a disconnect/reconnect). They can also be TRANSACTION based (data disappears after a commit). This creates a transaction based temp table: create global temporary table temp_table_transaction on commit delete rows ... This creates a session based temp table: create global temporary table temp_table_transaction on commit preserve rows ... 回答2: When

Duration of data in a Global Temporary table?

ぐ巨炮叔叔 提交于 2021-02-04 10:24:52
问题 Can someone please tell me: how long will data be there in a Global Temporary table? 回答1: They can be SESSION based (data survives a commit but not a disconnect/reconnect). They can also be TRANSACTION based (data disappears after a commit). This creates a transaction based temp table: create global temporary table temp_table_transaction on commit delete rows ... This creates a session based temp table: create global temporary table temp_table_transaction on commit preserve rows ... 回答2: When

C#: Object cannot be cast from DbNull to other types

孤街浪徒 提交于 2021-02-04 08:41:45
问题 I have read several posts on this online, but none of them have resolved my issue. Most of the questions posted online point me towards checking Dbnull values from the database and I am doing that in the code. Here's the code where the exception is thrown: int rowNum = Convert.ToInt32(dataTable.Rows[r][dataTable.Columns.Count - 2]); Here's the code where I am checking for the dbnull values: for (int r = 0; r < dataTable.Rows.Count - 1; r++) //rows { for (int c = 1; c < dataTable.Columns.Count

Create oracle scheduler job

倾然丶 夕夏残阳落幕 提交于 2021-02-04 08:34:28
问题 Is there any way to create oracle scheduler job that works (begin and end of some procedure) every day, five times a day at 8,10,12,14,16? 回答1: Use this interval definition: 'freq=daily;byhour=8,10,12,14,16;byminute=0' So the full code to create the job would be something like: DBMS_SCHEDULER.create_job( job_name => 'the_job', job_type => 'STORED_PROCEDURE', job_action => 'YOUR_PROCEDURE', repeat_interval => 'freq=daily;byhour=8,10,12,14,16;byminute=0', enabled => TRUE); 来源: https:/