Hii All,
I would like to know is there any way to find whether
record found after a DB query. Here is my script below.
$QueryDef = $CQsession->BuildQuery('ABC');
$QueryDef->BuildField('recname');
$operator = $QueryDef->BuildFilterOperator($CQ::CQ_COMP_OP_EQ);
$operator->BuildFilter("id", $CQ::CQ_COMP_OP_EQ, $rec);
$ResultSet = $CQsession->BuildResultSet($QueryDef);
$ResultSet->Execute();
After this execute command, I want to check whether is the record is successfully retrieved or not. Basically I want to find whether the $rec which I am passing in the query (in the - select ....from table ..where id = $rec), I want to see the passing $rec is valid or not.\n
Note : Dont worry about the ClearQuest command build query. Even in a normal commands, it will end end up in $resultset->buildquery(). So I am expecting some thing like,
if (!$ResultSet) {
}
else {
while (($ResultSet->MoveNext()) == 1)
......
......
}
Any input would greatly helpful. Thanks,
Thanks and Best Regards,
2006-06-16 Retitled by planetscape, as per Monastery guidelines
( keep:1 edit:5 reap:0 )
Original title: 'How to find the return of $ResultSet->Execute() in a DB Qry select ???'
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.