Forms :: How To Stop From Inserting If Condition Not Met

Feb 7, 2010

I have master detail datablocks. Master block is course and detail block is trainee. students can schedule their courses in a location at particular time.

lets assume student1 has scheduled course A1 in location LA1 from 9am to 12 pm. Now second student shouldn't be able to schedule same course at same time in same location. He can schedule at different time duration. or else same time duration but different location. Or same time, same location but different course.

so, what i did is, i wrote code in when-validate-record of trainee block to display a message saying " cannot schedule course.choose another time." if he try to insert same time duration or same location .

when i am trying to insert a record with time which is already scheduled and in same location, it displays the message but it is also saving the record. i don't want to save the record.

how should i do this? i tried to give ROLLBACK in this trigger but it doesn't accept. i tried pre-insert trigger also but it is also displaying message but saving the record

my code in when-validate-record is:

declare
cursor c1 is
select start_time,end_time,loc
from trainee
where cname=:course.cname;
[code].......

View 5 Replies


ADVERTISEMENT

SQL & PL/SQL :: Stop Inserting Data Into A Table Before It Inserting Using Trigger?

Jul 26, 2011

shall we stop inserting data into a table before it inserting using Trigger?

View 3 Replies View Related

Forms :: How To Stop Inserting Data If Commit Command Applied

Feb 17, 2010

How Can We Stop to insert Data if Master Block have the record and detail block have no record but commit command applied i want that commit command can not be work if detail block have no record

View 7 Replies View Related

Forms :: How To Stop Going To Next Record If It Is Last One

Jan 31, 2012

how to stop going to next record if it finds the last record. Because when i click my next button(it is the last record), i try to click my previous or first button but it won't go back, enter-query mode is the error message.

View 9 Replies View Related

Forms :: SQL Server In Stop Position?

May 25, 2011

SQLserver in stop condition when i play it. it again stop

View 1 Replies View Related

Forms :: How To Stop System Message

Nov 3, 2010

I have a form with multiple data block. When i want to query and go to next record then this displayed a message "Do you want save changes". But i would like to stop this message(i.e would not see the message) is it possible.

View 3 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

Forms :: Uploading From Excel Stop When Open File?

Oct 21, 2010

I'm uploading data from excel to our database using forms thru webutil. The problem is when I open the same excel file while the upload process is in progress, the uploading stops, BUT not displaying any error. Not even when I chick Help->Show error.

How could I prevent this error and how to trap and display error message?

View 8 Replies View Related

Forms :: Stop Responding When Pass From Master To Detail Block?

Jul 29, 2010

I have problem with the form when i pass from the master to detail block the form stop working and it stops responding even if i am in the next detail block and i press tab to change from one record to another the form will say working and it stops responding.

View 2 Replies View Related

Forms :: Inserting Into A Table Using Data From A Text Box

Feb 16, 2010

I have a form that has one text box in it, and I want this value to be inserted into a table called Staff Name, which has only one column, but im unsure as to how I would get my SQL statement to pick up this value.

I tried:

begin
insert into StaffName values ('addstaffmember');
end;

Add staff member is the name of the text box. this statement compiled but when I ran the form and tried to click save it would not work.

View 5 Replies View Related

Forms :: Inserting ID / SYSDATE And USER Automatically?

Aug 5, 2010

I have created a datablock and set up the user interface to allow the users to insert all the data they need, however my table has some fields which should be generated automatically and are not done through user input:

id - which is uniqe to each entry to the table so is gernerate by a sequence (which I created on the database) but when i put seq.nextval into the initial value on the datablock it says i cannot do this, so how do I use the sequence to insert the value into that field in the database. This is my primary key in my database whichobviosuly my users cant input data to, instead it is generated automatically.

User - similarly in the datablock is a user field which states the user that inserted that record, I know on the database i can put DEFAULT user for that field , but how do I make the user insert automatically through forms.

Date - Similarly again how do I set SYSDATE to be automatically input to the date field when the user submits the record?

View 8 Replies View Related

Forms :: Inserting Values Using PreInsert Trigger?

Sep 30, 2010

I am facing a problem while inserting primary keys using a sequence. Following is my case

I have a Master Table, say M_A, and 2 detail tables D_1 and D_2. I am trying to generate primary keys for the master and detail table as well as the reference keys for the detail tables using sequence.

I created a pre-insert trigger, say preInsertTRIG

proc_ABC(pri_key_master OUT VARCHAR2,
pri_key_detail1 OUT VARCHAR2,
fk_detail1 OUT VARCHAR2,
pri_key_detail2 OUT VARCHAR2,
[Code] ........

I am able to insert the P.K of the master table as well as P.K of one of the detail table. However, it fails to insert the P.K of 2nd detail table and reference keys for both the detail tables. I know there are other simple methods available in Forms, but I have to do it by this procedure only

View 5 Replies View Related

Forms :: Use Like Operator With If Condition?

Jan 19, 2013

i want to know that how can i use like operator with if condition. i m using oracle10g form builder and it's for search purpose .

for example ...

if search string=string2 then
message('Record found');
end if ;

i want to use like '%search string%'.

View 1 Replies View Related

Forms :: How To Default Where Condition

Nov 2, 2011

I am working on forms 6i. I have set where condition in pre-query of a trigger, my requirement is, in post-query, i want to delete the where condition.

pre-query:

set_block_property('HEADER_S',default_where,'STATUS IN (select meaning from XXSMCQSS_LOOKUP_VALUES where lookup_type=''CONCESSION STATUS CODES'' and primary_flag=''N'' )');

post_query: I want to delete this where condition, i just want make execute query normal by removing the where condition.

View 8 Replies View Related

Forms :: Commit With Condition

Jan 9, 2013

After committing form i want to clear few item and retain few item and make the form ready for next record to be inserted along with retained item.

View 4 Replies View Related

Forms :: Inserting / Retrieving Images In Oracle Database 10g

Mar 12, 2010

how can i insert a image by selecting an image from any drives of my system to oracle database and retriving that image for displaying purpose after inserting that image. if possible give me a sample form. like vb 6.0 or vb.net in textbox's change trigger fires instantly when we start typeing in the text boxes.

View 6 Replies View Related

Forms :: Inserting Multiple Records On Button Press

Jun 17, 2012

I have Multi record Block and for that block i have created one button, if we press that buttion it will open new block and it will post the records, Unfourtunately that block table dont have Primary key or any constraints .. so when we press that buttoon multiple times .. its posting multiple times..

Now i need to restrict to that which is should not post the records multiple timies i have tried by controling the paraemter..I have created one Non data base item initially value i assigned to 'N"

if the value is "N" then am doing process and showing the records and after processing am assigning the value to 'Y', if there are multiple records , at block level in pre-record trigger am assigning as 'N'.

View 2 Replies View Related

Forms :: Reading Excel Data And Inserting Into Table Using 6i?

Feb 16, 2004

how to read the excel data and insert into tables without using SQL loader. i tried using OLE2 package,but i am getting an non-oracle exception. even i tried using CSV format. but i couldn't make it.

View 3 Replies View Related

Forms :: Dynamically Passing Where Condition

Jul 4, 2011

I am working on 6i reports.I have below scenario to achieve.

I have FIND window and MAIN Window.

FIND Window: contains EMPNO, ENAME,and FIND button.

MAIN WINDOW: EMPNO, ENAME, SAL, JOB

If i enter something in FIND window, by clicking FIND button, it will populate data in MAIN window.I have below query in WHEN BUTTON PRESSED TRIGGER.

declare
cursor c1 is select empno, ename, job, sal from emp
where empno=nvl(:FIND.empno,empno)
and ename=nvl(:FIND.ename,ename)

begin
--here i am populating data into MAIN window block
end;

It's working fine.

REQUIREMENT: i want to pass where statement dynamically. Let us say if i pass only empno in FIND window, i want to pass 'WHERE empno=:FIND.empno' to existing select statement [I will keep select statement same without where condition]

If i pass empno and ename both, i want to pass 'WHERE empno=:FIND.empno and ename=:FIND.ename.

How to pass where condition to existing select statement based on parameters we pass in FIND window.

View 8 Replies View Related

Forms :: Dynamic Where Condition Using Set_block_property?

Nov 7, 2011

I am working on Forms 6i. I have data block A on table EMP.

Datablock A: Empno, Ename, Hiredate

I have FIND Screen: EMPNO, HIREDATE_FM,HIREDATE_TO and FIND Button.

I will search the records through FIND Screen.

I want to set the where condition of block A in pre-query trigger.

set_block_property('BLOCKA',default_where,'HIRE_DATE BETWEEN FIND.HIREDATE_FM and FIND.HIREDATE_TO');

Note: FIND in above is FIND Screen block.

It's not fetching any records, i doubt that there is syntax error in above statement.

View 1 Replies View Related

Forms :: If Condition In Post Change

Jan 23, 2013

I have a view t1 having the records:

1 A
1 A+
2 B
3 C
4 D

I want to display that in an LOV but without the first record (1 A) I used the code :

SELECT DISTINCT num,
DECODE(num,1,(SELECT DISTINCT desc FROM t1 a
WHERE a.desc='A+'AND a.num=1),desc) desc
FROM t1

this worked fine but how to apply this in a post_change trigger where a user inters the num and the desc appears in atext-item in my form

View 1 Replies View Related

Forms :: EXECUTE QUERY Using A Where Condition?

Jun 27, 2013

how can i execute query using a where condition?

View 9 Replies View Related

Forms :: Inserting Multiple Records In Table Through Tabular Form

Apr 1, 2012

i have a master-detail form.

detail block is tabular.

when-button-pressed trigger iam inserting records in another table.i write

insert into ONHAND_QTY_LOCATION(sno,matid,matcode,description,partno,onhand_qty,location)
values (:ship_dtl.slno,
:ship_dtl.mat_id,
:ship_dtl.mat_code,
:ship_dtl.description,
:ship_dtl.part_no,
:ship_dtl.rec_qty,
:ship_mstr.place_from)

it is inserting only one record in onhand_qty_location table that too the last record.

i want all the records which iam entering in detail block should get entered in onhand_qty_location table.

View 8 Replies View Related

Forms :: Displaying Number Of Records With Condition

Jul 8, 2012

In form i call a record from database table through execute_query. i have lov on ITEM_NO

i want to display on that form, no. of records of ITEM_NO which i select from the list. like if i have 10 records with item_no which i select from list is must show 1/10.

if i press the down arrow it should show next record of the same item_no.

View 5 Replies View Related

Forms :: Dynamic IF Condition Evaluation In 9i Environment

Apr 6, 2005

I'm using forms 9i. Let's say I have a Block in the form B1. It has two items I1 and I2. I have a table called T1 that has a column say C1. The data in the only record in T1 is 'NAME_IN(''B1.I1'') = 1 OR NAME_IN(''B1.I2'') = 2'..In forms I need to execute the following at POST-QUERY trigger of the block:-

DECLARE
VAR1 VARCHAR2(1000);
BEGIN
SELECT C1
INTO VAR1
FROM T1;
[code]....

As you could see that the IF statement is wrong. But I get the condition (for IF condition) as a string value from some database table.

View 9 Replies View Related

Forms :: How To Retrieve Only That Data Which Is Based On Given Condition

Jun 22, 2011

,i have a table called travel detail from which i have retrieved few rows based on 1 condition by using LOV and on next few rows modification is allowed. The rows are getting modified but it is also allowing me to enter in next blank row and insert any data in that row.how can i retrieve only that data which is based on the given condition. Further blank rows should not b displayed.

View 2 Replies View Related

Forms :: Inserting Multiple Selected Records Into Database When Click Button?

Jul 19, 2010

I got a form with few columns and a check_box. If the user selects n number of check boxes and click the button Save. The corresponding records should be inserted to XX_AP_CUSTOM table.

I have written the following below code in when-button-pressed trigger. With this i am able to insert only one record i.e where the current record indicator is there, even though multiple check-boxes(records) are selected.

declare

begin
IF :XXFBI_INV_QUOTE_ANAL_BLK.CHECK_BOX = 'Yes' THEN
--IF CHECKBOX_CHECKED(:XXFBI_INV_QUOTE_ANAL_BLK.CHECK_BOX) = TRUE Then
--app_insert.insert_record('WHEN-BUTTON-PRESSED');
insert into xxfbi.XXFBI_INV_QUOTE_ANAL(Item,

[code]......

I know that i have to use last_record and first_record and for loop to insert multiple selected records, but dont know how to do it.

View 5 Replies View Related

Forms :: FRM-15004 - Error While Parsing Join Condition?

Apr 16, 2008

I'm trying to create a relation from child block to the master block that I've created . Foreighn key is there from child to parent table.The error I get is below:

FRM-15004: Error while parsing join condition

The join condition is correct, but I'm still clueless as to what it could be.Is it a form bug?

View 7 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

Forms :: FRM-15004 Error While Parsing Join Condition

Aug 16, 2010

I receive a "FRM-15004 Error while parsing join condition" when attempting to create a relation between block1 (parent table) and block2 (child table). If I do a simple straight join the statement is accepted but if I use a Decode then it results in an error. How to successfully use a decode or a nvl in a join statement of a relation?

Results in Error:

block1.case_id = block2.case_id and
decode(block1.employee_id, null, block1.entity_id, block1.employee_id) =
decode(block2.employee_id, null, block2.entity_id, block2.employee_id)

This join is accepted but I would like to use a decode since a record can have either a employee_id or entity_id, not both

block1.case_id = block2.case_id and
block1.employee_id = block2.employee_id and
block1.entity_id = block2.entity_id

View 1 Replies View Related







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