Menu

OQL Query

mackermann
2016-05-10
2016-05-11
  • mackermann

    mackermann - 2016-05-10

    Hello, i would like to modify my dashboard but i'm not familiar with OQL language :-/
    I have got this view :
    SELECT IPv4Subnet WHERE status = "allocated"

    But i would like to add name of the VLAN in a new column in my table.

    This query "SELECT lnkIPSubnetToVLAN" does the job, but i lose "ip_occupancy" attribut...
    Any idea?

     
  • mackermann

    mackermann - 2016-05-10

    I forgot to mention that I use teemip application :) thank you for your help.

     
  • lndevnull

    lndevnull - 2016-05-10

    Try this:

    SELECT IPv4Subnet,lnkIPSubnetToVLAN FROM IPv4Subnet
    JOIN lnkIPSubnetToVLAN ON lnkIPSubnetToVLAN.ipsubnet_id = IPv4Subnet.id
    WHERE status = "allocated"
    

    https://wiki.openitop.org/doku.php?id=oql:start

     
  • mackermann

    mackermann - 2016-05-11

    Thanks a lot, it works!
    But i have got an another problem if i want to sort by VLAN. I have got this error :

    Debug trace:~~~

    0 /var/www/html/teemip/core/MyHelpers.class.inc.php(40): MyHelpers::HandleWrongValue('field name in O...', 'vlan_id_friendl...', Array)

    1 /var/www/html/teemip/core/metamodel.class.php(2188): MyHelpers::CheckValueInArray('field name in O...', 'vlan_id_friendl...', Array)

    2 /var/www/html/teemip/core/dbobjectset.class.php(516): MetaModel::MakeSelectQuery(Object(DBObjectSearch), Array, Array, Array, NULL, 50, '0')

    3 /var/www/html/teemip/core/dbobjectset.class.php(685): DBObjectSet->Load()

    4 /var/www/html/teemip/application/datatable.class.inc.php(391): DBObjectSet->Seek(0)

    5 /var/www/html/teemip/application/datatable.class.inc.php(183): DataTable->GetHTMLTableValues(Array, '', 50, true, Array)

    6 /var/www/html/teemip/pages/ajax.render.php(185): DataTable->GetAsHTMLTableRows(Object(ajax_page), 50, Array, '', true, Array)

    7 {main}

    ~~~

     

    Last edit: mackermann 2016-05-11

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.