Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Passing the Maximo Where Clause to an asp web page
Riad
Hi,
Is it possible to pass the maximo Where Clause to an asp web page ?
The Where clause will be used in the asp web page like this:
SQL = "SELECT PO.* FROM PO WHERE " + WHERECLAUSE
The asp web page will be put in the birt report as Hyperlink
Thanks
Find more posts tagged with
Comments
johnw
The Where clause is a parameter in BIRT reports, so yes, you just need to pass it through as params["where"]
Riad
<blockquote class='ipsBlockquote' data-author="'johnw'" data-cid="97082" data-time="1330630266" data-date="01 March 2012 - 12:31 PM"><p>
The Where clause is a parameter in BIRT reports, so yes, you just need to pass it through as params["where"]<br /></p></blockquote>
<br />
Thanks johnw for the reply,<br />
<br />
I tried this and it didn't work.<br />
SQL = "SELECT PO.* FROM PO WHERE " + params["where"]<br />
<br />
<br />
In fact I want to retrieve the where used by maximo to show selected PO <br />
for example if maximo have (where PONUM like '14059%')<br />
<br />
The sql in my asp web page will have the same clause where<br />
SQL = "SELECT PO.* FROM PO WHERE PONUM like '14059%'<br />
<br />
Thanks
johnw
SQL = "SELECT PO.* FROM PO WHERE 1 = 1 " + params["where"]
Give that a try. I seem to recall that Maximo will add and AND to everything in its where clause. I don't have a copy of Maximo handy to give it a try. Also, you can refer to the report in the Maximo examples directory, they show how that mechanism work. Or you can use the extract report tool to get a existing report.
micajblock
<blockquote class='ipsBlockquote' data-author="'johnw'" data-cid="97087" data-time="1330635376" data-date="01 March 2012 - 01:56 PM"><p>
SQL = "SELECT PO.* FROM PO WHERE 1 = 1 " + params["where"]<br />
<br />
Give that a try. I seem to recall that Maximo will add and AND to everything in its where clause. I don't have a copy of Maximo handy to give it a try. Also, you can refer to the report in the Maximo examples directory, they show how that mechanism work. Or you can use the extract report tool to get a existing report.<br /></p></blockquote>
<br />
Use params["where"].value. Also it does not include a preceding 'AND', so it should be :<br />
SQL = "SELECT PO.* FROM PO WHERE " + params["where"]
Riad
Thanks johnw and mblock for your reply,
It still not working. I put the [where] parameter in the report to show his value and it was
((po.poid = 1042))
I tried without succes all this:
SQL = "SELECT PO.* FROM PO where 1=1 " & params["where"]
SQL = "SELECT PO.* FROM PO where 1=1 " + params["where"]
SQL = "SELECT PO.* FROM PO where 1=1 and " & params["where"]
SQL = "SELECT PO.* FROM PO where 1=1 and " + params["where"]
SQL = "SELECT PO.* FROM PO where " & params["where"]
SQL = "SELECT PO.* FROM PO where " + params["where"]
micajblock
<blockquote class='ipsBlockquote' data-author="'Riad'" data-cid="97113" data-time="1330700276" data-date="02 March 2012 - 07:57 AM"><p>
Thanks johnw and mblock for your reply,<br />
<br />
It still not working. I put the [where] parameter in the report to show his value and it was <br />
((po.poid = 1042))<br />
<br />
I tried without succes all this:<br />
<br />
SQL = "SELECT PO.* FROM PO where 1=1 " & params["where"]<br />
SQL = "SELECT PO.* FROM PO where 1=1 " + params["where"]<br />
<br />
<br />
SQL = "SELECT PO.* FROM PO where 1=1 and " & params["where"]<br />
SQL = "SELECT PO.* FROM PO where 1=1 and " + params["where"]<br />
<br />
<br />
SQL = "SELECT PO.* FROM PO where " & params["where"]<br />
SQL = "SELECT PO.* FROM PO where " + params["where"]<br /></p></blockquote>
<br />
This is the correct one:<br />
SQL = "SELECT PO.* FROM PO where " + params["where"].value<br />
<br />
Why it is not working I do not know. What error are you getting?
Riad
Hi,
Sorry for the delai, I'm not working full time on this issue.
It didn't work with SQL = "SELECT PO.* FROM PO where " + params["where"].value
It shows me HTTP 5000 error.
But when I use SQL = "SELECT PO.* FROM PO where po.ponum = '" & 13056218 & "'"
It works fine.
Thanks
Riad
Sorry not HTTP 5000 but HTTP 500
micajblock
How are you calling the ASP page?
Riad
By a Hyperlink on a data set column and I call a asp file
"
http://ServerName/main.asp"
;
micajblock
<blockquote class='ipsBlockquote' data-author="'Riad'" data-cid="97245" data-time="1330965789" data-date="05 March 2012 - 09:43 AM"><p>
By a Hyperlink on a data set column and I call a asp file<br />
<br />
"<a class='bbc_url' href='
http://ServerName/main.asp'>http://ServerName/main.asp"</a><br
/></p></blockquote>
<br />
What does your URI expression look like in BRD?
Riad
<blockquote class='ipsBlockquote' data-author="'mblock'" data-cid="97246" data-time="1330966003" data-date="05 March 2012 - 09:46 AM"><p>
What does your URI expression look like in BRD?<br /></p></blockquote>
<br />
<br />
Location: "<a class='bbc_url' href='
http://ServerName/main.asp'>http://ServerName/main.asp"</a><br
/>
Target: Self
micajblock
<blockquote class='ipsBlockquote' data-author="'Riad'" data-cid="97247" data-time="1330967993" data-date="05 March 2012 - 10:19 AM"><p>
Location: "<a class='bbc_url' href='
http://ServerName/main.asp'>http://ServerName/main.asp"</a><br
/>
Target: Self<br /></p></blockquote>
<br />
So how are you passing the where clause? Should it notbe something like:<br />
<br />
"<a class='bbc_url' href='
http://ServerName/main.asp?where='>http://ServerName/main.asp?where=</a>
; " + params["where"].value
Riad
<blockquote class='ipsBlockquote' data-author="'mblock'" data-cid="97248" data-time="1330968142" data-date="05 March 2012 - 10:22 AM"><p>
So how are you passing the where clause? Should it notbe something like:<br />
<br />
"<a class='bbc_url' href='
http://ServerName/main.asp?where='>http://ServerName/main.asp?where=</a>
; " + params["where"].value<br /></p></blockquote>
<br />
<br />
Ok the where is passing ... Thank you very much ...<br />
<br />
Still a little issue, the where is using the poid not the ponum and the SQL is not recognising the POID <br />
<br />
this is the error: ORA-00904: "PO"."POID": invalid identifier <br />
<br />
Do you have a idea why ?<br />
<br />
The where I retrieve within the asp is ( ( po.poid = 1042 ))<br />
<br />
Thanks
micajblock
<blockquote class='ipsBlockquote' data-author="'Riad'" data-cid="97253" data-time="1330972494" data-date="05 March 2012 - 11:34 AM"><p>
Do you have a idea why ?<br /></p></blockquote>
<br />
Probably the SQL in your ASP page is being generated incorrectly.