R2i DotNetNuke® Forum

R2i wants you to have the opportunity to ask questions, post reviews, help others or just rant and rave about DotNetNuke® or any of the R2i Modules and Skins. Our team spends hour upon hour, day after day, working on custom DotNetNuke® modules and services; please feel free to ask us anything.
 
Nest Insert and Select queries under Actions Pane
Last Post 11 Mar 2009 04:48 PM by svedire. 1 Replies.
Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages Informative
NaveedUser is Offline
Basic Member
Basic Member
Posts:102

--
28 Dec 2008 01:03 PM  
Hi,

can some one guide me the best way to nest Insert and select queries, under Actions Pane.

I just want to have a count through select query and use it to insert in table column.

Select count(id) from table1 where condition

insert into table1 (col1,col2,col3) values ((select results here), @val2, @val3)

I didn't get how to do this under Action pane.

thanks
svedireUser is Offline
Basic Member
Basic Member
Posts:128

--
11 Mar 2009 04:48 PM  
Hi,

Try doing it the following way.

Under your actions, do a query action and give it a name, for example: SELQRY. You can do this in one single query instead of two.
SELQRY:
INSERT INTO TABLE1
SELECT COUNT(ID) As Cnt,@Val2,Val3 FROM TABLE1 WHERE Condition

Hope this helps.

Thanks,
Sindura
R2integrated
You are not authorized to post a reply.

Active Forums 4.1
 

New York, NY • Baltimore, MD • Vienna, VA • St. Louis, MO • Seatle, WA • 410.327.0007 • info@R2Integrated.com

Bookmark & Share Bookmark and Share