Oracle

Insert into table from collection type oracle 12c - ORA-00902: invalid datatype

杀马特。学长 韩版系。学妹 提交于 2021-02-08 07:36:46
问题 I am using Oracle 12.1 I thought I can query the table types in 12c.I get error ORA-00902: invalid datatype when I try to execute this package. I even tried using cast multiset,but still same error. I know we can create object at database level and then query, but I don't want to. CREATE OR REPLACE PACKAGE test123 AS TYPE typ1 IS RECORD(col1 VARCHAR2(100),col2 VARCHAR2(100)); TYPE tab_typ IS TABLE OF typ1 INDEX BY BINARY_INTEGER; v_tab tab_typ; PROCEDURE p1; END; / CREATE OR REPLACE PACKAGE

Insert into table from collection type oracle 12c - ORA-00902: invalid datatype

隐身守侯 提交于 2021-02-08 07:36:04
问题 I am using Oracle 12.1 I thought I can query the table types in 12c.I get error ORA-00902: invalid datatype when I try to execute this package. I even tried using cast multiset,but still same error. I know we can create object at database level and then query, but I don't want to. CREATE OR REPLACE PACKAGE test123 AS TYPE typ1 IS RECORD(col1 VARCHAR2(100),col2 VARCHAR2(100)); TYPE tab_typ IS TABLE OF typ1 INDEX BY BINARY_INTEGER; v_tab tab_typ; PROCEDURE p1; END; / CREATE OR REPLACE PACKAGE

Oracle SQL Cross Tab Query

左心房为你撑大大i 提交于 2021-02-08 07:28:41
问题 I have a table which has the following structure and sample data: ITEM LOC STOCK 0001 KS5 10 0001 KS6 30 0002 KS5 10 0002 KS6 20 I need to query cross tab so that I get ITEM KS5 KS6 0001 10 30 0002 10 20 The LOC (KS5 and KS6) can vary and new locations can be added. How can I get the desired result? 回答1: For dynamically generated results you need some dynamic PLSQL solution, something like this procedure creating view v_list_loc : create or replace procedure p_list_loc is v_sql varchar2(32000

How to insert list as parameter from powershell to SqlPlus

橙三吉。 提交于 2021-02-08 07:24:55
问题 I have a query which is like this in a file : script.sql select * from test_table where name in (&1) This is an example of query i'm trying to make and i execute it with a power shell script which is like this : $names = '''Name1'', ''Name2''' $params = '"' + $names + '"' sqlplus -silent $username/$password@$tnsalias "@script.sql" $params Note that $names has a variable list of names But then when the script is executed, the parameter get substitute like this : former : where name in (&1) new

add record in nlog to field with dataType = date

牧云@^-^@ 提交于 2021-02-08 07:24:54
问题 I use nlog dll to write to database - oracle with entity frameWork in the line : logger.Log(logLevel, "try"); I get in the logs of nlog the following error: The literal does not match the template string the code is: SetPropGDC(LogEntity); NLog.LogLevel logLevel = SetLogLevel(Level.Debug); logger.Log(logLevel, "try"); ClearGDC(); private void SetPropGDC(LogEntity LogEntity) { GlobalDiagnosticsContext.Set(processId, LogEntity.PROCESS_ID.ToString()); GlobalDiagnosticsContext.Set("TIME_STAMP",

How to insert list as parameter from powershell to SqlPlus

此生再无相见时 提交于 2021-02-08 07:23:00
问题 I have a query which is like this in a file : script.sql select * from test_table where name in (&1) This is an example of query i'm trying to make and i execute it with a power shell script which is like this : $names = '''Name1'', ''Name2''' $params = '"' + $names + '"' sqlplus -silent $username/$password@$tnsalias "@script.sql" $params Note that $names has a variable list of names But then when the script is executed, the parameter get substitute like this : former : where name in (&1) new

add record in nlog to field with dataType = date

流过昼夜 提交于 2021-02-08 07:22:14
问题 I use nlog dll to write to database - oracle with entity frameWork in the line : logger.Log(logLevel, "try"); I get in the logs of nlog the following error: The literal does not match the template string the code is: SetPropGDC(LogEntity); NLog.LogLevel logLevel = SetLogLevel(Level.Debug); logger.Log(logLevel, "try"); ClearGDC(); private void SetPropGDC(LogEntity LogEntity) { GlobalDiagnosticsContext.Set(processId, LogEntity.PROCESS_ID.ToString()); GlobalDiagnosticsContext.Set("TIME_STAMP",

How to insert list as parameter from powershell to SqlPlus

戏子无情 提交于 2021-02-08 07:22:11
问题 I have a query which is like this in a file : script.sql select * from test_table where name in (&1) This is an example of query i'm trying to make and i execute it with a power shell script which is like this : $names = '''Name1'', ''Name2''' $params = '"' + $names + '"' sqlplus -silent $username/$password@$tnsalias "@script.sql" $params Note that $names has a variable list of names But then when the script is executed, the parameter get substitute like this : former : where name in (&1) new

How to remove 'wasted rows' after delete in Oracle SQL database

☆樱花仙子☆ 提交于 2021-02-08 07:20:18
问题 In Oracle sql database, a process in our system deleted (not truncated) approx 2 million rows from a table. This resulted in a huge number of 'wasted rows' causing the queries running on that table to take more than 9 hours which usually get over in 5 minutes. Upon checking, we found that the size of total number of actual rows was of around 2600MB whereas the overall table including 'wasted rows' had a size of 3700MB. Please let me know what is the best way to delete rows and then get rid of

oracle安装问题(win7)解决方案

有些话、适合烂在心里 提交于 2021-02-08 06:14:11
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& Command = D:\Program Files\Oracle\jdk\jre\bin/java.exe -Dsun.java2d.noddraw=true -Duser.dir=D:\Program Files\Oracle\bin -classpath ";D:\Program Files\Oracle\jdk\jre\lib\rt.jar;D:\Program Files\Oracle\jlib\ldapjclnt10.jar;D:\Program Files\Oracle\jlib\ewt3.jar;D:\Program Files\Oracle\jlib\ewtcompat-3_3_15.jar;D:\Program Files\Oracle\network\jlib\NetCA.jar;D:\Program Files\Oracle\network\jlib\netcam.jar;D:\Program Files\Oracle\jlib\netcfg.jar;D:\Program Files\Oracle\jlib\help4.jar;D:\Program Files\Oracle\jlib\jewt4.jar;D:\Program Files\Oracle\jlib