PL/SQL :: Getting Different Result While Running Dashboard SP Using Temporary Table?

Jul 9, 2013

 I am getting different result when I run my dashboard procedure I am using temporary table with "ON COMMIT PRESERVE ROWS", below is the information I am running my attendance dashboard procedure which will display the employee attendance status based IN and OUT punches the status like AA-full day absent, GG-Full day Present, AG-First half absent,GA-Second half absent.

Now when I run the first time my procedure for first time I am getting status AA even though IN and OUT timings are correct and if run it again then it is displaying the status for same employee as GG I didn't understand the problem where it is effecting the status

View 4 Replies


ADVERTISEMENT

SQL & PL/SQL :: Temporary Table And Bulk Collect Into Type Table

Nov 15, 2011

I am using temporary table.

PROCEDURE Return_Summary(WX IN dbms_sql.varchar2_table,
WX OUT SYS_REFCURSOR) IS

Begin
FOR i IN 1 .. Pi_ WX.count LOOP

/* I need to put this results in a temp table or table object Can I use temp table for this or do we have any other recommended method. The loop might execute max of 10 times and for each run it might return 100-200 records. */

select WX_NM,
WX_NUM
from TAB A, TAB B, TAB C
where A.KEY1 = B.KEY1
and B.KEY1 = C.KEY1
and C.WX = WX(i);
End Loop;
End;

View 5 Replies View Related

Application Express :: 4.1 - Building Interactive Dashboard

Jun 14, 2012

I'm using Apex4.1 on a hosted platform. I'm trying to build a business application and the client wants a Dashboard.

Here is the best way I can explain it:

The dashboard displays a series of rows in the table. When you click on the "edit" button, it runs a query and displays it data on a report. How would I build this?

Let me explain it a different way:

The home page shows a table report with Column 1, Column 2, Column 3.

I want to make it so where you can click any ROW and then it goes to a different page that shows all of the data So the Home Page you can just see 3 Columns, but the next page will have all the columns.

View 2 Replies View Related

SQL & PL/SQL :: How To Create A Temporary Table

Aug 30, 2013

creating a temporary table.i have this query mentioned below

CREATE TABLE WEBPEN AS (SELECT PNSR_PPO_NO PPO,PNSR_FILE_NO,
DECODE(F_GET_APPLN_NO(PNSR_PK),'1',PNSR_VOL_NO,F_GET_APPLN_NO(PNSR_PK)) APPLN_NO,
PNSR_FULL_NAME NAME,
TO_CHAR(PNSR_DOB,'DD/MM/YYYY') DOB,
TO_CHAR(PNSR_DOR,'DD/MM/YYYY') DOR,
F_GET_ADBK_NAME(PNSR_TO_PENSION) TREASURY,
PNSR_SPOUSE_NAME SPOUSE,

[code]....

This creates a table webpen with around 54107 rows. What i am want is every time run "select * from webpen" it should run the above query and give the result as per the values in main table M_PENSIONER ,M_PEN_DCRG_WITHHELD.

What i want is it should truncate the existing values and insert the value by running the above mentioned query .

View 6 Replies View Related

SQL & PL/SQL :: Insert Into Temporary Table

Jun 5, 2005

I migrate procedures MS SQL Server to Oracle.In MS SQL SSERVER the use of instructions INSERT with procedure results which are in storage or dynamic instructions EXECUTE in place of VALUES clause is permissible. This construction is similar to INSERT/SELECT but we have to do with EXEC instead of SELECT. The part of EXEC should include exactly one resulted collection about the equivalent types to the types of table columns. In case of the stored procedure, we can pass on proper parameters, use the form of EXEC('string') and even call up wideranging procedures or remote control procedures from different servers. Calling up remote control procedures from different server, which place data in temporary table, and later realizing join with obtainable data, we can construct diffuse joins. For example. I want insert results stored procedures sp_configure, proc_obj in temporary table.

1)INSERT #konfig
exec sp_configure.

2)
CREATE PROCEDURE proc_test
@Object_ID int,
AS
SET XACT_ABORT ON
BEGIN TRAN
CREATE TABLE #testObjects ( Object_ID int NOT NULL )
INSERT
#testObjects
EXEC
proc_obj @Object_ID,3,1
COMMIT TRAN
RETURN(0)
go

how migrate for example code to Oracle?

View 11 Replies View Related

SQL & PL/SQL :: Global Temporary Table

Feb 20, 2010

What is the best option for GLOBAL TEMPORARY TABLE

1) option create GLOBAL TEMPORARY TABLE with ON COMMIT DELETE ROWS. and wheverever this is used for calculation commit at the end of porcedure.

CREATE GLOBAL TEMPORARY TABLE gtt_test
(
A NUMBER
)ON COMMIT DELETE ROWS;

CREATE OR REPLACE PROCEDURE my_proc ( p_in in number)
as
begin

[Code]....

2) create GLOBAL TEMPORARY TABLE without ON COMMIT DELETE ROWS and wheverever this is used use delete from Temp table /Truncate table and then user it.

CREATE GLOBAL TEMPORARY TABLE gtt_test
(
A NUMBER
);

CREATE OR REPLACE PROCEDURE my_proc ( p_in in number)

[Code]....

View 26 Replies View Related

Application Express :: Dashboard And Basic Input Forms And Reports

Oct 29, 2012

I have been tasked to look at a technology / frameworks that will allow our company to develop tools that is quick and easy to learn and easily supported. We use Oracle architecture extensively in the organization and also have APEX 4.2 installed for development purposes. We have two basic requirements or functionality that we need to implement and I and now looking at a proof of concept to determine whether we should adopt APEX or not.

1. Forms Based Tools
We have many databases with static content and users would like to have access to the data via a form. The form will allow the user to enter parameters (eg date) and on hitting a "Submit" Button, the database will be queried and a report generated and presented.

2. Diagnostics Tools
This is a bit more involved and we require a view of our static data in real time. If a specific KPI threshold is violated (eg MOC < 85%) we would like to present an alarm on a dashboard showing the alarm. For example if there are 5 entities that MOC < 85% we would like to show a "red" indicator. If no entities violate a threshold and are above MOC > 85% we want to show a green indicator. We also want a drill down function, where if the indicator is "red", a drill down will show the details of all the entities that have violated the threshold.

I have described our basic requirements, but if it can easily be done in APEX we will definitely motivate for its use.

View 1 Replies View Related

Reformat Data In A Temporary Table

Apr 26, 2011

Is there a neat way other than having to reformat the data in a temporary table to do the following,I've got the following content in a table:

CODECustid           Type               Nb                Amount
1                  Deposit           2             10000
1                  Withdrawal        1             4000

I'd like to show the data in this manner:

CustID Deposit  DepositAmount  Withdrawal WithdrawalAmount
1       2         10000            1          4000

View 3 Replies View Related

Alternatives For Global Temporary Table

Mar 12, 2013

I have created global temporary tables to be used in my stored procedure, in order to view reports which i created in JASPER. Since global temporary tables are session based, when multiple users are trying to generate the report, every user is getting inconsistent data.

To make it clear, what i meant is if a user A tries to view a report with some filter criteria and simultaneously user B is trying to generate the same report with another filter criteria, User A is getting User B's report data and User B is getting User A's report data. How can we avoid this problem?

View 1 Replies View Related

SQL & PL/SQL :: Drop Global Temporary Table?

Dec 6, 2011

how to drop global temporary table?

while droping global temporary table we are getting below error

"ORA-14452: attempt to create, alter or drop an index on temporary table already in use"

View 1 Replies View Related

SQL & PL/SQL :: Temporary Disable All Constraint In Particular Table?

Jan 7, 2012

i have one table HR.employees

SQL> desc hr.employees
Name Null? Type
----------------------------------------- -------- ----------------------------

EMPLOYEE_ID NOT NULL NUMBER(6)
FIRST_NAME VARCHAR2(20)
LAST_NAME NOT NULL VARCHAR2(25)
EMAIL NOT NULL VARCHAR2(25)
PHONE_NUMBER VARCHAR2(20)
HIRE_DATE NOT NULL DATE
JOB_ID NOT NULL VARCHAR2(10)
SALARY NUMBER(8,2)
COMMISSION_PCT NUMBER(2,2)
MANAGER_ID NUMBER(6)
DEPARTMENT_ID NUMBER(4)

SQL>

in this table i want to temporary disable all constraint in this employees table

View 4 Replies View Related

SQL & PL/SQL :: Global Temporary Table DDL In Schema

Dec 21, 2011

How to allow only "CREATE GLOBAL TEMPORARY TABLE" DDL in a schema. I have to restrict all DDLs performing by a particular schema except GT Table.

View 8 Replies View Related

SQL & PL/SQL :: Global Temporary Table And JAVA?

Dec 3, 2011

I am using a global temporary table in which place data from a few different queries.

It then select it out into a cursor.

This procedure works fine in PL.SQL Developer and Toad. It doesn't have to be adjusted.

Java has a problem though, as the data is gone when the Java call attempts to acquire it. This is due to session pooling I suppose.

So, my question is somewhat composite.

Is there a setting in Java (JDeveloper) that I could overcome this with? Perhaps a momentary "Hold" on a session?

View 6 Replies View Related

SQL & PL/SQL :: Create A Temporary Table With Same Structure

Mar 13, 2013

create table my_rows
(
my_envvarchar2(100),
anumber(2),
bnumber(2)
)
/
insert into my_rows values ('A', 10, 20);
insert into my_rows values ('A', 10, 20);
insert into my_rows values ('A', 10, 20);
insert into my_rows values ('A', 10, 20);
insert into my_rows values ('A', 10, 20);
insert into my_rows values ('A', 10, 20);
insert into my_rows values ('A', 10, 20);
insert into my_rows values ('A', 10, 20);
[code]....

The first row means that the value 10 represents 40% in the couple (10,20). Meaning if I have 100 rows with the couple (10,20), 40 rows will be marked with the value 10 and 60 will be marked with the value 20. To do this, I used to create a temporary table with the same structure as the my_rows table with a new column "the_value" and I used to update this new column wth a PL/SQL for loop. But I think it is doable in a signle SQL.

View 9 Replies View Related

PL/SQL :: Not Able To Update Global Temporary Table

Oct 17, 2012

create or replace procedure p_populate_gtt
as
begin
insert into gtt
select last_name,first_name,null from funcdemo where rownum <51;
update gtt set vote=100
where ln ='Tim';
end;
/

gtt is my global temp table. i am updating vote column which is null to 100.But i am not able to update it

View 21 Replies View Related

PL/SQL :: Create Temporary Table Using Execute Immediate

Jun 11, 2012

How can i create a temporary table using EXECUTE IMMEDIATE ??

Like:

CREATE GLOBAL TEMPORARY table new_table as (Select * from old_table);

View 11 Replies View Related

Application Express :: Part Of Screen Is Missing For Dashboard In IE And Google Chrome

Mar 7, 2013

When I see the apex dashboard in the IE or google chrome, part of screen goes missing.Last part of dashboard doesn't come but it works fine in Mozilla Firefox.What should I do? Is there some settings I need to do in IE.I am using the IE version 9.0 for 64 bit.

View 0 Replies View Related

SQL & PL/SQL :: Can Lock Data In Global Temporary Table

Nov 15, 2011

Can we lock data in global temporary table?

View 4 Replies View Related

SQL & PL/SQL :: Job Schedule - Insert Data Into Table Temporary

Nov 7, 2012

how made a success of insert data into table temporary in job_schedule ? because when i tried to change insert into table permanent always successfully.

CREATE GLOBAL TEMPORARY TABLE YG_PAYMENT_TMP
( SITE_CODE VARCHAR2(100 BYTE),
KBON VARCHAR2(100 BYTE),
FUTURE_DATE DATE

[code]...

why insert into table temporary not successfully in job_submit.

View 3 Replies View Related

SQL & PL/SQL :: Global Temporary Table And Autonomous Transaction?

Jul 15, 2013

The actual flow, works on this way:

The Procedure A extracts and filter some data from the DW, this data is stored on the Global Temporary Table. Another Procedure, named B, use the data from the Global Temporary Table and store it on a normal table using another procedure Named X that Merge the data from Global Temporary against the Normal Table (inserting if not exist and updating some fields if exist).

(X isn´t important on the new flow)

Now, i need to add some steps on the normal flow:

The Procedure A extracts and filter some data from the DW, this data is stored on the Global Temporary Table. Another Procedure, named B, use the data from the Global Temporary Table and store it on a normal table. Using the Data from Global Temporary Teble i must to Store some fields on another normal table, for this i use another Procedure named C that merge the data from Global Temporary Table against the data from normal table, and i must to commit at this point. X Merge the data from Global Temporary Table and the data from the Normal table con the procedure "C" against another Normal Table (inserting if not exist and updating if exist).

The issue that i´m expecting is that i can´t use "C" for merge and commit, because this truncate the data on the global temporary table. I can´t change the on commit delete rows option, because another procedures are using this Global Temporary Table on production.

Before you ask, i try using AUTONOMOUS_TRANSACTION on "C" and didn´t works because "C" can´t found data on the Global Temporary table ( i use a select count on "C" from Global Temporary), this is because The Autonomous_Transaction (i think). So, what i can do? I tried to trace the session Number on C and A and with the AT is the same ( so isn´t session change problem).

I need:Commit on the Procedure "C" without Truncating Global Temporary Table because i need this data for X.

View 7 Replies View Related

SQL & PL/SQL :: Return Ref Cursor To Temporary Table From Function

Feb 17, 2011

I have strange problem when i try to return a ref cursor holding data from a select on a oracle global temporary table. If i iterate through the cursor , i can see the values but the function as such returns nothing through the ref cursor. I tried the temporary table as both delete on commit and preserve on commit

create or replace
PACKAGE BODY BILL AS

FUNCTION FILTERI RETURN BILL.refcursor IS
testcursor BILL.refcursor;

ttstatus INT;
iSuccess INT;
returns INT;
TruncatedSQL1 VARCHAR2(32767);
BEGIN
[code].........

View 12 Replies View Related

SQL & PL/SQL :: Executing A Procedure Containing A Global Temporary Table

Mar 3, 2010

create or replace procedure test
as
stmt varchar2(2000);
begin
EXECUTE IMMEDIATE 'CREATE GLOBAL TEMPORARY TABLE tt_Local(ID VarChar2(38)) ON COMMIT PRESERVE ROWS';

stmt := 'INSERT INTO tt_Local SELECT cardnumber FROM cards';
execute immediate stmt;
end;

-- when am trying to execute this

begin
test;
end;
-- showing ora-01031, insufficient privileges.

View 9 Replies View Related

Delete Temporary Table Automatically When DB Connection Closed?

Jan 4, 2011

I'm working on a java program connected to a Oracle 9i db. I'm inexperienced about Oracle specific capabilities. The experienced Oracle users

I would like to know if there's a way to create a temporary table so that:
- the table will be deleted automatically when a specific db connection closes (obligatory)
- the table is visible for just one specific connection (optional)

What I would like to do is:
1 - Get the result set for query A.
1a - process the results
1b - store the results in a performance friendly way ( I thought about a temp table)
2 - Run query B over result set A.
3 - Run query C over result set A.
X - The stored result set A has to be removed before/when the program ends (ideally when the db connection closes).

The problem isn't how to do this in java. The problem is to do it in a way so that the table will be automatically removed when the db connection used to create it will be closed so that's unimportant if the java program crashes or ends normally.

View 7 Replies View Related

Forms :: How To Insert And Update From Global Temporary Table

May 15, 2013

Global temporary Table Name:

1.MT_GBL
2.DT_GBL
3.DT2_GBL

Base Table Name:

1.MT
2.DT
3.DT2

My Steps:

1.Insert all data from global table to base table.
2.Update all data (that means retrieved all data from base table to global table and update this data). Question: How to Insert and Update from Global temporary table ??

View 4 Replies View Related

SQL & PL/SQL :: Less Number Of Rows Inserted In Global Temporary Table

Sep 8, 2012

how to resolve the following issue ...

insert into GTT (select query) inserting less no. of rows than that returned by the query.

The global temporary table has ON COMMIT PRESERVE ROWS.

View 3 Replies View Related

SQL & PL/SQL :: Insert Records From A Select Query Into Temporary Table?

Mar 21, 2013

We are trying insert records from a select query into temporary table, some of the records is missing in the temporary table. The select statement is having multiple joins and union all which it little complex query. In simple terms the script contains 2 part 1st Part Insert in to temporary table 2nd part Select query with multiple joins, inline sub queries, unions and group by classes and conditions Eg. If we execute select statement alone it returns some count for example => 60000 After inserting into the temp table, in temp table the count is around 42000 why is the difference?

It is simple bulk inserts... insert in to temp table select * from xxx. also, there is no commit in between. The problem is all the records populated by the select statement are not inserted in to temp table. some records are not inserted.

Also, we had some other observation. It only happens in its 2nd execution and not its first run. Hope there might be some cache problem Even, we also did not believe that. We are wondering. In TOAD, we tested however at times it happens. In application jar file, after "insert in to temp select * from xxx" we take the i. record count of temp table and ii. record count of "select * from xxx" separately but both doesn't match. Match only at 1st time.

View 16 Replies View Related

SQL & PL/SQL :: Mutating Trigger Error Using Global Temporary Table?

Jun 21, 2010

How can we overcome mutating trigger error using global temporary table.

Suppose if we use the following trigger we will get mutating trigger error.

CREATE OR REPLACE TRIGGER t1
AFTER INSERT ON emp
FOR EACH ROW
DECLARE
BEGIN
UPDATE emp SET sal=sal+100;
END;
/

View 27 Replies View Related

SQL & PL/SQL :: Partial Data Inserted When Reading From Global Temporary Table?

Jun 25, 2012

I have a complex sql query that fetches 88k records. This query uses a global temporary table which is the replica of one of our permanent tables. When I do Create table..select... using this query it inserts only fewer records. But when I make the query point to the permanent table it inserts all 88k records.

1. I tried running the select query separately using temp and perm table. Both retrieves 88k records.

2. From debugging I found that this problem occurred when we were trying to perform a left outer join on an inline view.

However this problem got resolved when I used the /*+ FIRST_ROWS */ hint.

From my limited oracle knowledge I assume that it is the problem with the query and how it is processed in the memory.

View 1 Replies View Related

Performance Tuning :: Speeding Up Scanning Of Internal Temporary Table

Apr 3, 2012

I have a query like following

WITH v_results as
(
Select /*+ materialize full(t1) parallel(t1) */
col1,
col2
col3
col4
[code].......

Now I have 2 issues here

1) The query inside the WITH clause returns more than few 100k rows in 3-4 seconds (with parallel hint) it accesses 425984 blocks

But then the hash join starts (as observed from (longops) and it literally crawls for 2-2.5 hours

Of course the tables with which the results of WITH query are joined, are big, too . But is there any workaround to speed up the hash join in such situation? when observed from logops it reads almost block by block

How do I know why the hash_join is slow? memory or /and something ?

My another question pertains to the WITH clause
We can execute the query in WITH clause using parallel hint but can we later scan the internal temporary table (as created using materialize hint) in, parallel mode?

View 7 Replies View Related

SQL & PL/SQL :: Interface Table Compared With Normal Table - Result Dumped If Match Found

Aug 17, 2012

Oracle 10g, Windows XP

There is an interface table and there is an normal transcational table..interface table is being compared with normal table and if match found the result is dumped into another normal table.

I am using two cursors one is to query the interface table and in a for loop pass the results to the second cursor..The interface table is having 5000 + rows and the transcation table is having more than 3.7 millions ..and the program is taking lots of time to execute..took almost 35-45 minutes..

create table x_interface /* INterface table */ -- 5000 + rows
( name varchar2(80), addr_line1 varchar2(35), addr_line2 varchar2(35), addr_line3 varchar2(35),
addr_line4 varchar2(35), addr_line5 varchar2(35), addr_line6 varchar2(35), suffix varchar2(35),
city varchar2(15), state varchar2(10), zcode varchar2(10))
[code]....

View 7 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved