Forms :: How To Update Current Row Comparing It With Existing Value

Jul 14, 2013

I have master-detail form I would like to update the emp1 table on the base of current value of dept table deptno and emp table ename .

update emp1
set ename = :emp.ename
where ename =
(select ename from emp e
where e.ename=:emp.ename
and e.deptno=:dept.deptno);

I try the above query but it did not able to update emp1 table.

View 12 Replies


ADVERTISEMENT

Where Current Of - For Update Of

Oct 5, 2010

I have an employee table that has a paygrp_id that will be used for my subset of employees. For all the employees that have the paygrp_id = 10212 on the employee table I need to update the workbrain_user table to set the flag wbu_cansee_self to 'N'. The join between the employee table and the workbrain_user table is the emp_id.I get the following error when I run this cursor.

[error]
Error on line 0
DECLARE
CURSOR wbuFlag_cur
IS SELECT e.emp_fullname, e.paygrp_id,wbu.WBU_CANS
[code]...

View 3 Replies View Related

Update Where Current Of

Sep 27, 2010

I have a table I need to update called employee_history. It has almost the exact same values as another table called Employee. The difference being that the employee_history has a start date and end date. So it allows you to have overrides in the future. The employee table is static. So it only allows you to see the current data as of today.

I need to write an insert statement that will pull values from employee table and populate the employee_history table but I also have columns in the employee_history table that requires a next value and a start and end date.

From the employee table I want to select e.emp_id, e.emp_firstname, e.emp_lastname, e.shftpat_id, e.client_id from employee e

I want to INSERT INTO EMPLOYEE_HISTORY (EMHIST_ID, EMPHIST_START_DATE, EMPHIST_END_DATE, EMP_ID, EMP_FIRSTNAME, EMP_LASTNAME, SHFTPAT_ID, CLIENT_ID)

with the VALUES being (SEQ_EMPHIST_ID.nextval, TRUNC(sysdate), 01/01/3000 and the employee data from the employee table)). I bought the book Easy Oracle PL/SQL Programming but I am not finding what I need. It gives an example of a CURSOR FOR UPDATE and a reference to an UPDATE WHERE CURRENT OF.

The examples are straight forward where you take two columns from table one and update a new table with those values, or where you select a subset of employees that need a commission and update the emp table with that commission.

View 1 Replies View Related

SQL & PL/SQL :: Update Existing Table

Apr 24, 2012

I want to either UPDATE or add a new column with ROWNUMBER() OVER an column on a table

the output will shows like below

empID DeptNo New_column Start_Date
11 7778 1 01-02-2010
11 3400 202-06-2010
25 4444 103-02-2010
25 7775 204-07-2011
25 7777 305-02-2012
30 2223 109-02-2012

the forth one column is in date format and I want to update table with respect to order by the column start_date

View 1 Replies View Related

SQL & PL/SQL :: Query To Update Current Value In DBA View To New One

Jul 18, 2012

I am looking to build a query to update a current value in a DBA view to a new one.i.e. updating directories based on the current value:

CREATE OR REPLACE DIRECTORY 'DIRECTORY_NAME' AS 'DIRECTORY_PATH'(substr(directory_path, 1,5) + '/&dbname' {i.e. this is different for every database name }+ 'DIRECTORY_PATH'(string after /xyz/)
WHERE DIRECTORY_NAME in
( select DIRECTORY_NAME
from DBA_DIRECTORIES
WHERE DIRECTORY_PATH
like '/xyz/%'
)

i.e. resulting output should be:

CREATE OR REPLACE DIRECTORY 'ABC' AS '/xyz/DBNAME/abc/def/';

(when the directory previously was 'xyz/abc/def/') i.e. basically inserting the db name into the directory.where DBNAME is a variable more directories are added frequently so therefore this needs to be a dynamic procedure to change the directories in the db.

View 26 Replies View Related

Server Utilities :: How To Update Existing Table Using SQL Loader

Sep 30, 2011

I am using a shell script to load unix content to a database.I have captured the unix data to a csv file and I am using a sql loader to inser that csv data to database. following is my ctl file contents.

[b]load data
infile data.csv
into table AVS_LOGS
fields terminated by ','
(
RUNDATETIME,
SERVER,
DIRECTORY,
FILENAME,
LASTUPDATETIMESTAMP
) [/b]

and I am using sql loader command in unix that is [b]sqlldr $CLOGIN control=control.ctl log=test.log[/b]

But this is working only if the table is empty.Now I am looking for something where I do not need to delete the data from table each time. it should update the table.

View 5 Replies View Related

Forms :: Comparing Date In 6i

Aug 3, 2011

I am working in form 6i, database 9i. I have datablock on table t1.

table t1: name(varchar2), date(varchar2)

datablock: name(varchar2), date(varchar2)[i have insert date with time stamp]

for date column, i am inserting date with time stamp.While querying data, user just enters only date(no time stamp), i should be able to query data. I tried in data block where condition

WHERE: substr(date,1,11)=nvl(:block.date,substr(date,1,11)

i am not able to retrieve data through date, through name it's working fine.how to retrieve data by only entering date (without time stamp)

View 13 Replies View Related

Performance Tuning :: Unable To Update Newly Added Column In Existing Table

May 21, 2013

I am facing some challenge while running update query on newly added column in existing table.

Environment Details
Oracle 9i, version 9.2.0.6
Os Unix Aix 6.1

No of records in table : 12572770

Below are the step i followed.

1. In table testtablename, I have added new column COLUMNNAME29 with datatype VARCHAR2(8).
2. After adding the new column, i executed the update query to populate the data form COLUMNNAME1 to COLUMNNAME29.
3. The query is executed using COLUMNNAME24 in where clause, to drive query in index based.

SQL> desc testtablename
Name Null? Type
----------------------------------------- -------- ----------------------------
COLUMNNAME1 VARCHAR2(8)
COLUMNNAME2 CHAR(1)
COLUMNNAME3 CHAR(1)
COLUMNNAME4 VARCHAR2(8)
COLUMNNAME5 VARCHAR2(11)

[Code]...

Table altered.

SQL> select index_name, column_position, column_name from dba_ind_columns where table_name = 'TESTTABLENAME' order by index_name,column_position;

INDEX_NAME COLUMN_POSITION COLUMN_NAME
------------------------------ --------------- --------------------------------------------------
IDX_TESTTABLENAME 1 COLUMNNAME24

Problem faced & My analysis

1. The update query is hanging in database, it's not progressing (In single update, approximately 40000 records will get update)
2. No oracle error thrown in alert log or in session where the query being executed.
3. The event for the query is "db file sequential read".
4. When i update the newly added column COLUMNNAME29 with static value "1", the update completed successfully in few seconds.
5. Then i changed the static value to "1111" and executed the update statement, which result to query hanging in database.
6. I tried to update the existing column(COLUMNNAME1) in table with static value "1111", the update completed successfully.

Below are the queries completed successfully

Update Testtablename
Set Columnname29 = '1'
Where Columnname24 >= To_Date('01-12-2002 00:00:00', 'DD-MM-YYYY HH24:MI:SS' )
And Columnname24 < To_Date('01-01-2003 00:00:00', 'DD-MM-YYYY HH24:MI:SS')

[Code]...

Below are the queries hanging in database

Update Testtablename

Set Columnname29 = Columnname1
Where Columnname24 >= To_Date('01-12-2002 00:00:00', 'DD-MM-YYYY HH24:MI:SS' )
And Columnname24 < To_Date('01-01-2003 00:00:00', 'DD-MM-YYYY HH24:MI:SS')

Update Testtablename

Set Columnname29 = '1111'
Where Columnname24 >= To_Date('01-12-2002 00:00:00', 'DD-MM-YYYY HH24:MI:SS' )
And Columnname24 < To_Date('01-01-2003 00:00:00', 'DD-MM-YYYY HH24:MI:SS')

Below is character set in database

SQL> select * from v$nls_parameters;
PARAMETER VALUE
---------------------------------------------------------------- ----------------------------------------------------------------
NLS_LANGUAGE AMERICAN
NLS_TERRITORY AMERICA
NLS_CURRENCY $
NLS_ISO_CURRENCY AMERICA

[Code]....

View 15 Replies View Related

Application Express :: Current Version Of Data In Database Has Changed Since User Initiated Update

Sep 25, 2012

I am experimenting with the 4.2 version of Apex at URL.....

I have created a tabular form (based on a view with an instead of trigger) and have restricted this form to "Update only" mode. Whenever I modify a field value and submit the change I get the error "Current version of data in database has changed since user initiated update process".

View 6 Replies View Related

Forms :: Getting Values Of Some Column And Comparing It

Aug 6, 2010

I have got a table having column a, b , c, d, e and some values are stored in it. e.g. a, c and e have 'Y' and b and d have 'N' value in it.

How can i count with one query , how many columns have 'Y' and how many have 'N'.

cursor is one solution.

View 2 Replies View Related

SQL & PL/SQL :: Difference Between Sysdate / Current Date / Current And Local Timestamp

May 30, 2012

What is the difference between the following . In my schema all are giving the same results with some different format

SQL> SELECT sysdate , current_date , current_timestamp , localtimestamp from dual;

SYSDATE CURRENT_DATE CURRENT_TIMESTAMP LOCALTIMESTAMP
----------- ------------ ------------------------------------------------- -------------------------------------------------
5/30/2012 8 5/30/2012 8: 30-MAY-12 08.27.22.037703 AM -04:00 30-MAY-12 08.27.22.037703 AM

View 1 Replies View Related

SQL & PL/SQL :: Verify Current Date Is Greater Than 15th Of Current Month

Sep 22, 2010

I need to verify if the current date is grater than the 15th of the current month. If its grater than the 15th of the current month i need to do an action or if else its lesser than 15th of the current month i need to do an other operation.

View 5 Replies View Related

Forms :: How To Know Operating System Current Path In Oracle 10g Forms

Apr 19, 2011

How to Know Operating System Current Path in oracle 10g forms ?

View 4 Replies View Related

Forms :: Insert And Update Directly Into Table From Pre Update Trigger Of Block?

May 14, 2010

I have a base table (Table A) block with multiple records displayed. I need to track audits to this underlying table in the following way:

If user updates a field in the block I want the pre-changed record's audit fields to be set and I need to create a copy of the record with the changed values. Basically any changes will result in the record being logically deleted, and a copy record created with the newly changed values.

Tried to implement in the block's pre-update trigger which will call a package to directly update Table A then Insert into Table A, then requery the block. Is there a clean and efficient way to do this?

View 4 Replies View Related

Forms :: Getting Current Hostname

May 9, 2011

how can I get the form hostname that it is currently running to? I already tried the form's (forms developer 6i) built in host functionality but it doesn't return the hostname.

Our current approach is to have a shell script that will get and insert the hostname into the table and the form will just query from the table to get the hostname, but that approach has involved too many modules.

Is there an easiest way to get the hostname?

View 5 Replies View Related

Forms :: How To Display Current Record

Mar 12, 2013

I have problem about displaying current records with same table(tbl_pawnitem). I have 2 transactions which are the pawned transaction and for sale transaction. and both transactions save into tbl_pawnitem table..i want to display only in my list the for sale transaction without deleting the records of pawned transaction. what condition i will use?

View 5 Replies View Related

Forms :: Opening Existing Form In Particular Tab

Jun 5, 2011

There is a existing form B. From a form A I need to call form B on button press. Problem is form B has many tabs,It should open in the third tab when it is being opened from form A.

View 1 Replies View Related

Forms :: Order By Current Month

Jan 30, 2011

A form has date of birth column.

Date of birth should be displayed according to current month.

Example:
01-jan-1980
01-feb-1975
01-mar-1970

Required:

Let current month is feb then
01-feb-1975
01-mar-1970
01-jan-1980

What should be done?

View 5 Replies View Related

Forms :: Current Record Indicator

Aug 25, 2011

set the current record indicator for my tabular data block.

View 1 Replies View Related

SQL & PL/SQL :: Existing Role Claimed To Be Not Existing?

Dec 19, 2011

I'm am getting an error that says that a role doesn't exist when I can cleary see it in DBA_ROLES. I can successfully grant other roles in this session. I am using Oracle 11.1 on RAC.

GRANT "CONNECT" TO BAKERD
Error at line 1
ORA-01919: role 'CONNECT' does not exist
select * from dba_roles where role = 'CONNECT'

[code]....

View 5 Replies View Related

Forms :: How To Focus On Current Record In Oracle

Jul 4, 2011

How to focus on current record in oracle forms.

for ex:- I have 10 records in line level.i want to focus my cursor on particular like (5th record) how to possible in form.

Is there any built-in like current_record?

View 4 Replies View Related

Forms :: Cursor (control) On Current Record

Jul 18, 2011

In my form line level block contains 100 records.i will check the check box for line number 96 and 97. Then i will press save(I have written some logic here) button it will generate one number for selected check boxes. After generating this number cursor(control) should be on same line number 96 or 97.

View 10 Replies View Related

Forms :: Get The Current User Login On System?

Jun 19, 2011

How can i get the Current user log in on my system using global variable.

View 6 Replies View Related

Forms :: Enable Or Disable Current Item In Block?

Feb 1, 2011

I have one tabular block on the canvas and there is one check box on this block. I want that when I uncheck this checkbox, one item on the current record gets disabled.

i manage to turn all the records enabled or disabled.

I am attaching a dummy form in which I have tried. Checkbox is acting on field :ecc_no.

The DB table for the same is:

CREATE TABLE ECC_MASTER
(
PARTY_TYPE CHAR(1 BYTE) NOT NULL,
PARTY_CODE CHAR(5 BYTE) NOT NULL,
ECC_NO VARCHAR2(25 BYTE) NOT NULL,
RANGE_DIVISION VARCHAR2(30 BYTE),
EMP_NO NUMBER(4) NOT NULL,

[code]....

View 7 Replies View Related

Forms :: 6i Requirement - Create New User And Edit Existing One

Jun 10, 2011

I have a form with fields like, UserName, User ID Email Address. This is used to create new users & edit existing user information. I wanted to make the Email field mandatory. So i made the email field as 'Required' via Proerty Pallette. So when ever i create new users after this change, i get a message saying 'Field must be required' when i try to skip this email field.

However when i edit existing user information and try to save the data with no email address i am able to save. So, where when i try to save a user info with no email address, i should get a warning saying 'email address is required'. How to go about it and if i wil have to create any trigger.

View 5 Replies View Related

Forms :: Get Current Language From Firefox And / Or Internet Explorer

Feb 25, 2010

I am looking for a possibility to get the current language from Firefox and/or Internet Explorer.

I searched through the Mozilla Developer Center but could not find an interface to realize that. For IE I also didn't find anything.

I know that IE adapts the current system language from the OS, but can I readout this value?

View 1 Replies View Related

Forms :: List Item Label Of Current Selection?

May 9, 2012

How to get the label (not value) of current selection in a List Item.

View 7 Replies View Related

Forms :: FRM-41344 OLE Not Defined For SCAN In Current Record

Jun 1, 2010

my problem is this that i have developed a form.fmb in 6i for images scanning direct from scanner but its generating error something like that "FRM-41344 OLE not defined for SCAN in the current record"

li have a winxp enviroment i have already downloaded and installed "IMAGING FOR WINDOW"(GLOBAL 360) but despite this its not working same error is still there .

one more thing why imgscan.ocx is not registering in winxp.

View 3 Replies View Related

Forms :: How To Get Current Cursor Position In Oracle 10g Form

Feb 25, 2010

I want to get current mouse cursor position dynamically,what should i do.

View 3 Replies View Related

Forms :: Make A Field As Mandatory At Current Record Level

May 27, 2010

I have one requirement i.e i want to make a particular item as mandatory for the current record in the tabular form.

so i have written code as below:

DECLARE
lv_item item;
BEGIN
lv_item := FIND_ITEM ('XXMZ_DETAIL.QTY_ACT');
SET_ITEM_INSTANCE_PROPERTY (lv_item,
current_record,
required,
property_true);
END;

This code is not effecting qty field. If i write set_item_property built-in that item becomes mandatory.But it's not effecting at current record level.It's effecting block level.

So how can i make a field as mandatory at current record level?

View 7 Replies View Related







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