Left outer join with as clause in server side script.

Left outer join with as clause in server side script.

bbrindzabbrindza Posts: 316Questions: 73Answers: 1

I need to use this SQL statement in my server side script.

select USER_PROFILE, REMOVAL_DATE, USERTAB1.UTNAME as name1 , USERTAB2.UTNAME as name2
from NWXXF.ACCESS_LOG
left outer join NWXX.USERTAB as USERTAB1 on USER_PROFILE = USERTAB1.UTUSER
left outer join NWXX.USERTAB as USERTAB2 on USER_REMOVED = USERTAB2.UTUSER

The problem is I am not sure how to code a custom select statement to use the name of the join fields. (ie name1 , name2)

Here is my SSP script script $table variable.

$table = 'NWXX.ACCESS_LOG

      left outer join NWFF.USERTAB as USERTAB1 on USER_PROFILE = USERTAB1.UTUSER 
      left outer join NWFF.USERTAB as USERTAB2 on USER_REMOVED = USERTAB2.UTUSER';

Any ideas would be helpful.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Answer ✓

    The script above appears to not be complete? I'm afraid that a statement like that wouldn't work with either the Editor libraries or the demo PHP SSP script. It would need to be a custom query to get it, but I'm not clear on that from the truncated code.

    Allan

  • bbrindzabbrindza Posts: 316Questions: 73Answers: 1

    Allan,

    A made a change to the SSP::simple function to pass a custom $select parameter.
    Works fine.

    Bob

This discussion has been closed.