I am trying to use profiler in my script.
My understanding is that the function
<profiler GET $msg> will generate a string/list which
I can later use in the likein clause. I have a profiler
table setup as
create table profiles
( id counter,
Query varchar(200),
..... -- other fields
)
I created index as:
create metamorph counter index xmmprofilestext
on profiles(Query);
and here is the testing function:
<a name=simpletry public>
<profiler INIT profiles testprofile Query>
<$mymsg = "Linux kernel distribution is free">
<sum "%s" "select id,Query from profiles where Query likein '" $mymsg "'">
<TABLE border=1>
<tr><th>Original msg</th><td>$mymsg</td>
<tr><th>Text to match </th><td>$mymsg</td>
<tr><th>Command</th><td>$ret</td></tr>
</TABLE>
<TABLE border=1>
<tr><th>id</th><th>Query</th></tr>
<!-- SQL $ret -->
<SQL "select id,Query from profiles where Query likein $mymsg ">
<tr><td>$id</td><td>$Query</td> </tr>
</SQL>
</TABLE>
<hr>
<profiler GET $mymsg testprofile >
<$mymsg = $ret>
<sum "%s" "select id,Query from profiles where Query likein '" $ret "'">
<TABLE border=1>
<tr><th>Returned by Profiler</th><td>$mymsg</td>
<tr><th>Text to match </th><td>$mymsg</td>
<tr><th>Command</th><td>$ret</td></tr>
</TABLE>
<TABLE border=1>
<tr><th>id</th><th>Query</th></tr>
<!-- SQL $ret -->
<SQL "select id,Query from profiles where Query likein $mymsg ">
<tr><td>$id</td><td>$Query</td> </tr>
</SQL>
</TABLE>
</a>
The first part which use likein but not against result from profiler will be fine but the
<profiler GET $mymsg >
does not return anything at all. In turn, I can not get any result from second sql.
My profile table have two relevent entries with Query as:
kernel
Linux distribution kernel
I assume this is a ready-to-use feature. What I missed
here. Do I need to turn certain sqlcp or apicp option on or off?
I know that I need do this for the first part to work:
<apicp allinear true>
Any help is appreciated.
Wenlai
My understanding is that the function
<profiler GET $msg> will generate a string/list which
I can later use in the likein clause. I have a profiler
table setup as
create table profiles
( id counter,
Query varchar(200),
..... -- other fields
)
I created index as:
create metamorph counter index xmmprofilestext
on profiles(Query);
and here is the testing function:
<a name=simpletry public>
<profiler INIT profiles testprofile Query>
<$mymsg = "Linux kernel distribution is free">
<sum "%s" "select id,Query from profiles where Query likein '" $mymsg "'">
<TABLE border=1>
<tr><th>Original msg</th><td>$mymsg</td>
<tr><th>Text to match </th><td>$mymsg</td>
<tr><th>Command</th><td>$ret</td></tr>
</TABLE>
<TABLE border=1>
<tr><th>id</th><th>Query</th></tr>
<!-- SQL $ret -->
<SQL "select id,Query from profiles where Query likein $mymsg ">
<tr><td>$id</td><td>$Query</td> </tr>
</SQL>
</TABLE>
<hr>
<profiler GET $mymsg testprofile >
<$mymsg = $ret>
<sum "%s" "select id,Query from profiles where Query likein '" $ret "'">
<TABLE border=1>
<tr><th>Returned by Profiler</th><td>$mymsg</td>
<tr><th>Text to match </th><td>$mymsg</td>
<tr><th>Command</th><td>$ret</td></tr>
</TABLE>
<TABLE border=1>
<tr><th>id</th><th>Query</th></tr>
<!-- SQL $ret -->
<SQL "select id,Query from profiles where Query likein $mymsg ">
<tr><td>$id</td><td>$Query</td> </tr>
</SQL>
</TABLE>
</a>
The first part which use likein but not against result from profiler will be fine but the
<profiler GET $mymsg >
does not return anything at all. In turn, I can not get any result from second sql.
My profile table have two relevent entries with Query as:
kernel
Linux distribution kernel
I assume this is a ready-to-use feature. What I missed
here. Do I need to turn certain sqlcp or apicp option on or off?
I know that I need do this for the first part to work:
<apicp allinear true>
Any help is appreciated.
Wenlai