SQL & PL/SQL :: Sequence Increments When It Is Not Being Called

Dec 1, 2012

I have a table called "Subjects" which lists subjects to match with notations in another table I have created a simple sequence (CREATE sequence subjectid) to created the subject id for the table. But I notice that if there is a skip in the date, the sequence increments automatically when I am not even using it. It even appears to be incrementing even when I am not doing any database activity.

This is not an issue of data integrity, because the values in the subject_id column do not need to be sequential, they just need to be unique. But it really has me curious. I created another table called "keep_track" to keep track of what is happening:

16-NOV-12 2952
16-NOV-12 2953
16-NOV-12 2954
16-NOV-12 2955
16-NOV-12 2956
16-NOV-12 2957
16-NOV-12 2958
16-NOV-12 2959
16-NOV-12 2960
16-NOV-12 2961
16-NOV-12 2962

[Code] ......

View 10 Replies


ADVERTISEMENT

SQL & PL/SQL :: Write A Script That Automatically Increments And Inserts Values For Already Existing Rows

Aug 21, 2012

I have a table named student_details with columns "NAME","ADDRESS","COURSE" with several rows of data already insertedI have to add one more column "ID" which increments automatically.

I tried to do this using SEQUENCE but no values got inserted for already existing rows in "ID". how to write a script that automatically increments and inserts values for already existing rows also.

View 12 Replies View Related

SQL & PL/SQL :: Procedure Called To Trace

Jul 12, 2012

I have a procedure in the live environment , which operate in 2 mode.

1 regular load at 10 min
2 nightly

The code is same except they set the last loaded time for both in 2 dfferent rows, so that next time run will get incremental data.

I can trace this procedure on mode 1 that is is scheduled but unable to find how the 2nd one is getting trigger every night. there is no jobs corresponding to that. Is there any way i can find which method is trigger the procedure during night.

View 5 Replies View Related

SQL & PL/SQL :: Selecting Owner For Currently Called Object?

Sep 13, 2010

I am trying to select the owner of a certain object, only knowing the name of the object and the user calling it.

Problem is this object might exist in more than one schema with the same name, and I only need the one that is called by the active user, which himself/herself might have access to other schemas containing their own copy of the object.

Example:

SELECT OWNER
INTO v_schema_name
FROM ALL_OBJECTS
WHERE OBJECT_NAME = p_object_name;

This works fine, until the object exists in more than one schema to which the current user has access.

View 4 Replies View Related

SQL & PL/SQL :: Manage Transaction When Called From Java?

Jun 21, 2010

A Java program would call a sequence of 5 PLSQL procedures, and they all need to participates the Tranasction defined in Java.

What do I do for the transactions inside PLSQL to ensure all 5 pariticpate in the Java transaction? I suppose I just do not specify any COMMIT in the PLSQL, but that probably would not work as PLSQL would COMMIT by default after exiting the proc?

View 2 Replies View Related

PL/SQL :: How To Know A Trigger Gets Called By Which All Packages / Procedures

Sep 11, 2012

Wanted to know whether it is possible to know a trigger is getting fired due to which all packages/procedures. If it has got fired for a particular transaction say multiple times, then wanted to get details of the packages/procedures which caused an event so that trigger got fired?

View 2 Replies View Related

PL/SQL :: Get A Called Procedure / Function Name Within Package?

Jan 11, 2013

is it possible to obtain a called procedure/function name within package?

For a measuring and tracing purpose, I would like to store an info at the beginning of each procedure/function in package with timestamp + additional details if needed.

For example:

CREATE OR REPLACE PACKAGE BODY "TEST_PACKAGE" IS
PROCEDURE proc_1 IS
BEGIN

[Code]....

I would like to replace "???????" with a function which would return a name of called procedure, so result of trace data after calling TEST_PACKAGE.proc_2 would be:

11.1.2013 09:00:01    START.*TEST_PACKAGE.proc_2*
11.1.2013 09:00:01    START.*TEST_PACKAGE.proc_1*
11.1.2013 09:00:01    END.*TEST_PACKAGE.proc_1*
11.1.2013 09:00:01    END.*TEST_PACKAGE.proc_2*

I tried to use "dbms_utility.format_call_stack" but it did not return the name of procedure/function.

View 7 Replies View Related

SQL & PL/SQL :: ORA-06508 - Could Not Find Program Unit Being Called?

Jan 2, 2013

I am facing below Oracle error when ever I am changing the contents of the package within it. %ORA-06508: PL/SQL: could not find program unit being called:

The packages and the dependents are recopmiled successfully and there are no invalid objects.The problem is resolved only if the database is reastarted.

What might be the problem?I am using a PL/SQL collection of record datatype in this package.

View 13 Replies View Related

SQL & PL/SQL :: View Log Of Stored Procedure After Called By Application?

Aug 27, 2012

How can I view the log of a stored procedure after it is called by an application?

View 5 Replies View Related

SQL & PL/SQL :: Reducing Function Computation When Called From Statement?

Nov 3, 2011

In the below SQL, I am calling a function "listagg_nm(deptno)", and function is to get all the employee name for a particular department with comma separated

output is:
-------------------------------------------------
DEPTNO SAL LISTAGG_NM(DEPTNO)
10 5000 KING,CLARK,MILLER
10 1300 KING,CLARK,MILLER
10 2450 KING,CLARK,MILLER
20 2975 JONES,SCOTT,FORD,SMITH,ADAMS

[code]....

below are the code

select deptno,sal,listagg_nm(deptno) from emp order by deptno;
FUNCTION listagg_nm (p_deptno NUMBER)
RETURN CLOB
IS
v_str CLOB;

[code]....

My doubt/question is for every row in the SQL the function is being called. t means that for 1st row deptno=10, the function is called and return all concatenated name for department 10, then again for 2nd row deptno=10, it again do the same, similarly for all other department.

Can we avoid this, I mean, if function is already returned a concatenated string of ename for deptno=10, then in the next function call it will checks if it is for same department (i.e. deptno=10) then the function will not go into for loop and it will directly return the concatenated string of ename for deptno=10 which we already done for the first row and so on for other department number ( something like storing the value in variable. Is it possible to achive this and does this is good for performance as we are not going into loop inside the function to return the concatenated string of ename for the same deptno everytime ( I have to return more than 10000 char., so i used clob in function and similarly the numbers of row return by SQL is more than 1000)and also how to code this, I tried but unable to achive.

View 13 Replies View Related

ORA-06508 / PL/SQL / Could Not Find Program Unit Being Called

Jan 25, 2013

When i am trying to create awr snap shot using

exec dbms_workload_repository.create_snapshot;

ERROR at line 1:
ORA-04063: package body "SYS.DBMS_WORKLOAD_REPOSITORY" has errors
ORA-06508: PL/SQL: could not find program unit being called:
"SYS.DBMS_WORKLOAD_REPOSITORY"
ORA-06512: at line 1

View 3 Replies View Related

SQL & PL/SQL :: ORA-06508 / Could Not Find Program Unit Being Called

Apr 5, 2010

I am getting below error when SP (Packaged Procedure) is called from application...

ORA-06508: PL/SQL: could not find program unit being called

After checking DB, i found package to be valid and call to SP giving same error ORA-06588.If i fire alter command to compile the package..

alter package name compile; and then if i try to run the SP in db it runs sucessfully.again after some time ORA-06508 it occurs again. after compiling it starts working fine again.

Body of the procedure :-

begin
indexFields.extend;
indexFields(indexFields.last) := ATTRIBUTE_REC_TYPE(i_attributeName,i_attributeValue);
o_errorcode := '0';
o_errormsg := null;
EXCEPTION

[code]....

sometimes it is working fine, sometimes gives error on compiling it works again.

View 11 Replies View Related

ORA-06502 Character String Buffer Too Small When Called From C# App

Apr 26, 2007

I have researched this problem and checked my variable sizes over and over again. I have tested the procedure within the Oracle Express environment and it works fine; HOWEVER, when the procedure is called from my C# app it produces the ORA-06502 error.

The stored procedure signature looks like this...

Original - SQL Code

create or replace save_new_project (p_custorgid in number,
p_title in varchar2,
p_AOIName in varchar2,
p_description in varchar2,
p_receiveddate in date,
p_deadlinedate in date,
p_startdate in date,

[code]....

The OracleParameter in my C# app for the last out param is defined as such...

cmd.Parameters.Add(new OracleParameter("p_statustypedescrip", OracleDbType.Varchar2, 30, ParameterDirection.Output));

As I said at the beginning of this post, the procedure works fine in the Oracle environment. So why is it not working by simply calling it from C#? I've tried changing the OracleDbType to CLOB which eliminates the error but it returns a bizarre result. It returns this string, "Oracle.DataAccess.Types.OracleClob".

Since CLOB doesn't really work either I switch back to Varchar2 and specify a size of 5000 (in the database the field I am querying is defined as Varchar(30)). I still get the ORA-06502 error.

I am clueless as to what the problem is. It should work and it does if I run a series of SQL statements in an Oracle SQL Command window. The test that works fine looks like this...

Original - SQL Code

declare
v_projid projects.projectid%type;
v_statustypedescrip projectstatustypes.type%type; /* this is a varchar(30) */
begin
save_new_project(2, 'Some input text goes here', 'More input text', 'And more again','26-APR-2007','26-APR-2007','26-APR-2007','26-APR-2007','users name as inpujt text

[code]....

But calling save_new_project from C# throws ORA-06502. It identifies line 40 of my stored procedure. This is line 40...

Original - SQL Code

p_statustypedescrip := v_statustypedescrip;

p_statustypedescrip := v_statustypedescrip;

View 4 Replies View Related

SQL & PL/SQL :: ORA-06508 - Couldn't Find Program Unit Being Called

Oct 15, 2013

I am using oracle 10g and toad 11.5 . i am trying to call an api from an anonymous block . If i recompile the api after adding dbms_output.put_line and then try to execute the anonymous block ,it shows error as "ORA-06508: PL/SQL: could not find program unit being called". However if i end current session and open a new session , then the anonymous block will execute without the error. i am made to reconnect the session everytime i make a change to API. making any configurations in toad or database level.

View 12 Replies View Related

SQL & PL/SQL :: ORA-06508 Couldn't Find Program Unit Being Called

Feb 21, 2011

ORA-06508: PL/SQL: could not find program unit being called ORA error, why it is getting, what is the corrective action for this error. i checked my package and dependent objects all are in VALID state only. But as soon as i get this error, LAST_DDL_TIME for my package is being changed to current time when the package was running.

View 10 Replies View Related

Forms :: 10g Report Not Running If Called Through Paramform On Other Domain

Apr 30, 2010

I'm using Dev10g Rel.2....If I call a report with paramform=no and pass it a value from forms then report runs well. but if I call report thru parameter form and pass value from parameter form the report doesn't run with error:

The webpage cannot be displayed.

Interesting fact is that If I call the report from a client on same domain as that of Application Server then it runs even thru paramform. I've also entered the application server I.P and name on other domain's client but no way.

View 1 Replies View Related

SQL & PL/SQL :: Creating Item_codes In Our Master Table Called Om_item

Jul 5, 2012

we are creating item_codes in our master table called om_item ,and then at one point of time every day we are shipping these newly created items based on date and tmie stamp as items.sql to our brance office and the person there will run these scripts there.Actually there are two persons involved in this process and i want to remove this manual intervention.All i need is to create a trigger for this insert statements and write it in text file as .sql.

create table om_item (item_code varchar2(20), item_name varchar2(60),item_cr_dt date)
insert into om_item values ('a','aaaa',sysdate);
commit;
insert into om_item values('b','bbbb',sysdate+1);
commit;

View 29 Replies View Related

Forms :: ORA-06508 - PL/SQL - Could Not Find Program Unit Being Called

Feb 18, 2010

Actually what happens is that we are connected to oracle through forms 6i. suddenly we receive the error " ORA-06508: PL/SQL: could not find program unit being called "

while doing some transaction. we have searched on net and meta link. they say that the package / procedure called has become invalid or recompilation has occurred and that is not compatible. Now we have monitored carefully that there are no changes what so ever has been made in the the package/ procedure.

what could be the reason behind this. we have also checked the global variable issue. we use package level variables but declared in the package body only. (so these are not public)

View 20 Replies View Related

Create A Copy Of Missions Table Called AM_X_442_2

Jan 22, 2009

My solution to the following question update 10 rows. It should update only 6 records. Create a copy of the missions table called AM_X_442_2. For missions on this table that meet the following criteria:

1. within the 10 most recent missions
2. length of the first word of the mission code_name exceeds 7 characters

Change the security level to the highest security level found in missions of the same type.

UPDATE
AM_X_442_2 am
SET
am.SECURITY_LEVEL =
(
SELECT
MAX(amx.SECURITY_LEVEL)
FROM
AM_X_442_2 am
INNER JOIN
AM_X_442_2 amx
[code]....

View 2 Replies View Related

Server Administration :: New Feature Of 11g Called-Pending Statistics

Mar 31, 2011

What is the scenario, we should use the new feature of 11g called-Pending Statistics.

Eg:-
EXEC DBMS_STATS.set_table_prefs ('SCOTT', 'EMP', 'PUBLISH', 'false');

View 3 Replies View Related

Application Express :: Tree To Popup A Called Page

Feb 8, 2013

Ive created a tree structure and i want it to popup the called page.select case when connect_by_isleaf = 1 then 0

            when level = 1             then 1
            else                           -1
       end as status,
       level,
       '<SPAN style="color:red;">' || "ENAME" || '</SPAN>'  as title,
       (case when level = 1 then '#IMAGE_PREFIX#Fndtre11.gif'
  [code]....          

View 6 Replies View Related

Application Express :: Procedure Automatically Called Again After 5 Minutes?

Jun 13, 2013

Apex 3.2. I have a page with a button. Once the user clicks the button a call is made to a procedure in a package.This procedure acesses a couple more procedures and functions, inorder to import data from one table to another. If the procedure takes more than 5 minutes to complete, the user receives an error message.This is actually the error message the user should get if he tries to do an import while another user’s import is running. Is it possible that if the called procedure doesn’t return in under 5 minutes the page is reloaded and the procedure called again resulting in the above error message. 

View 3 Replies View Related

SQL & PL/SQL :: WEBADI Error ORA-06508 Could Not Find Program Unit Being Called

May 30, 2010

When I run my package in TOAD and SQL plus I am not getting any errors. My package is being compiled well. When I integrate my Package through WED ADI .I am getting the above error. I am new to oracle apps WEDADI. can any give your valuable sugessions. I have even bounched the apache two times.

The schema for my package is APPS. Can you tell us how to go check the schema of WEB ADI. We see my integrator created in BNE_INTEGRATORS_TL. Since it is store in BNE table, the schema for BNE table is 'BNE'?

How to provide the access of package to the WEB ADI?

View 1 Replies View Related

PL/SQL :: How Database Handles Record Locking When Aggregate Function Called

Jul 17, 2012

how the DB handles record locking when an aggregate function is called? For instance:

...
select count(*)
into   v_count
from   x;

...Is there a lock maintained on table x for the duration of the transaction so no rows can be inserted or deleted?

View 4 Replies View Related

Forms :: How To Reload Calling Form After Closing Called Form

Jul 15, 2007

I have FORM_A calling FORM_B: Call_form('FORM_B',...). On form_B I am updating a Record and when I close Form_B and the focus goes back to Form_A, I need to Automatically Reload Form_A to reflect the changes that were made on Form_B.

How can I reload the Calling Form (FORM_A) when I closed the called form (FORM_B)?

View 13 Replies View Related

Server Utilities :: Can Hot Backup Called As Logical Backup

Feb 2, 2011

how export is called as logical backup ? If export is logical backup then what is hot backup .Can hot backup be called as logical backup.

View 2 Replies View Related

Get A Query Of Each Sequence?

Jul 24, 2010

How do I get a query of each sequence and who has the permissions to it?

View 1 Replies View Related

Using Sequence In A Trigger

Jun 1, 2009

I have created a trigger for after insert which updates a table when there is a row inserted in that table. The update is on a column which stores the application description along with the sequence number. Now my requirement is that sequence number should be unique only with in an application but not with in the table.Say the row entry can be as follows:

App_Desc Request_ID
-----------------------
DEV 100 1
DEV 101 2
STG 100 3
STG 101 4

Here Request_ID is unique But the sequqnce thats created for DEV (100,101) should take an entry of 102 for the next entry for DEV and same applies for STG. So I have to use the same sequqnce for all the application.

View 1 Replies View Related

Trigger Corresponding To A Sequence

Apr 16, 2007

I have 3 tables whose structure is as follows:

1) Invoice
Invoice_no number(8),
Debtor varchar2(35),
Invoice Date Date,
Print Date Date,
Currency varchar2(3),
Total Amount Ex Number(11,2),
Total Amount Vat Number(11,2),
Total Amount Number(11,2),
Status Varchar2(15),

2) Invoice Line

Invoice_no number(8),
Invoice_Line_No number(8),
Description_1 varchar2(35),
Description_2 varchar2(35),
Line_Quantity Number(11,2),
Currency varchar2(3),
Line_Amount Number(11,2),
Vat Code number(1),
Status Varchar2(15),

3) vat code
vat code number(1),
Description varchar2(35),
Vat Percentage number(11,2)

Here invoice no and invoice line no are automatically generated fields?

How to generate invoice line no corresponding to invoice no and how to satisfy the following conditions:

1) total vat amount in invoice table should be automatically filled . total vat amount=(line_quantity* line_amount*vat percentage)/100

2) invoice cannot be printed, changed when status is 'closed'.

3) invoice lines cannot be added,changed or removed when status of invoice is closed

4) when any of invoice line no is changed,added, removed or invoice is changed the status of invoice should be changed to 'new'.

5) invoice date of a new invoice cannot be of the past

View 1 Replies View Related

How To Set Sequence Cache

Oct 10, 2012

Are there any recommendations or good practices to set sequence CACHE parameter (for example one caching per hour, day etc)?

View 4 Replies View Related







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