Home
Analytics
rows[0]["siteid"] rows[1]["siteid"] what does it mean
srikar
the below query is taken from maximo out of box rptdesign file "" rfq_vendor_comparision.rptdesign ""
sqlText = " select rfqvendor.vendor, coalesce(quotationline.unitcost,0) unitcost, coalesce(quotationline.orderqty,0) orderqty, "
+ " quotationline.orderunit, coalesce(quotationline.linecost,0) linecost, rfqvendor.currencycode from rfq "
+ " inner join rfqline on rfq.rfqnum = rfqline.rfqnum and rfq.siteid = rfqline.siteid "
+ " inner join rfqvendor on rfq.rfqnum = rfqvendor.rfqnum and rfq.siteid = rfqvendor.siteid "
+ " inner join quotationline on rfq.rfqnum = quotationline.rfqnum and rfq.siteid = quotationline.siteid "
+ " and rfqline.rfqlinenum = quotationline.rfqlinenum and rfqvendor.vendor = quotationline.vendor "
+ " where rfq.rfqnum = '" + rows[1]["rfqnum"] + "' "
+ " and quotationline.itemnum = '" + rows[2]["itemnum"] + "'"
;
what does row[1]["rfqnum"] and rows[2]["itemnum"] mean??
Find more posts tagged with
Comments
mwilliams
'rows' can be called from your dataSet script to access row data. So, most likely, they're just accessing fields called rfqnum and itemnum. If you attach the report, I can probably be more specific.
srikar
<blockquote class='ipsBlockquote' data-author="'srikar'" data-cid="110360" data-time="1349877466" data-date="10 October 2012 - 06:57 AM"><p>
the below query is taken from maximo out of box rptdesign file "" rfq_vendor_comparision.rptdesign ""<br />
<br />
Main query<br />
<br />
sqlText = " select rfq.rfqnum, rfq.description, request.displayname as rfq_requestedby, "<br />
+ " purchase.displayname as rfq_purchaseagent, rfq.siteid, rfq.status, rfq.orgid from rfq "<br />
+ " inner join person request on rfq.requestedby = request.personid "<br />
+ " inner join person purchase on rfq.purchaseagent = purchase.personid "<br />
+ " where " + params["where"]<br />
+ " order by rfq.rfqnum"<br />
;<br />
<br />
Subdataset<br />
<br />
sqlText = " select rfqvendor.vendor, coalesce(sum(quotationline.linecost),0) total, rfqvendor.currencycode "<br />
+ " from rfq inner join rfqline on rfq.rfqnum = rfqline.rfqnum and rfq.siteid = rfqline.siteid "<br />
+ " inner join rfqvendor on rfq.rfqnum = rfqvendor.rfqnum and rfq.siteid = rfqvendor.siteid "<br />
+ " inner join quotationline on rfq.rfqnum = quotationline.rfqnum and rfq.siteid = quotationline.siteid "<br />
+ " and rfqline.rfqlinenum = quotationline.rfqlinenum and rfqvendor.vendor = quotationline.vendor "<br />
+ " where rfq.rfqnum = '" + rows[0]["rfqnum"] + "' "<br />
+ " group by rfqvendor.vendor, rfqvendor.currencycode order by rfqvendor.vendor "<br />
;<br />
<br />
Subdataset1<br />
sqlText = " select distinct rfqline.commoditygroup, rfq.rfqnum "<br />
+ " from rfq inner join rfqline on rfq.rfqnum = rfqline.rfqnum and rfq.siteid = rfqline.siteid "<br />
+ " inner join rfqvendor on rfq.rfqnum = rfqvendor.rfqnum and rfq.siteid = rfqvendor.siteid "<br />
+ " inner join quotationline on rfq.rfqnum = quotationline.rfqnum and rfq.siteid = quotationline.siteid "<br />
+ " and rfqline.rfqlinenum = quotationline.rfqlinenum and rfqvendor.vendor = quotationline.vendor "<br />
+ " where rfq.rfqnum = '" + rows[0]["rfqnum"] + "' "<br />
+ " order by rfqline.commoditygroup "<br />
;<br />
<br />
<br />
Subdataset2<br />
<br />
sqlText = " select rfqvendor.vendor, coalesce(sum(quotationline.linecost),0) linecost, rfqline.commoditygroup "<br />
+ " from rfq inner join rfqline on rfq.rfqnum = rfqline.rfqnum and rfq.siteid = rfqline.siteid "<br />
+ " inner join rfqvendor on rfq.rfqnum = rfqvendor.rfqnum and rfq.siteid = rfqvendor.siteid "<br />
+ " inner join quotationline on rfq.rfqnum = quotationline.rfqnum and rfq.siteid = quotationline.siteid "<br />
+ " and rfqline.rfqlinenum = quotationline.rfqlinenum and rfqvendor.vendor = quotationline.vendor "<br />
+ " where rfq.rfqnum = '" + rows[1]["rfqnum"] + "'"<br />
;<br />
<br />
<br />
Subdataset3<br />
<br />
sqlText = "select rfqline.itemnum, rfqline.description, coalesce(rfqline.orderqty,0) orderqty, rfqline.orderunit, "<br />
+ " rfqline.commoditygroup from rfqline "<br />
+ " where rfqline.rfqnum = '" + rows[1]["rfqnum"] + "'"<br />
+ " and rfqline.siteid = '" + rows[0]["siteid"] + "'";<br />
if (rows[1]["commoditygroup"] == null) {<br />
sqlText += " and rfqline.commoditygroup is null";<br />
} else{<br />
sqlText += " and rfqline.commoditygroup = '" + rows[1]["commoditygroup"] + "'";<br />
}<br />
<br />
subdataset4<br />
<br />
sqlText = " select rfqvendor.vendor, coalesce(quotationline.unitcost,0) unitcost, coalesce(quotationline.orderqty,0) orderqty, "<br />
+ " quotationline.orderunit, coalesce(quotationline.linecost,0) linecost, rfqvendor.currencycode from rfq "<br />
+ " inner join rfqline on rfq.rfqnum = rfqline.rfqnum and rfq.siteid = rfqline.siteid "<br />
+ " inner join rfqvendor on rfq.rfqnum = rfqvendor.rfqnum and rfq.siteid = rfqvendor.siteid "<br />
+ " inner join quotationline on rfq.rfqnum = quotationline.rfqnum and rfq.siteid = quotationline.siteid "<br />
+ " and rfqline.rfqlinenum = quotationline.rfqlinenum and rfqvendor.vendor = quotationline.vendor "<br />
+ " where rfq.rfqnum = '" + rows[1]["rfqnum"] + "' "<br />
+ " and quotationline.itemnum = '" + rows[2]["itemnum"] + "'"<br />
;<br />
<br />
<br />
@mwilliums
:: Due to security constraints i can not upload the rptfile..but please go thru the above sqlText and explain me...what does row[1]["rfqnum"] and rows[2]["itemnum"] mean??<br /></p></blockquote>
srikar
@mwilliums
:: Due to security constraints i can not upload the rptfile..but please go thru the above sqlText and explain me...what does row[1]["rfqnum"] and rows[2]["itemnum"] mean??
mwilliams
Without seeing the setup, I can't be exact, but it appears that row[1]["rfqnum"] is in a dataSet that is bound to a table that is embedded at least 3 tables deep. It would appear it's pulling rfqnum from the second most outer table (the most outer would be [0]) and it's pulling itemnum from the 3rd most outer table, which would make it at least the 4th deepest element.
itemnum only shows in subdataSet3, so the table for subdataSet4 is embedded in subdataSet3's table which is embedded in subdataSet1's table, which is embedded in the main query's table. This is just my best guess, from looking at the queries and not seeing the layout, but it appears subdataSet4 pulls those field values from subdataSet1 and subdataSet3.
Hope this helps. What's your BIRT version? Maybe I can give you an example that might help show what's happening, using the sample database, if you need.
cjm13905
<p>We are BIRT 3.7.1</p><p>if you have multiple datasets maindataset, dataseta, datasetb</p><p>and your sql code references </p><p> </p><p>rows[0]</p><p> </p><p>how can you tell what dataset it is referring to ?</p><p>Where is it defined that 0 refers to data set x ?</p>
wwilliams
<p>Each one of those datasets are "nested" e.g basically subreports you have the maindataset and each table down the hierarchy is dependent on the previous one. subData and 1,2,3,4 as Michael pointed out. If it still confusing add logging then maybe you can see visually what is happening it it will become clear.</p><p> </p><p> </p>