SQL & PL/SQL :: Record Doesn't Contain Page Then Need To Update As Null

Jun 13, 2013

frame a query for the below values .I have few records in a below format.

1) 'CODE#ATC#YEAR#1980#NUM#4229#VOL#80##'
2) 'CODE#NSWLR#YEAR#1985#PAGE#158#VOL#4##'
3) 'CODE#WASC#YEAR#1981#MONTH#07#DAY#24#'
4) 'CODE#RPC#YEAR#1919#PAGE#296#VOL#36#'

I need only the Page from the above records.For example if i take this record

'CODE#NSWLR#YEAR#1985#PAGE#158#VOL#4##' -- I need to extract only the Page from this like 158.

If the record doesn't contain Page then i need to update as null.

View 30 Replies


ADVERTISEMENT

Application Express :: Default Value For Page Items Doesn't Get Set When Session Is Cleared?

Nov 15, 2012

I am facing this problem, not sure how to solve this. Basically, the default value of the "items" on the page don't get set when the session is cleared and I visit the page for the first time.

So when I check the session for the first time, all page items are null. But when I revisit the page, the page items gets set sometimes.

View 6 Replies View Related

UPDATE Date / Literal Doesn't Match Format String

Nov 29, 2007

When I try to update a date column with this:

 UPDATE
        event_request
    SET
        REQ_EVENT_DATE = TO_CHAR(REQ_EVENT_DATE - INTERVAL '1' HOUR, 'yyyy-mm-dd hh24:mi')
    WHERE
        eventID=123 

Oracle returns this error:

 ERROR at line 4:ORA-01861: literal does not match format string 

where line 4 is REQ_EVENT_DATE = TO_CHAR(REQ_EVENT_DATE - INTERVAL '1' HOUR, 'yyyy-mm-dd hh24:mi').The REQ_EVENT_DATE field was originally populated with this stripped down query:

$date = '2007-12-25 08:35'; INSERT INTO (REQ_EVENT_DATE) VALUES (to_date('$date', 'yyyy-mm-dd hh24:mi'));

So - what is wrong with the UPDATE query?

View 1 Replies View Related

Application Express :: How To Update Total - New Value Doesn't Display In Field?

Oct 18, 2012

Let's say that we have an order entry app and the price and quantity items are already populated. We now want to show the user the extended price (the product of the first two items). the extended price would automatically display after both the quantity and price items are entered. I'm assuming that would require some kind of client-side processing. I imagine server-side processing is simpler, so I'll lean in that direction. I'm sure we've all seen web sites that require you to click a button for the order totals to be updated. I'm okay with that approach, but I haven't quite put all of the pieces together. Here's what I came up with.

A region button was added to trigger the updating of the extended price. The button's "Action When Button Clicked" is to submit the page. Under "Page Processing", a process was created to do the calculation with the recipient of the product being a page item. From debug code in the procedure, I can see that the item containing the extended price was, indeed, modified. But the new value doesn't display in the field and the Session window shows that the value of the item didn't change.

I must be missing something. The debug code says the item value was updated. The Session window says it wasn't updated. What gives? What did I do wrong and what needs to be done to correct this?

View 3 Replies View Related

SQL & PL/SQL :: Update Previous Row Based On Next Row And Update Duplicate Record

Mar 6, 2013

create table test1

( ID NUMBER(11)
,MEMBER_NMBR NUMBER(10)
,CODE_NMBR NUMBER(7)
,ROW_EFCTV_DT DATE
,ROW_TRMNTN_DT DATE

[code]....

insert into test1 values (11007,7462,32,'30/sep/2012','31/dec/9999',3,'25/sep/1998','AUTUMN',1,0,344);
insert into test1 values (11007,7462,32,'30/oct/2012','31/dec/9999',3,'25/sep/1998','AUTUMN',1,0,344);
IDMEMBER_NMBRCODE_NMBRROW_EFCTV_DTROW_TRMNTN_DTFLAG_NMBRBRTH_DTNAMECLAIM_CDAMT1AMT2
1100774623209/30/2012 00:0012/31/9999 00:00309/25/1998 00:00AUTUMN10344
1100774623210/30/2012 00:0012/31/9999 00:00309/25/1998 00:00AUTUMN10344

I have to update the row_trmntn_dt of first row to row_efctv_dt of 2nd row which is 30th Oct 2012 - 1 day i.e. 29th Oct 2012

View 10 Replies View Related

PL/SQL :: How To Update Null Data With Previous Not Null Data

Oct 25, 2012

Initially i have inserted the data into table like

Date                   xxx       yyyy
1/1/12 1 1
2/1/12 null null
3/1/12 null null
4/1/12 1 1
5/1/12 1 1
6/1/12 null null

in above example data is null for some date here my requirement is how can i copy before not null data(1/1/12) to *2/1/12, 3/1/12* .

View 3 Replies View Related

Foreign Key Would Be Populated On Each Record / Other Would Be Null

Mar 22, 2013

I have a central entity Address. I have other entities that could have many addresses (Organization, Person for eg). The relation between Organization and Address is one to many and the relation between Person and Address is also one to many.When I modelled it, I ended up having two foreign keys in Address (Organization ID and Person ID).The question that is being raised by the client is "As only one of the foreign key would be populated on each record, the other would be null". The client is not comfortable having nullable foreign keys as they won't be able to maintain integrity. One of the requirement is that No orphan records in Address. By modeling the way above, there are chances for having some orphanned records. I tried to explain that this would be controlled by the program to ensure that no orphan records would be there but their question is that what if someone goes directly and enters a record in Address table without any foreign key value (I dont know who would have an insert/update access on the tables other than the dba's).

I am trying to get some pros and cons on using the nullable foreign keys.

View 1 Replies View Related

SQL & PL/SQL :: How To Check Cursor Having Record Or Null

Jun 22, 2010

i want to check cursor having record or null/ if having records then count of records?

View 5 Replies View Related

Forms :: Stop Saving When Detail Record Is Null?

Feb 5, 2011

I have master detail block just consider Forms A as a master and Forms B as a Detail,when my cursor is in form A i try to save the record, it is saved Form A and putting Form B data as null, i have to put a validation to stop this activity, i have to inform the user "Provide values for form B text item",

I created a post block trigger in form A

Begin

If (:FORM-B.TEXT1 is null)l or( :FORM-B.TEXT2 is null)
then
Message( 'provide value for FORM-B');
Message( 'provide value for FORM-B');
raise form_trigger_failure;
ELSE
NULL;
END IF
END;

Im Getting error message and navigation got stopped in last item of form A itself,i need to show error message and cursor control should move to first item of form -B which trigger i have to use for this.

View 1 Replies View Related

PL/SQL :: How To Insert Null Record (some Column) In Table Using Loop

Jul 5, 2012

How to insert null record (for some columns) in table using loop.

sample data of x_tab

order_id order_name

231 xxx
123
345
111 vvvv

View 5 Replies View Related

Pulling One Record For Each Page?

Dec 1, 2009

I have an alerts system for a web site built in an Oracle DB. There are multiple alerts that can be assigned per page, but I want to display only the most recent. I have 5 pages but each page can have different alerts.

I have a parent table of all the alerts and a child table with the page assignments. I want to pull one record (the newest) for each page assignment. The pages can increase so I can't hardcode this.

I keep thinking I need to do something like:

SELECTalertID, headline
FROMalerts_V
WHEREalertID IN (
SELECTdeptID
FROMso_departments
)

But it's obviously not quite what I need and not the correct syntax.

View 5 Replies View Related

Server Utilities :: Field / Record Terminator - Trailing Null Col

Oct 7, 2010

I need to load a file with fields separated by '|^|' and at end of each record has '||*||'.

So in my ctl file what do i mention ? fields terminated by '|^|' ? for the record termination wat should I say?
Should I still mention 'trailing null col' in my ctl file...?

Sample data file:
Name|^|Age|^|city||*||
john|^|33|^|||*||
james|^||^|nyc||*||
ken|^|44|^|
washington||*||

the fields are properly terminated with |^| and the records are terminated with ||*||. Is it true that a file with |^| as field terminator cannot be loaded with sqlldr?

View 3 Replies View Related

Forms :: Login Page Value Disappear When Enter 2nd Record?

Jan 30, 2012

display value from login page to call another form first time value is appear when I enter new 2nd record that the time call value disappear.I means user name fix it when i create new record.

this is my code for pre-insert trigger block level

:PLACE_FROM:=:parameter.mc_name;
:SRECEIVER_NAME:=:parameter.USER_NAME;

View 5 Replies View Related

PL/SQL :: How To Pass Table Of Record As Parameter To Server Page

Apr 20, 2013

Is there any way to pass table of record as parameter to the plsql server page? For instance, I can define a new type in package specification:

create or replace package tst_type
as
type tab_expr_sec is table of varchar2(50) index by pls_integer;

type rec_expr is record (
prim_expr varchar2(50),
expr tab_expr_sec
);
[code]....

View 5 Replies View Related

Reports & Discoverer :: Master Detail Record Show One Page

Jun 30, 2011

When i create report in master detail. When detail record end on the page, the second record show on same page. Problem is that detail show on other page. I want that if record is completed on that page then ok. Otherwise it show on next page.

View 3 Replies View Related

Reports & Discoverer :: Show 1 Record Per Page In Matrix Report?

Nov 11, 2010

I want to show 1 record per page in matrix report. I set Main section orientation as landscape and width is 14. but it show multiple records on single page.

View 2 Replies View Related

Reports & Discoverer :: Displaying One Record Per Page For All Retrieved Records

Jul 26, 2011

I developed a report in 10g which displays more than 100 records.The requirement is to display each record on single page.Does Oracle Reports have the option to display each on single page?

View 7 Replies View Related

Application Express :: Execute JavaScript After Update And Submit In Skillbuilders Modal Page

May 13, 2013

I'm editing, say, list of my employees in a tabular form opened in Skillbuilders Modal Page. I have to execute same javascript code after the changes in the tabular form have been submitted.

I've tried using a Dynamic Action fired on Page Load, but that gets executed before the update is completed.

View 4 Replies View Related

Forms :: How To Update Record

Jan 1, 2013

I want to update record when i press the button "update" but i don't have idea ,if i will create a new forms ,or new block or the update is made in the same form.

View 10 Replies View Related

Application Express :: Dynamically Update A Number Field By Summing Of Page Item Values

Jun 28, 2012

I'm trying to update a number field on an apex page by summing up the values of multiple page items. I've tried to follow this tutorial

[URL]........

especially the "Create a Set Value Dynamic Action Using PL/SQL" part.

In the tutorial example they return an page item value P3_SAL multiplied by a multiplier they've determined by another page item's case. What I want to do is much simpler in that I just want to add up multiple page item values and then display them in a number field at the bottom of the page.

so the code I tried to use based on the tutorial is in the tab: Home >Application Builder>Application 103>Page 3>Edit Dynamic Action>Create / Edit Action

Set Type: PL/SQL Function Body

PL/SQL Function Body:

BEGIN
return :P3_ITEM1+P3_ITEM2+P3_ITEM3;
END;

Page Items to Submit: P3_ITEM1,P3_ITEM2,P3_ITEM3

But it gives me an error that I need to declare the identifiers, yet it works if I only use one item and I can perform any arithmetic.

i.e.

BEGIN
return :P3_ITEM1+1000;
END;

View 2 Replies View Related

Delete Record In Update Trigger?

May 24, 2012

the following case is successfully done with mssql databases.

Case:

Table UserGroup
Columns id, name, handshake

When the handshake is set to 'd', this record should be deleted. I know it is bad behaviour by design.

What have I done so far:

- created an after update trigger (mutual error) Caused by trying a delete action in the update action, not possible.

- created a view in combination of instead of update trigger.

This causes also mutual error, or if ignored (PRAGMA AUTONOMOUS_TRANSACTION), an deadlock.

Code so far:

create or replace procedure Delete_UserGroup_sp(p_groupId in USER_GROUP.HMIUSERGROUPID%TYPE, p_handshake in USER_GROUP.HANDSHAKE%TYPE)
is
begin
if p_handshake = 'd' then
delete USER_GROUP WHERE HMIUSERGROUPID = p_groupId;
commit;
end if;
end;

create or replace view USERGROUP_V as select * from USER_GROUP

create or replace trigger USER_GROUP_T1
instead of update on USERGROUP_V
for each row
declare
PRAGMA AUTONOMOUS_TRANSACTION;
begin
Delete_UserGroup_sp(:new.HMIUSERGROUPID, :new.HANDSHAKE);
end;

View 5 Replies View Related

Forms :: Frm-41051 / Cannot Update Record?

Jan 11, 2011

I got this error: frm-41051: You can not update this record

While i searched about this error on net,

I did everything..my block property is yes for INSERT_ALLOWED and UPDATE_ALLOWED.

By programatically I didn't set property false for that block.i check each and every item property for that block...its also yes for INSERT_ALLOWED and update_allowed..

View 2 Replies View Related

Forms :: Unable To Update Record

May 10, 2010

I have modified an existing form which is from 4 tables. I altered one of the table to suit my requirement and have compiled the form . It is compiled with out any errors. But when i enter any data it shows an error "frm-40509 --Unable to update record" and does not gets saved.

View 10 Replies View Related

Forms :: Cancel Update If Record Has Been Reported

Nov 19, 2010

I don't want the users to be able to update a record where the date reported field has a date.I have used the set_block_property(blk_id, update_ allowed, property_false). But it still prompts me if I do change something and I try to exit the form.

How can I stop the "Do you want to save changes you have made" box from showing?

View 5 Replies View Related

SQL & PL/SQL :: Select First Unlock Record In Table For Update

Jun 6, 2012

I'm looking for a solution to select the first row that is not currently locked in a table and insert a record to another table that reference that first row. this is my scenario:

create table ticket
(
id number(10) not null,,
ticket_type number(1) not null,,
is_sold number(1) not null,
CONSTRAINT ticket_pk PRIMARY KEY (id)
);

[Code]...

id ticket_type is_sold
------------ -------------------- -----
10000004 1 1
10000005 2 1
10000006 1 0
10000007 1 0
10000008 2 0
10000009 2 0

SQL> select * from customer_ticket;

cust_id cust_name ticket_id
------------ -------------------- ----------
1 John 10000004
2 Sara 10000005

my goal is finding the first free ticket ( not sold ) in the ticket table and insert buyer information of that ticket in customer_ticket table. at last I will mark that ticket as a sold one in ticket table with update.

Problem is that the first transaction locks the the first row in ticket table and the second transaction running the same query goes to wait untill the first transaction commit or rollback. However when first transaction finish successfully, second transaction select duplicate id from ticket table that was selected by the first transaction!

I tried to solve problem with "skip locked" and "nowait" options with select for update, but they didn't work.

View 13 Replies View Related

Forms :: Update Record In Join Condition Block?

Jun 13, 2012

i want to update record that is fetched based on join condition on form

1. made a block manually :::: EMPSAL
2. Query DATA SOURCE NAME :::: EMP a, Sal b
3. Where Clause :::: a.empid = b.empid
4. DML DATA Target Type :::: Table
5. DML DATA Target Name :::: EMP a, Sal b
6. All Columns are marked a.empid, a.empname, b.sal, b.date etc

It does not allow me to update record.

View 1 Replies View Related

Application Express :: Update Record In Another Row When Date Changed

Oct 10, 2013

As all of you know, In the Apex,  when you create a form with report in the page, you are able to insert and edit data. But when you edit the data, the data will be modified in the same row. In other word, you loose the old data.

What I need to do is: I have revised_num field and production_date field. I want to create a form with report and insert and edit data as is in the apex and insert 0 to the revised num until production date is null. But when  production date is not null, then from that point, I want to insert data to another row and modify revised num to 1. and I want the revised num be incremented by 1 each time the user modifies the data after the production date is not null.I don't know where I should start.

View 12 Replies View Related

Application Express :: Send Link To Update Some Record

Mar 8, 2013

Is there some simple solution how to send email to user with link ('I don't want to receive emails from you in the future') ?

The link should contain some key information for each user.

If user click the link - update of the table should be done. (some IDC updates from 'Y' to 'N').

Specs: APEX 4.1.1
Listener 1.1.3
DB 11G
Apache Tomcat 6.0

View 1 Replies View Related

Forms :: INSERT Record - Update Columns Of Table

May 31, 2010

I would like to UPDATE the columns p1 and p2 of my table student (studentid:pk,name,p1,p2,...) for a given studentid.and I have a when-button-pressed trigger with this

UPDATE student
SET student.p1=:validation.proj1,
student.p2=:validation.proj2
where UPPER(student.studentid)=UPPER(:validation.studentid);commit_form;

when I run my form with a correct studentid, I got this error: FRM-40508: ORACLE error: UNABLE to INSERT record

but it is cworking correctly in sqlplus; and I have all priveligies.

View 4 Replies View Related

Precompilers, OCI & OCCI :: How To Detect Offending Record For Update Statement

Jul 23, 2008

way to run an update statement through OCI and make it stop on the first offending record and then identify that record? Here is an example of what I need to do: I run an update with 5 records in the input buffer like this:

- the 1st record exists in the table
- the 2st record exists in the table
- the 3rd record does not exist in the table
- the 4rd records exists in the table but is violating some unique constraint
- the 5nd record exists in the table

I need to report that the 4th record from the input buffer has a problem, and then commit records 1, 2 and 3. Do not commit record 5. So far I have tried the following:

- OCIStmtExecute with OCI_DEFAULT. It stops on the first error, but I don't know how to identify the bad record. OCI_ATTR_ROW_COUNT returns the number of affected records in the target table. I didn't find any other attributes that would return 4, for the 4th bad record in the input buffer.

- OCIStmtExecute with OCI_BATCH_ERROR. I can identify the bad records in the input buffer by using OCI_ATTR_DML_ROW_OFFSET. However, OCIStmt Execute does NOT stop on the first violating record. It loads the whole input buffer and then reports which records were in error. I don't know how to commit only up to the first bad record -- the 4th in the example.

View 6 Replies View Related







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