Tabular Form - Different Value Columns

Oracle Application Express - web application development tool (antigamente conhecido como Oracle HTML-DB)
Post Reply
Robson Costa
Rank: Analista Sênior
Rank: Analista Sênior
Posts: 155
Joined: Fri, 17 Oct 2008 6:05 pm
Location: Campo Grande - MS

Hello,

In a tabular form I want a value of a column not equal to the other. How do I do that? I'vê tried for validation and it did not work. That is, if in the form, we had the following case:

Col. 1 Col.2
XX

Clicking on the submit, An error message appears. You can only accept if Col.2 is different from Col.1
arthae
Rank: Programador Sênior
Rank: Programador Sênior
Posts: 52
Joined: Mon, 09 May 2011 1:13 pm
Location: Porto Alegre - RS
GIVE ME COFFEE AND NO ONE GETS HURT!

Dude, I did not quite understand your doubt.

But I believe that when the person clicks the Submit button you have to go through the entire block from the first record until the last, comparing the values.

To stop the application you can use raise_application_error or exceptions ... There are several possibilities!
Robson Costa
Rank: Analista Sênior
Rank: Analista Sênior
Posts: 155
Joined: Fri, 17 Oct 2008 6:05 pm
Location: Campo Grande - MS

No, what I want is the following: The value of column 1 can not be equal to column 2, on the same line.

That is when I type X for column 1 and have the same X value in column 2 for the same line in the table, when I click the Submit button, an error message .

ie:

Column 1 Column 2
XX -> Error message and not saved
YX -> OK . Records the record

This on the same line as the table, that is in the same record. In different records no problem.
paisneto
Rank: Programador Júnior
Rank: Programador Júnior
Posts: 16
Joined: Wed, 05 Feb 2014 6:48 am
Location: Portugal

Good morning,
I do not know if I understand correctly, if you put a validation in the X field to say that it can not be equal to the value of the Y field, I think it will solve your problem.
Robson Costa
Rank: Analista Sênior
Rank: Analista Sênior
Posts: 155
Joined: Fri, 17 Oct 2008 6:05 pm
Location: Campo Grande - MS

Hi,

was what I did pus a validation in the X field to check if it is equal to the Y field, but it did not work.

Only the X field is Updatable. All other fields in Tabular Form are just display the text.

Maybe the detail is that in the X field it is not a text field, but a Select List. This Select List has all values ??that were recorded in the Y field of the table, including the value of that record.

I hope that with these details can help.
paisneto
Rank: Programador Júnior
Rank: Programador Júnior
Posts: 16
Joined: Wed, 05 Feb 2014 6:48 am
Location: Portugal

Good afternoon, you're saying this happens in Apex, right?
In APEX Create a validation item for one of the PL / SQL fields.
Robson Costa
Rank: Analista Sênior
Rank: Analista Sênior
Posts: 155
Joined: Fri, 17 Oct 2008 6:05 pm
Location: Campo Grande - MS

But that's what I did and it does not work.
paisneto
Rank: Programador Júnior
Rank: Programador Júnior
Posts: 16
Joined: Wed, 05 Feb 2014 6:48 am
Location: Portugal

What are the types of fields you want to compare?
I did with two text type text and it worked.
A PL / SQL Error type validation
Here is the validation code

Select all

IF : P135_X = : P135_Y  THEN 
   raise_application_error (-20001,'Os valores são iguais'); 
END IF;
Robson Costa
Rank: Analista Sênior
Rank: Analista Sênior
Posts: 155
Joined: Fri, 17 Oct 2008 6:05 pm
Location: Campo Grande - MS

One of the fields is a SELECT LIST and the other is display the text.
paisneto
Rank: Programador Júnior
Rank: Programador Júnior
Posts: 16
Joined: Wed, 05 Feb 2014 6:48 am
Location: Portugal

Robson Costa wrote: One of the fields is a Select List and the other is display the text.
Put here as you did the validation, do not forget that in select list you have to Compare is with the return value and not with the value that is displayed
Robson Costa
Rank: Analista Sênior
Rank: Analista Sênior
Posts: 155
Joined: Fri, 17 Oct 2008 6:05 pm
Location: Campo Grande - MS

I put direct fields (x <> y), X being the column with Select List.
Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 10 guests