This topic is locked

Ownership based on field value that does not exist

3/1/2007 4:43:11 AM
PHPRunner General questions
G
gdude66 author

Trying to get ownership working working whilst calling a field from another table

SQL is

select `idS1LG`,

concat(sn," ",fn)

`stuid`,

`vmlg1a`,

`vmlg1b`,

`vmlg1c`,

`vmlg1`,

`vflg1a`,

`vflg1b`,

`vflg1c`,

`vflg1`,

`vstu1`,

`class`,

`dateinput`,

`dateedited`

From `lgsem1`

right join student on lgsem1.stuid=student.code

But I want to pull the class value from another table as `student`.`home group`
I have tried it with

`student`.`form group`AS`class`,


and it works up until I use the owner field where the owner table is staff and field is home group but in the target table the class field no longer is visible so the ownership is broken.
Originally I used values to write the form to the table but realised that form (which comes from another table) can change and it needs to be updated from the student table and cross referenced from there rather than writing a static value.
Is there another way of working the ownership think so that main table owner field can be redirected to another table reference rather than writing the value to the new table?

Alexey admin 3/1/2007

Graeme,
try to modify your query this way:

select `idS1LG`,

concat(sn," ",fn)

`stuid`,

`vmlg1a`,

`vmlg1b`,

`vmlg1c`,

`vmlg1`,

`vflg1a`,

`vflg1b`,

`vflg1c`,

`vflg1`,

`vstu1`,

`student`.`form group`AS`class`,

`dateinput`,

`dateedited`

From `lgsem1`

right join student on lgsem1.stuid=student.code


Since your "class" field is still in the main table you can choose it as Main table OwnerID on Advanced Security dialog.

G
gdude66 author 3/1/2007

Graeme,

try to modify your query this way:
Since your "class" field is still in the main table you can choose it as Main table OwnerID on Advanced Security dialog.



Thank you - that works nicely. It would be better to not have the dummy field but this works OK. Great support again.