SQL & PL/SQL :: How To Control Block Execution With Flag Field Read In From LOG Table
Jan 9, 2012
The stand alone stored procedure has 2 parameter, an IN and OUT...
CREATE OR REPLACE PROCEDURE someprocedure( businessdate IN NUMBER,
tablename OUT VARCHAR2)
This procedure has multiple inner blocks. Intention is to control execution of each of the inner blocks basing on the value of flag field obtained from a "processlogtable". This processlog table has structure as below.
jobname varchar2(100)
controldate (date)
controlflag varchar2(1)
I have the below code snippet at the beginning of each inner block that checks value of the flag and then proceeds with execution of that block. The intent is to avoid redundant call of a block that has successfully executed first time. That is, once a specific inner block fails for some reason, the re-execution of the stored procedure should AVOID re-executing the PRIOR successed steps.
I've the code set up as below, but the prior successed block(s) code gets re-executed again once the procedure is re-executed after a failure.
CREATE OR REPLACE PROCEDURE someprocedure( businessdate IN NUMBER,tablename OUT VARCHAR2)
CURSOR c_missingtablename
IS
SELECT datatablename
FROM (
SELECT UPPER(datatablename ) TABLE
FROM
WHERE datatableName IN ('Aaa','BbB','CcC');
[code]....
View 5 Replies
ADVERTISEMENT
Jul 24, 2010
I have a multi record control block (basically a text item displaying 6 records) where user enters values and I want to process the values using pre-insert trigger.
I want to read value in each record and then do some tasks using a pre-insert trigger before I commit the values. To navigate between the records I was using first_record, next_record, clear_record built-ins but it gives errors like "40737-illegalrestricted procedure next_record in pre-insert trigger".
View 3 Replies
View Related
Nov 19, 2010
i have multi data block filed. and checkbox field which based on control block...My task is when i check checkbox only one field should enabled and my mouse goes to that field
e.g
item11 item21 item31 chkbox1
item12 item22 item32 chkbox2
Scenario like this :
My item field based on data block and checkbox based on control block,while i checked chkbox1 , only item31 on that current record should be enabled and i changed value only on that field
when i checked chkbox1 , my cursor goes to item31...not item32
View 12 Replies
View Related
Oct 7, 2011
EMP_ID IN_DATE QTY2
1070410/6/11 6:00 AM
1070410/6/11 3:00 PM
1070410/6/11 9:00 PM
1070410/7/11 6:00 AM
1070410/7/11 3:00 PM
1070410/7/11 9:00 PM
1070510/7/11 6:00 AM
1070510/7/11 3:00 PM
1070510/7/11 9:00 PM
following is the table where every employee have 3 records we need to put the flag datewise and employee id wise minimum in_date always be set to 1 and remaining 2 maximum dates for each employee date wise always set to 2 in qty2 field.
Output requirement is as follows:
EMP_ID IN_DATE QTY2
1070410/6/11 6:00 AM 1
1070410/6/11 3:00 PM 2
1070410/6/11 9:00 PM 2
1070410/7/11 6:00 AM 1
1070410/7/11 3:00 PM 2
1070410/7/11 9:00 PM 2
1070510/7/11 6:00 AM 1
1070510/7/11 3:00 PM 2
1070510/7/11 9:00 PM 2
View 4 Replies
View Related
Jul 12, 2010
I have a set of sql statements which i have to execute inside a pl/sql block. But i need to know the response of each statement and confirmation whether it is executed successfully.
Practically i need to get info as such in sqlplus status msg for each sql statement
E.g. :
SQL> insert into test values(1);
1 row created.
or similar to this.
View 7 Replies
View Related
Jan 3, 2013
Im using the following oracle database.
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
PL/SQL Release 10.2.0.4.0 - Production
CORE 10.2.0.4.0 Production
TNS for Linux: Version 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production
I have one problem in trigger execution. I have a small plsql block in trigger and, I want to execute it as a dynamic way. but it is giving the error. Please find the trigger code. Here my intension is that, the column name used in trigger should be dynamic. In future, if I want to switch the column name, I have to do without modification in trigger.
The error im getting is "ORA-01008: not all variables bound".
CREATE OR REPLACE TRIGGER ETM_AR_IU
AFTER UPDATE ON
EXTERNAL_MAPPING
REFERENCING NEW AS NEW OLD AS OLD
FOR EACH ROW
[code]...
View 17 Replies
View Related
Sep 22, 2012
I have a form that based on a table,
Col1: text field
Col2: text field with Disabled =Yes and Save session state = Yes
I create a dynamic action on Col1 to set value for Col2, when I submit page an error raised: Session state protection violation
visit: [URL]...
My purpose is: Col2 is set value by Col1 via Dynamic action, and is read-only, user cannot modify.
View 7 Replies
View Related
Aug 30, 2012
we are generating Entity beans at java appication. where application is connecting to DB and copy Table structure in Java class file. when this process start, oracle process takes 100% CPU. while there is no wait event at DB level. only queries are fired on oracle sys tables.(user_tables,user_constraints,etc..)
On trial and error based, we have changed this parameter and that java process works fine. how this parameter effect the on oracle system table.
View 16 Replies
View Related
Apr 26, 2011
I am trying to create standby with oracle 10g R2 from Solaris 5.10 (sun ultrasparc X86-64 bit) to Solaris 5.10(Intel Xeon 64 bit). All the mount points are the same as primary server. All the data files are at location as specified in control file. I created standby control file from primary. All the control files are at location specified in pfile.
When I am trying to mount database I am getting following error.
ORA-00202: control file: '/oracle/BP1/ctl1.dbf'
ORA-27047: unable to read the header block of file
ORA-205 signalled during: alter database mount...
I try to open database with trace file also but got following error..
ORA-01503: CREATE CONTROLFILE failed
ORA-01565: error in identifying file
'/oracle/BP1/sapdata1/system_1/system.data1'
ORA-27047: unable to read the header block of file
View 1 Replies
View Related
Nov 17, 2011
I am in charge of several instances located on a Linux server CentOS, virtualized on a ESX 3.5 environment.
From time to time (every 4 to 5 days), I have some errors in the alert.log. Last occurence was last night :
Corrupt block relative dba: 0x01004e12 (file 4, block 19986)
Fractured block found during buffer read
Data in bad block:
type: 6 format: 2 rdba: 0x01004e12
last change scn: 0x0000.131aaa5b seq: 0x2 flg: 0x04
[Code] ........
We are doing user manual backup (with BEGIN/END BACKUP) every night at 8PM, ending at 9PM approx. Then, fractured blocks never occur during backups. At 1AM, the maintenance window is opening, thus explaining the GATHER_STATS_JOB job.
When I check corruption on early morning, I am always unable to reproduce the problem. DBV is OK without issues. We never had a problem with the data itself, whatever it is a table or an index in the reported failed block.
I would like to know what could cause these logical corruption, and how to stop them ?
View 7 Replies
View Related
Jul 10, 2012
The block size of my db(10gr2) is 8k, and the db is on the raw device file system on a aix machine.
OS block size is 512k.
How much block will be read from disk when a single oracle io call occurs? Which one is currect, 8K or 512K?
If the block size for a single io call depends on the os block size (512k), I think os block size need to be tuned for oracle block size (8k). If we use raw device file system, os level block size has no meaning?
View 1 Replies
View Related
Apr 17, 2010
When i was starting my database .there was an error
ora-00333:redo log read error block 203 count 8192.
View 1 Replies
View Related
Feb 7, 2010
i want to use cursor to get data from db to "control block "(db item =no ) this data had where clause depend on item on other block
this my code :
declare
cursor get_sol is
select SOL_STEP,PROB_ID
from MI_SOLUTION
where PROB_ID=:MI_FORM_PROB.PROB_ID;
begin
go_block('control');
[code]......
when am using when_validate_item trigger error raise :
FRM-40737:Illegal restricted procedure next_record in when_validate_item
that's the trigger ? or how to solve ? in case of execute query in what trigger i will write the same code to get data in case of execute query by user .
View 9 Replies
View Related
Apr 11, 2013
I have two block....both are the control block.. in first block i select the date and in second block the data of that date is populated.but the data is populated using cursor in when-button-pressed trigger of that first block button.in cursor the data is selected and placed in field of detail block using into clause.... each field and one item of detail block is srno which is create in post-query of detail block using :sysyem.trigger_record.
Now i want after populated the detail block the data is sorted desc one of the field of the detail block..Can this possible using set_block_property() of block although the block is control block if yes where i should do this?
View 7 Replies
View Related
Oct 30, 2013
I have a scenario wherein i want to enable / disable a block based upon value of one of its column value. i.e., if value of approval status in
(IN ( 'INCOMPLETE' , 'RETURNED' , 'REJECTED' ) THEN
SET_BLOCK_PROPERTY('RFN_HEADERS_ALL', UPDATE_ALLOWED, PROPERTY_TRUE);
SET_BLOCK_PROPERTY('RFN_LINES_ALL', UPDATE_ALLOWED, PROPERTY_TRUE);
SET_BLOCK_PROPERTY('RFN_HEADERS_ALL', DELETE_ALLOWED, PROPERTY_TRUE);
SET_BLOCK_PROPERTY('RFN_LINES_ALL', DELETE_ALLOWED, PROPERTY_TRUE);
else.....
but the code is not working in pre-query, pre-select or post-query
View 2 Replies
View Related
May 6, 2010
I have created a data Bolck Manually.I had used select query to fetch records into the data block. There's and add button in the form to add more records to this block.
Now When i press add button and enter new records i want to ensure the Primary key i.e. the the new record entered does not repeat across the block. I cannot loop through and check as the number of records fetched is quite huge.
View 2 Replies
View Related
Oct 24, 2011
SQL> select block_size from v$controlfile;
BLOCK_SIZE
----------
16384
SQL> show parameter db_block_size;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_block_size integer 8192
the 2 can have difference block size?
View 3 Replies
View Related
Jun 14, 2013
I have 2 blocks named emp,emp1 those are DB's Blocks and empno, ename, sal in EMP block and sal, sum(sal) are in EMP1 block, i set the property for sum is summarized block is: EMP1 and item is SAL, i want display sum(sal), but not display when i click execute query.
View 5 Replies
View Related
Nov 14, 2011
I have a table called Customer_Type with following fields
Customer_type ,Active_date, Inactive_date
regular,11/01/2011
daily,11/04/2011
monthly,11/05/2011/11/11/2011
Tbale 2:Customer
Customer_name,Customer_type,Customer_Inactive_date
John,regular,
James,monthly,
Jake,daily,
Jill,monthly
What i wnat is to update the Customer_inactive_date with the Incative_date field from Customer_type based on their Customer_type... So james and Jill would have their rows updated in this scneario ..How can i achive this in pl/Sql
I have teh code using merge function..I want something in traditional old fashion..
The sql statements are below
CREATE TABLE CUSTOMER_TYPE
(
type_code VARCHAR2(10),
[Code]....
View 5 Replies
View Related
Mar 18, 2013
I have a flat file (student.dat delimiter %~| ) using control file (student.ctl) through sql loader. Here are the details.
student.dat
student_id, student_firstname, gender, student_lastName, student_newId
101%~|abc%~|F %~|xyz%~|110%~|
Corresponding table
Student (
Student_ID,
Student_FN,
Gender,
Student_LN
)
How do i map student_newId field to student_id field in STUDENT DB table so that new id should be inserted in student_id column. How do i specify the mapping in control file. I dont want to create a new column in student table. In control file i will specify the below, Is this a best approach?. Do we have any othe way?
STUDENT_ID *(:STUDENT_NEWID)*,
STUDENT_FN,
GENDER,
STUDENT_LNAME,
STUDENT_NEWID BOUNDFILLER
View 1 Replies
View Related
Feb 20, 2013
I have a table with a BLOB column ;
I want read data from table and insert to another table with a cursor
My code is :
procedure read_data is
cursor get_data is
select id,image from picture1;
id1 number;
pic blob;
begin
open get_data;
[code]....
when I run form , error FRM-40734 occurred
error in line " fetch .... "
View 1 Replies
View Related
Sep 19, 2010
I am having a Select query(below Query1) and I want to use one column(sum(col4)) from this Select query to be displayed in another Select query(Query 2). how to display this.
Query 1 :-
select a.col1,a.col2,b.col3,sum(b.col4)
from tab a, tab b
where a.key1=b.key1 and a.key2=b.key2
group by a.col1,a.col2,b.col3
Query 2 :-
select a.col1,a.col2,b.col3,sum(b.col6)
from tab a, tab b
where a.key1=b.key1 and a.key2=b.key2
group by a.col1,a.col2,b.col3,b.col5
View 4 Replies
View Related
Dec 22, 2010
I have to run a resource extensive SQL. It utilizes CPU to a great extent. I've created a new user just to run this particular report. I need to ensure that this particular user doesn't uses more CPU.
Hence, I need to generate an alarm (email) only if a threshold is exceeded for a certain period of time (above x% for y minutes),(example more than 80% for 10 min.), so that I can either kill the process or continue running it depending on CPU usage.
Can I do it using scripts or OEM. I couldn't find any specific metrics to do it in latter. (I'd prefer scripts though. )
My system details are as follows:
1. Database: Oracle 10g R2
2. Unix: Sun OS 5.10
View 2 Replies
View Related
Sep 17, 2013
I am not a DBA, we are using Oracle 10g DB for our PLM applictaion Enovia, we are now trying to do 4GT in our windows 2003 server where our DB kept, while reading articles about this. we are informed that /LARGEADDRESSAWARE (IMAGE_FILE_LARGE_ADDRESS_AWARE) flag needed to be set to True in the application (here it is Oracle) to use more than 2GB in the RAM.
So My question is "Whether the corresponding flag is set to TRUE or not in Oracle 10g"? Is there any way to check that?"
View 1 Replies
View Related
Jun 7, 2012
I have records like the following
Program_Name Effective_Date Valid_Flag
ABCD 2/10/2012 N
ABCD 2/14/2012 N
ABCD 2/20/2012 Y
ABCD 3/01/2012 N
ABCD 3/10/2012 N
[Code]...
I have to write a select statement to to keep the first record and then pull only the records when the Valid_Flag changed. The result set should be like below.
Program_Name Effective_Date Valid_Flag
ABCD 2/10/2012 N -- I have preserved the first record
ABCD 2/20/2012 Y -- Valid_Flag chages to a Y for teh first time and so on.
ABCD 3/01/2012 N
ABCD 3/14/2012 Y
ABCD 3/25/2012 N
ABCD 4/25/2012 Y
If there is no change in the flag, I do not have to pull that record.
View 3 Replies
View Related
Oct 18, 2012
I have a scenario, where I need to find the bucket values with the flag as "Y". The problem is i have 5 buckets
Bkt1 Bkt2 Bkt3 Bkt4 Bkt5 Flag
------------------------------------------
1000 500 230 100 677 Y
789 100 122 666 888 N
783 110 142 166 788 N
781 110 112 616 988 Y
709 130 121 661 878 N
Here I need to write a SQL query in Oracle 10g fetching the respective bucket value(for all the 5 buckets) along with the flag as "Y" and more importantly should have the bucket name as well.This is needed as in the UI we need to display the respective bkt value which is "Y" as bold.
So in the final List I need to have the VO which should contain the respective bucket name, respective value and flag as "Y"
Some thing like this I need to get in my final ArrayList in java
Bkt1 1000 Y
Bkt1 781 Y
Bkt2 500 Y
Bkt2 110 Y
Bkt3 230 Y
Bkt3 112 Y
Bkt4 100 Y
Bkt4 616 Y
Bkt5 677 Y
Bkt5 988 Y
how we can do it using the SQL query.
View 16 Replies
View Related
Jan 29, 2011
I am working on an archiving strategy. I want to roll off transactions that are older than seven days, but only if they are flagged as Completed. The numbers of transactions are very large so this is a worthwhile venture.
The only strategy I have been able to come up with so far is to partiton on date. Then when 7 days comes up, sweep the about-to-be archived day for the few remaining not Completed transactions, put those into a new table (a new version of this partiton) and switch partitions. Each day I do this until the older parititions are empty.
View 7 Replies
View Related
Apr 22, 2013
i'm having some issues with the External table. Currently my database encoding is AL32UTF8. If my external table wants to read the txt file with the ZHS16GBK, the value will not show correctly when the external table reads the file. Is there any ways to display the value in the txt file correctly without changing the encoding database and encoding in the txt file.
View 2 Replies
View Related
May 18, 2010
Can we have same execution plan for a create table statement where the name of the table changes every time as follows:
create table test
as
select * from t1
Here table name changes from test to another table name next time
View 6 Replies
View Related
Mar 5, 2008
I have a SQL link table called student_monitor containing the follwing attributes and e.g. data
student_id, Class_id, Predicted_Grade, Actual_Grade
1 1 A C
2 1 B B
3 1 C B
I need to be able to flag which students are under achieving on their target grades and dont know how to do this or the best way to do this as i cannot calculate the diff between a char?
View 1 Replies
View Related