Home » Developer & Programmer » Forms » Master/detail tables, problem interconnecting with an id (Oracle FORMS 6)
Master/detail tables, problem interconnecting with an id [message #329330] Wed, 25 June 2008 02:25 Go to next message
averno9
Messages: 30
Registered: June 2008
Location: Spain
Member
Hi again, this is not a real problem but is something really curious that intrigates me.

I posted a question about the same program on friday, but of course i'll explain the tables again. I have 3 tables, PERSON, EMPLOYEE and CLIENT. A person can be only once employee, only once a client or both.

They connect between each of them with ID, this ID is a 8-length array of numbers or letters, like:

A1253681

So, what i used is VARCHAR2(8 ), using a format mask of 'XXXXXXXX'.

Ok, i finished the program, and while testing it, i found something really weird. If you assign ID with '________', (8 undersigns) when you assign this ID a child (employee or client, doesn't matter) the child tables goes crazy and references every single record i have in them.

But, if i do a select in sql plus, that doesn't happen at all.

I have fixed this, using WHEN_VALIDATE_ITEM in ID, checking if it's a 8 length array and only has numbers or letters, that's why i wrote before this is not a real problem, but it's very curious.

Please post what you think it's happening here. Thanks a lot for reading.

PS: If you haven't understood the problem it's giving me, i put here an example of what's happening. You don't need to read it if you don't want to or if you understood it with the description.

Contents of tables:

PERSON.......EMPLOYEE..CLIENT
11111111.....11111111..33333333
22222222.....22222222..44444444
33333333.....33333333..55555555
44444444
55555555

If i select in my master table 11111111, i will have this:

PERSON.......EMPLOYEE..CLIENT
11111111.....11111111

Well, with the table like this, if i add the 8 undersigns guy and put him in employee or client, it happens like this when i select him in the master table:

PERSON.......EMPLOYEE..CLIENT
________.....________..33333333
..................11111111..44444444
..................22222222..55555555
..................33333333
Re: Master/detail tables, problem interconnecting with an id [message #329331 is a reply to message #329330] Wed, 25 June 2008 02:29 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
The reason is that the underscore is a wildcard; it means any single character.
So, if you query in Forms (or in fact in sql, using LIKE instead of =), you will get every record with 8 characters in the ID.
Nothing weird here.
icon10.gif  Re: Master/detail tables, problem interconnecting with an id [message #329341 is a reply to message #329330] Wed, 25 June 2008 02:51 Go to previous message
averno9
Messages: 30
Registered: June 2008
Location: Spain
Member
Oh you are right! So, the automatic connection from FORMS that i created, is using LIKE instead of equals, that's why is happening this. Thanks a lot! But the most curious thing is that union condition is assigned with this:

EMPLOYEE.ID = PERSON.ID

So, even with this, FORMS don't use equals, it uses LIKE. In other components, it could be it has a property to use LIKE or equals, but this one has only 10 properties, including name, subclass... Ok, mistery resolved, thanks again!
Previous Topic: How to achieve data saving while tab change.
Next Topic: How to get data from different database in form
Goto Forum:
  


Current Time: Fri Dec 09 21:14:18 CST 2016

Total time taken to generate the page: 0.08419 seconds