oracle11g

how to divide the columns in result of query in oracle database

本秂侑毒 提交于 2020-01-17 17:05:21
问题 want to split the columns in result of query dynamically, how can i? i have three tables and joined them.to get the required columns. select distinct t1.sal,t1.cat,t2.id,t3.shop from t_table1 t1, t_table2 t2, t_table3 t3, where t1.sno=t2.sno AND t2.cat=t3.cat t3.dept_no=t3.dept_no **output:** t1.sal t1.cat t2.id t3.shop 1900 34R5 10 dense 1900 34r5 10 SVM 1900 34r5 10 bpo 2345 3ER4 11 kpo 2345 3ER4 11 infra 12345 34F4 12 const **desired output:** t1.sal t1.cat t1.tin t2.id t3.shop_1 t3.shop_2

how to divide the columns in result of query in oracle database

↘锁芯ラ 提交于 2020-01-17 17:02:26
问题 want to split the columns in result of query dynamically, how can i? i have three tables and joined them.to get the required columns. select distinct t1.sal,t1.cat,t2.id,t3.shop from t_table1 t1, t_table2 t2, t_table3 t3, where t1.sno=t2.sno AND t2.cat=t3.cat t3.dept_no=t3.dept_no **output:** t1.sal t1.cat t2.id t3.shop 1900 34R5 10 dense 1900 34r5 10 SVM 1900 34r5 10 bpo 2345 3ER4 11 kpo 2345 3ER4 11 infra 12345 34F4 12 const **desired output:** t1.sal t1.cat t1.tin t2.id t3.shop_1 t3.shop_2

LIKE statement taking too long

老子叫甜甜 提交于 2020-01-17 07:15:05
问题 Please see the DDL below: create table #VRMs (ID INT, VRM VARCHAR(10)) INSERT INTO #VRMs VALUES (1,'VRM1') INSERT INTO #VRMs VALUES (1,'VRM2') INSERT INTO #VRMs VALUES (1,'VRM3') The users want to be able to search for VRMs like this: select * from #VRMs where VRM LIKE '%VRM1' The problem is that there are 100,000,000 rows in this table and the queries are taking far too long. I have come across this question: https://stackoverflow.com/questions/33210269/like-statement-taking-too-long

UPDATE and DELETE in same SQL in multiple tables?

心不动则不痛 提交于 2020-01-17 06:32:26
问题 With Oracle DB, is it possible to update one table and delete (matching rows) in other? I tried various forms of MERGE but I get either: ORA-01446: cannot select ROWID from, or sample, a view with DISTINCT, GROUP BY, etc. (probably caused by UNION ALL in the view) or ORA-38106: MERGE not supported on join view or view with INSTEAD OF trigger. This ("join view") suggests that specifying two tables in any form is a no-go for MERGE . Is that correct? (the reasons for using a single statement are

Read POST data from Oracle Forms App

本小妞迷上赌 提交于 2020-01-17 04:26:45
问题 I am trying to receive some http POST data in my Oracle Forms app. How can I read this sent POST parameters from my Forms app? Note: To read http-GET Data I use otherparams like this answer, but is fundamental to send data via POST http method 回答1: Efectively as @Christian13467 mentioned, for Oracle Forms is very indifferent how HTTP vars were sent, that is using POST or GET Methods. My solution was to build an string containing all my vars concatenated as in otherparams format, then send it

Pass datatable to refcursor of Oracle stored procedure

落爺英雄遲暮 提交于 2020-01-17 03:53:25
问题 I am using ODP.NET and Oracle 11g client. I am passing a datatable to a procedure with a refcursor as input. dtSample is DataTable with four columns called Type , Name , Size and Description . I got error Invalid parameter binding, Parameter name: ParameterName at the line db.ExecuteNonQuery(oracleCommand); Full code: OracleCommand oracleCommand = new OracleCommand(); oracleCommand.CommandType = CommandType.StoredProcedure; oracleCommand.CommandText = "PCK_ADMIN.PROC_INS"; oracleCommand

Exclude values from oracle partition

喜欢而已 提交于 2020-01-17 03:29:27
问题 I want to use a Composite Range-List Partitioning in oracle. Using a range is pretty clear to me. The tricky part is on the list partition and this is where i have the question. Let's assume we have a column with continents. I want the list partition that to include all the continents that are NOT Europe. The problem here is that i cannot create a list partition including all other continents except of Europe, as at some point i might add new continents. Is something like this possible? 回答1:

Error while passing email inside utl_mail.send (Oracle 11g - sql) 06502 - 06512

拥有回忆 提交于 2020-01-16 19:36:26
问题 I am getting this error message: Error at line 1 ORA-06502: PL/SQL: numeric or value error ORA-06512: in "SYS.UTL_MAIL", line 654 ORA-06512: in "SYS.UTL_MAIL", line 671 ORA-06512: in "APPS.PR_MAIL_ME", line 44 ORA-06512: in line 2 This is my code, my cursor: cursor email_detail is select email from ( <the subquery> ) where rn = 1 and status in ('WARNING','ERROR','STAND BY'); Then, i want to pass every single email inside utl_mail.send function using a LOOP begin for c in email_detail loop

What is the limit for varchar2 in a Table of Type in Oracle?

耗尽温柔 提交于 2020-01-16 18:54:27
问题 I am looking for the limit of the varchar2 type as far as a Table of type is concerned in oracle. Note that I am not talking about a physical table (for which the limit for varchar2 is 4000) but the table of a type. Thanks 回答1: It depends on the context. A table of VARCHAR2(32767) can be created anywhere. But 32767 can only be used in PL/SQL. The limit in SQL is still 4000. SQL> --#1: SQL, 4000. SQL> create or replace type varchar2_limit is table of varchar2(4000); 2 / Type created. SQL>

What is the limit for varchar2 in a Table of Type in Oracle?

邮差的信 提交于 2020-01-16 18:54:05
问题 I am looking for the limit of the varchar2 type as far as a Table of type is concerned in oracle. Note that I am not talking about a physical table (for which the limit for varchar2 is 4000) but the table of a type. Thanks 回答1: It depends on the context. A table of VARCHAR2(32767) can be created anywhere. But 32767 can only be used in PL/SQL. The limit in SQL is still 4000. SQL> --#1: SQL, 4000. SQL> create or replace type varchar2_limit is table of varchar2(4000); 2 / Type created. SQL>