Documentation for snmp4j TableUtils implies the getTables method can be used to retrieve more than one table. Anyone know how to use it in that manner. Just not intuitive for me. I'm wondering if i just put in the columns for table 1 and table 2 in the OID argument and the table util will be able to seperate them all out and i'll just have to distinguish them in the list of TableEvents (rows) that are returned?
http://www.snmp4j.org/doc/org/snmp4j/util/TableUtils.html
I have tried the same situation as you have posted here. While trying out OIDs from different tables i reached the following conclusion and i'm nt sure whether its the way which they have intended. The VariableBinding[] we get as an output will contain result in the order in which we are passing the OIDs into the array and thereby we can match the input and output.
For eg input - new OID[".1.3.6.1.2.1.2.2.1.2", ".1.3.6.1.2.1.25.4.2.1.2"];
output -new VariableBinding["1.3.6.1.2.1.2.2.1.2.1=somevalue", "1.3.6.1.2.1.25.4.2.1.2.1=System Idle Process"];
new VariableBinding["1.3.6.1.2.1.2.2.1.2.2=somevalue", null];
.
.
.
Hope it was some use for you.
Regards
Ajin
Related
I'm used to compare 2 data, one data has an id and the other data is the one that needs comparing to get the matching datas. see code below.
DB::table('requests')->where('reqItem',$inventory->invItem)->get();
The code shown above displays all requests information that equals to the compared inventory item.
Now what i want to do now is to compare 2 tables without any id (ex. $inventory->invItem). I don't know how to ask this question but i hope you get what i mean. The figure below shows the way i wanted it to be.
You can run this query. Here, 'inventory' is the name of second table (change it accordingly)
DB::table('requests')
->join('inventory', 'requests.reqItem', '=', 'inventory.invItem')
->select('inventory.reqItem')
->get();
I will be dynamically combining a range of tables with the exact same structure in RethinkDB.
I have my dynamically-generated list of tables in an array as follows:
tables = [r.table('table1'), r.table('table2'), ...]
And I am trying to do this:
r.union(r.args(tables))
But that just gives me an error: ReqlLogicError: Expected type DATUM but found TABLE
Overall, I have not been able to find a way to generate a list of tables in JavaScript and to add use r.union to combine them into a stream. Would appreciate help on this.
Thanks!
You can use reduce to do what you want, we merge one by one, like r.table(t1).union(r.table(t2)).union(r.table(t3)).
Like this:
[r.table('t1'), r.table('t2'), r.table('t3')].reduce(function(p, c) {
return p.union(c)
})
Try it from data explorer.
The answer provided by kureikain works. I still wish the functionality existed in RethinkDB with r.args() (it seems to me that this would be consistent with the documentation of that function).
Moreover, one important tip tangentially related to this question: if you want to combine multiple tables into a stream through r.union() but be able to tell which table it is in the results, use merge(). So my query would look something like this:
[r.db('database').table('table1').merge({source: 'table1'}), r.db('database').table('table2').merge({source: 'table2'})].reduce(function(p, c) { return p.union(c) }).filter( ...)
This allows you to not only combine multiple tables into one stream, but to always distinguish between the source tables in your results (by looking up the value of the key 'source').
I have a use case where i am mapping two tables to the same object.
In this object i have a string called source and I want to be able to set the table name or the database name to this variable.
Any ideas on how to achieve this?
I have thought about iterating over my list and manually setting it but this has the potential to waste a fair chunk of time.
I appreciate this is somewhat of an odd request so this may be the only way but am hoping for a solution that maps the source variable when hibernate is mapping everything else.
if i had understood correctly your issue , then your solution might be the MappedSuperClass , in which you must have an abstract class , which will have the common fields of the two tables and then you will extend that to the two entities you want , which will point to two different tables.
Check this link
You could try to achieve this with Load listener or Interceptors. In the listener/interceptor you can check what the data source is and populate the source field accordingly.
In the end i ended up using a formula to map my variable to a select statement which was sufficient for what i needed.
Following is the data model of the dashboard I am facing problem in:
http://blob:http://stackoverflow.com/f3e40cfe-e009-4d03-bcf5-b7b4305c18c4
Now, what i want to achieve is that in Case there is a filed named Manufacturing_Date. And in MWODefetcs there is a field named Defect_Date. What i want is that when ever a record is selected from a table containing cases from Case corresponding records are shown in another table based on the exact match of Manufacturing_Date=Defect_Date.
As simple as it sounds, i can not seem to accomplish it. I have tried the following expressions to no avail:
Count({<[Defect_Date_text]=p([Manu_text]),FaultID=,DEFECT_CODE=>}MFG_BARCODE_NUM)
sum({$<Defect_Date ={"=$(Manufacturing_Date__c)"}>}Defect_Date)
Do the 2 tables need to be directly linked. Is it the intermediary iFaults table that is preventing me to accomplish it?
Please help.
you should use the P() set expression like this:
sum({$<Defect_Date =P(Manufacturing_Date__c) >}Defect_Date)
I have an assignment where I have two tables. Both of these two tables have multiple records that can be grouped by a certain ID creating record sets within those two tables
Those record sets can have various number of records. The trick is I have to compare those two tables and compare them by those record sets. If one record set ordered by update date (one of the record fields) doesn't find an identical record set in another table, I have to output that record set
What is the best way to do it? How do I compare two different tables by record groups/record sets/record blocks?
Should I use sub-query factoring? Should I temporary tables? Should I use something else?
Thank you very much for your generous responses and please let me know if I made my question unclear
i guess you just need a minus query to show the differences.
If you use Toad there is a specific function. Or you can use the minus operator or read this other post link