|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Stored Procedure Question
Hi all. I am currently trying to create (IMO) a pretty advanced stored procedure.
The table I start to fetch looks like this (reduced) Page - Type - Sql simple DropDown select id, text from .... simple Text (NULL) so I start to call the SP with the page name 'simple' and when everything is fetched I want too loop the resultset and replace every SQL that is not NULL with a string separated by commas (, or # or whatever =)). The string should be fetched using the SQL in the SQL to be replaced. So in pseudocode what I want to do is stored procedure getPageLayout(string aPage) { select * from dynamicTable where page = aPage; for each row { if (sql != NULL) { set this.sql = call executeSQL(sql) } } return reslutSet; } Is this possible? |
|
#2
|
|||
|
|||
|
I can add that my procedure currently looks like this
create procedure getDynTable(aPage char(15)) result(lPage CHAR(15), lType char(20), lSQL VARCHAR(255)) begin select page as lPage, type as lType, sql as lSql, from dyntable where page = aPage end; But does anyone have any ideas of how to loop the resultset and replace the SQL-tags != NULL with that querys result? |
|
#3
|
||||
|
||||
|
|
|
#4
|
|||
|
|||
|
Great thanks, will try that out tomorrow.
|
![]() |
| Viewing: ASP Free Forums > Database > SQL Development > Stored Procedure Question |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|