oracle11g

Schema and Owner of Table

心已入冬 提交于 2019-12-11 07:57:51
问题 Is the schema for a table and the owner for a table the same in oracle? If not what is the difference? 回答1: As Tom says: You should consider a schema to be the user account and collection of all objects therein as a schema for all intents and purposes. A table created by a user - and therefore owned by that user, as the owner in all_tables for example - forms part of that user's schema. So yes, the owner and schema are the same. Also see this earlier question, which references the same AskTom

Get Account details in Oracle using function

本秂侑毒 提交于 2019-12-11 07:57:42
问题 we have two tables account and Dept where acocunt level 1 will be coming from acount table and level 2 and level 3 account level coming from dept. table Now based on the input we need to find the accountkey which is in both tables and it should display which accountkey based on source account id, db id and account level. Input: [112].[22].[1],[113].[23].[1],[245].[21].[2],[289].[20].[2],[301].[21].[3], [304].[20].[3] Description: 112 - Account id(level1 accountid or leve2 accountid or level3

How to write a query for a gaps and islands problem?

爱⌒轻易说出口 提交于 2019-12-11 07:56:43
问题 This is a gaps and islands problem. Meter_id |Realtimeclock |I_Y|I_B|I_X| 201010 |27-09-2018 00:00:00|1.0|2.0|3.0| 201010 |27-09-2018 00:30:00|1.0|2.0|3.0| 201010 |27-09-2018 01:00:00|1.0|2.0|3.0| 201010 |27-09-2018 01:30:00|1.0|2.0|3.0| 201010 |27-09-2018 02:00:00|1.0| 0 |3.0| 201010 |27-09-2018 02:30:00|1.0| 0 |0 | 201010 |27-09-2018 03:00:00|1.0|2.0|3.0| 201010 |27-09-2018 03:30:00|1.0|2.0|3.0| 201011 |27-09-2018 00:00:00|1.0|2.0|3.0| 201011 |27-09-2018 00:30:00|1.0|2.0|3.0| 201010 |28-09

ExecuteNonQuery always returns zero. Can i use this 0 value into my code for validation?

蹲街弑〆低调 提交于 2019-12-11 07:47:14
问题 I am creating a oracle user in dba_users table by using the below c# code where i am using oledbcommand and ExecuteNonQuery. User is being successfully created in the dba_users table but ExecuteNonQuery is always retun value as "0" So i am doing validation in my code as (IsUserCreated==0). Am i correct with my coding here? int IsUserCreated= oleCreateUserCommands.ExecuteNonQuery(); if(IsUserCreated==0) { //TBD code Response.write("User Created Successfully"); } else { //TBD Code Response

Troubleshooting ORA-00942

你说的曾经没有我的故事 提交于 2019-12-11 07:45:52
问题 In the middle of an automated test run last night, one of my twenty worker threads blew out; the application was attempting an INSERT. Springframework reports ORA-00942: table or view does not exist. Connecting to the database (11.1.0.6.0) through the enterprise manager, I pull up a SQL worksheet and query the table, discovering (a) that the table exists now (b) the row that should have been inserted is missing (c) the row previously inserted by this thread is present (d) that the table has

Why I can't use a bind variable in an execute immediate statement?

百般思念 提交于 2019-12-11 07:41:24
问题 I'd like to use bind variables instead of a string concatenation when I build up a dynamic SQL statement for execute immediate . In the example below I can use bind variables for a , b and ret , but when I try to bind for f I get a ORA-06502: PL/SQL: numeric or value error: character to number conversion error . Why and how I can bind also f ? I'm using 11.2.0.1.0. create or replace function so4fun ( a in number, b in number, f in varchar2 ) return number as decl constant varchar2(32767) :=

How do you select a varchar2 field in the format of 'HH24:MI:SSxFF6' as an INTERVAL HOUR TO SECOND(6)?

梦想与她 提交于 2019-12-11 07:39:18
问题 The following query succeeds: SELECT INTERVAL '00:00:00.000000' HOUR TO SECOND(6) FROM DUAL; The following fails: SELECT INTERVAL time_field HOUR TO SECOND(6) -- time_field is a VARCHAR2(15) FROM some_table; w/ the following error: ORA-00923: FROM keyword not found where expected How do I fix my second query to pull back an HOUR TO SECOND INTERVAL? When I try: SELECT cast(time_field AS INTERVAL HOUR TO SECOND(6)) FROM some_table I get the following: ORA-00963: unsupported interval type TEST

How to enclose Oracle BI Publisher into iframe of some other app?

与世无争的帅哥 提交于 2019-12-11 07:39:15
问题 How to enclose Oracle BI Publisher into iframe of some other app? I have installed Oracle BI Publisher 11g (Trial version) and would like to enclose it into iframe of some other app. It works with other websites/apps but does not work with the Publisher. Instead of showing it in the iframe it automatically redirects to the url of the Publisher. I tried to google a solution for this problem amd found the following post: http://atlantabi.blogspot.com/2011/12/obiee-11g-obiee-content-cannot-be

Ignore redundant values fetched from database

孤街醉人 提交于 2019-12-11 07:29:37
问题 Following is the sample o/p of the SQL query - BUG_ID | LINKED_BUG_ID -----------|----------------- 3726 | 45236 45236 | 3726 3726 | 45254 45254 | 3726 3726 | 45402 45402 | 3726 3726 | 1182 1182 | 55745 In my SQL o/p, there are two rows out of which one row is redundant. e.g Bug Id 3726 and Linked Bug Id 45326 and Bug Id 45326 and Linked Bug Id 3726 are present twice in the o/p, out of which we need only one row and ignore such kind of duplicate rows (having either of a value repeated in Bug

Why does checking for null slow this query down?

给你一囗甜甜゛ 提交于 2019-12-11 07:29:28
问题 I got this table containing 7,000 records desc ARADMIN.V_PKGXMLCODE Name Null Type --------------------- -------- ------------- REQUEST_ID NOT NULL VARCHAR2(15) AVAILABILITY VARCHAR2(69) XML_CODE CLOB PACKAGENAME_UNIQUE VARCHAR2(50) CATALOG NUMBER(15) CHILD VARCHAR2(255) CLASSIFICATION_SYSTEM NUMBER(15) E_MAIL VARCHAR2(69) The query SELECT COUNT(*) FROM ARADMIN.V_PKGXMLCODE WHERE (CATALOG <> 0 AND CATALOG <> 2) AND (NOT (CHILD IS NULL)); takes less than one second. The query SELECT COUNT(*)