Join our DNN Community    (Newsletter, Tips, Tricks and Forums for DNN Skins & Modules)

 


 
Microsoft Gold Certified Partner - DNN Benefactor

DotNetNuke Powered! 


Thursday, August 28, 2008 Register · Login · Contact · Search:  
Company Solutions Portfolio Contact
Forums
General
The ever-powerful ListX module forum. Post your questions, new configuration ideas and reviews.
Subject: urgent simple question

You are not authorized to post a reply.   
Author Messages
spherop
Welterweight
Posts:34

07/01/2008 1:43 PM Alert 
sorry for the rush ...client meeting today and having trouble with something very simple.

how can i test if a listx execute/query returns no rows.

eg: the following action: EXEC QUERY

NAME: GetCustomerID
QUERY: select CustomerID from CSCWGCustomers where UserID = [UserID,System]

i would like an IF statement to be able to see if the value of [CustomerID,GetCustomerID] is empty.

IF '[CustomerID,GetCustomerID]' = '' .. doesn't work... NULL? i am not clear on this but i know it must be easy ...


thanks
pauldes
Immortal
Posts:1366

07/01/2008 8:32 PM Alert 
In your Detail section you have 4 boxes. List(display of each row returned) Alternate(to alternate the display for each row for even numbered rows), No Results(where you display a message if your query returns no rows) and No Query, which is a place you can put HTML if you are not going to use the Query section of the module at all, for the specific module.

ListX....makes you look brilliant, even though you're not.
spherop
Welterweight
Posts:34

07/01/2008 10:19 PM Alert 
hmmm yeah i know about all those aspects; thanks.

but i am doing some things on the backend db that require querying and IF/THEN responses to results. I need to be ACTION:QUERY results is empty or not. Is this not possible with LISTX?
pauldes
Immortal
Posts:1366

07/01/2008 11:03 PM Alert 
Ah, that's different. Couple of ways to do it.....
Do your Action:Executes include an ID field that is an integer or a GUID of a constant length? if so then you can figure it out.

After your query, say you always had a recordid of int, and your action:execute was called [myquery]. then, your next action could be
IF '[FORMAT,"[recordid,myquery]",{ISNUMERIC}]' = 'True', then you know you have results. If you do not have results then the [recordid,myquery] will be evaluated literally and be seen as a text string. You can do the same kind of thing with a 16 character GUID using FORMAT with {LENGTH} =16

If neither of these work for you, you can use an actionexecute[myquery] immediately prior to your actual query that be something like select COUNT(ID) as thecount from tableA WHERE xxx

Then next you test if [thecount,myquery] > 0. If yes, then do your actual query from tableA WHERE xxx and get your results.

ListX....makes you look brilliant, even though you're not.
robert_chumley
Please Wait...
Posts:579

07/02/2008 8:58 AM Alert 
You could do this is an Action:assignment. In the assignment you can have a SET tag with a MATH that increments the counter. If this action is a child action of the query, it will get executed on every row returned. In the end you will have a sum of the rows returned and still get the results of your query. you will also not need to execute the query twice.
Thanks,

Robert Chumley
r2integrated (formally bi4ce)
spherop
Welterweight
Posts:34

07/02/2008 2:08 PM Alert 
thanks for the time in responding ...

i opted for th

select COUNT(ID)

approach ..

which was so solid and simple and made go "DOH" ...why didn't I think of that before....

thx
You are not authorized to post a reply.
Forums > Bi4ce.Modules.ListX > General > urgent simple question



ActiveForums 3.6
 
Latest Post
 
At R2integrated (formerly Bi4ce), we take support seriously.  That's why we support our customers and DNN community with daily monitoring from our experienced engineering team.  We ask that the first step taken is to read the relevant documentation and support forums prior to submitting any questions that may already be available or have been answered.  We ask that you review the documentation that we provide for our products before posting a question.

The Forums are for our customers to chat, exchange ideas and strategies, and submit feedback.  Please be sure to perform keyword searches for previous related forum responses.

To be helpful when submitting a new item, please include the following: 
  1. DNN Version
  2. Module Version
  3. Admin Log Viewer Information
  4. Environment detail: Operating system, .NET framework version, database and version, IIS version, Browser version (if appropriate)
We always try to respond quickly and monitor the forums daily during business hours (EST).  Occasionally, requests for a specific project requirement may not apply for the free support offered. For project specific support please submit via our Information Request form.

Thank you for using our Forums.

Click here to register for the Forums
 
© 2008 by R2integrated (formerly Bi4ce) | DNN® is a registered trademark of DotNetNuke Corporation