Session ID variable issue.

Hi, I'm trying to reference the Session Id in an Attribute Lookup Query to bring back the current 'user' and 'organisation'...I'm using $Session.Id for the variable but it's not recognizing it. Any ideas? Am I wasting my time?

Thanks

Paul

Parents Reply Children
  • Hi Manav,

    Thanks for getting back to me on this. To be honest it's been a while since I posted the 'cry for help' and I've forgotten

    the initial query I needed it for. Let me try and find the code and use your suggestion so see if that works.

    I will let you know if it's a success or not.

    Regards

    Paul

  • Manav,

    Okay...still getting a problem....this is the Attribute Lookup Query...

    SELECT dbo.documents.prefix + ' - ' 
           + dbo.documents.title AS value, 
           dbo.org_persons.person_id, 
           dbo.organisations.organisation_code 
    FROM   dbo.documents 
           INNER JOIN dbo.organisations 
                   ON Substring(dbo.documents.prefix, 8, 3) = 
                      dbo.organisations.organisation_code 
           INNER JOIN dbo.char_data 
                   ON dbo.documents.document_id = dbo.char_data.object_id 
           INNER JOIN dbo.org_persons 
                   ON dbo.organisations.organisation_id = 
                      dbo.org_persons.organisation_id 
    WHERE  ( dbo.char_data.char_id IN ( 9, 11, 17 ) ) 
           AND ( dbo.char_data.char_value = 'Inspection and Test Plan' ) 
           AND ( dbo.documents.current_revision = 'y' ) 
           AND ( dbo.org_persons.person_id = $Session.Person.Id ) 
           AND ( dbo.documents.template = 'n' ) 

    When we Test Query we get Invalid pseudocolumn "$Session"

    Any ideas?

    Thanks

    Paul

  • Paul,

    You are running query on Database or using eQL query builder as above query is SQL and I was thinking you are running eQL query  for Attribute Lookup?

    Regards,
    Manav B.



  • Hi Manav,

    I'm building the query in SQL Server. I can see what I'm doing there and grab the correct tables. Then I'm transferring the code to the eQL panel. I thought I was using eQL accepted code though? Do you think not?

    In SQL Server, if I substitute the session.person.id for a known person Id and then run the code, it works fine....and if I substitute the variable for the same know person id in the eQL panel it works fine too.

    I've dug through some other queries that we have in eB and on Attribute Queries and they seem to recognise the $Session.Persion.id.......it's just my attempt that is failing.

    Thanks for your time on this...it's much appreciated.

    Paul

  • The code you are using is with SQL syntax and eQL syntax is totally different.
    So you cant transfer the same query to eQL. You need to change the syntax before query to eQL.

    Please let me know if you need help with eQL query.

    Regards,
    Manav B.