oracle11g

How to concat rows separated by a space in oracle?

百般思念 提交于 2021-01-29 13:18:55
问题 I am trying to concat/merge rows in a table to one single row. I tried using listagg but due to varchar limitation this doesn't work. create table tmp(word VARCHAR2(4000), lvl NUMBER); insert into tmp2 values('python',1); insert into tmp2 values('java',2); select listagg(word,' ') within group(order by lvl) as listagg_output from tmp; The output should look like python java. 回答1: What will you do with such a long string? Anyway, have a look at this example; if listagg won't work, xmlagg will.

How to access tables from a different schema in oracle 11g using django?

戏子无情 提交于 2021-01-29 09:46:36
问题 I have a user named mi_abc in oracle 11g. The user do not have any table in the database but has access to all the tables in another schema sch_abc. When I run a normal select query from sqldeveloper on the sch_abc schema from mi_abc, it works perfectly fine, but when I use django, I am always getting the error:- django.db.utils.DatabaseError: ORA-00942: table or view does not exist I tried to set the db_table = sch_abc.tableName and also set db_table = tableName but both gives me the same

ORA_ASPNET_MEM_GETALLUSERS must be declared ASP.NET MVC Oracle Providers

雨燕双飞 提交于 2021-01-29 08:04:52
问题 As per this tutorial from Oracle, I am trying to set up my application to use the Oracle Membership, Role and state providers. While in the process of setting up the membership, using the ASP.NET Admin tool, I get the following error when clicking on the "Security" tab: ORA-06550: line 1, column 15: PLS-00201: identifier 'ORA_ASPNET_MEM_GETALLUSERS' must be declared ORA-06550: line 1, column 7: PL/SQL: Statement ignored I can confirm that the identifier DOES in fact exist in the DB. I am

ORA_ASPNET_MEM_GETALLUSERS must be declared ASP.NET MVC Oracle Providers

本小妞迷上赌 提交于 2021-01-29 08:03:15
问题 As per this tutorial from Oracle, I am trying to set up my application to use the Oracle Membership, Role and state providers. While in the process of setting up the membership, using the ASP.NET Admin tool, I get the following error when clicking on the "Security" tab: ORA-06550: line 1, column 15: PLS-00201: identifier 'ORA_ASPNET_MEM_GETALLUSERS' must be declared ORA-06550: line 1, column 7: PL/SQL: Statement ignored I can confirm that the identifier DOES in fact exist in the DB. I am

ORA-22912 specified column or attribute is not a nested table type /oracle creating nested table

折月煮酒 提交于 2021-01-29 07:54:59
问题 I was working with OODB and tried to make a nested table using two tables. I am posting code here create type BranchType as object( address AddrType, phone1 integer, phone2 integer ); create table BranchTableType of BranchType; create type PublisherType as object( name varchar2(50), addr AddrType, branches BranchType); The code intends to create a table branch by branch type and then creates a type Publisher Type which then try to create a nested table. create table Publishers of

Retrieving and displaying data from oracle database

二次信任 提交于 2021-01-29 07:01:04
问题 First of all, I would like to THANK YOU for stopping by and spending your precious time for looking at my problem. I have 2 different tables within an Oracle Database. The first table holds metadata about the columns present in the other table. Think of the first (COL_TAB) table as a custom version of the ALL_TAB_COLS which comes by default with Oracle. COL_TAB ---------------------------------------------- | TABLE_NAME | COL_NAME | COL_DESC | ---------------------------------------------- |

How Can I Send Emails in PL/SQL (Oracle)?

橙三吉。 提交于 2021-01-29 06:44:06
问题 I have a procedure which count the number of rows in SMS_OUTBOX table and send emails if its row cont is over 1000. My procedure is given below: CREATE OR REPLACE PROCEDURE SEND_EMAIL_ABOUT_PENDING_SMS IS CHECK_SMS_COUNT NUMBER := 1000; CURRENT_SMS_COUNT NUMBER; BEGIN SELECT COUNT(1) INTO CURRENT_SMS_COUNT FROM SMS_SCHEMA.SMS_OUTBOX; IF CURRENT_SMS_COUNT >= CHECK_SMS_COUNT THEN UTL_MAIL.SEND( sender=>'<SENDER_EMAIL>', recipients=>'<RECIPIENT_EMAIL>', subject=>'Pending SMS', Message=>'Pending

Unable to select from SYS.TABLES - Table or View does not exist

核能气质少年 提交于 2021-01-28 22:54:52
问题 I read that USER_TABLES is tables which you own ALL_TABLES is tables which own, and tables owner by other users, which you have been granted explicit access to DBA_TABLES is all tables in the database All three are views of the underlying SYS tables Based on the above and mention of SYS.TABLES in the Oracle Docs, I tried to select * from SYS.TABLES; but it resulted in an error that the table or view does not exist. I tried as both SYS and another username. Question 1: Is SYS.TABLES a valid

Trying to know which tables are executed in the oracle external application

有些话、适合烂在心里 提交于 2021-01-28 18:59:48
问题 I wonder if this could be possible or not. I am using TOAD, connected to an oracle database (11g) and i have access to the oracle E-BUSINESS-SUITE application. Basically, i want Toad to trace what sql are being executed by the oracle E-BUSINESS-SUITE application I have this query: SELECT nvl(ses.username,'ORACLE PROC')||' ('||ses.sid||')' USERNAME, SID, MACHINE, REPLACE(SQL.SQL_TEXT,CHR(10),'') STMT, ltrim(to_char(floor(SES.LAST_CALL_ET/3600), '09')) || ':' || ltrim(to_char(floor(mod(SES.LAST

ORA-00913: too many values while using case when

不羁的心 提交于 2021-01-28 12:09:23
问题 I have a requirement such that, if one condition is true i should execute on query Q1 if that condition fails, i should execute another query Q2. This queries result is the records of search performed by the user. I am using case when statement for if condition, as Q1 and Q2 have more than one column to retrieve, I am getting ORA-00913: too many values . I came to know that case when cannot execute queries with more columns in retrieving data. Can anyone suggest how to achieve this type