|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Passing result setsI have to create a very generic procedure that can accept 2 data sets. These data sets will typically be: 1) Lines of HTML code saved into a table for frequent use but having variable fields which have to be replaced with data depending on the request made to the database 2) Variable name, variable data records to be used to replace the variables in the first data set e.g. 1) table1 (HTML varchar(8000)) rows: <HTML> <UL> <LI>%%Fld1</LI> <LI>%%Fld2</LI>.... 2) table 2 (VarName varchar(100), VarValue varchar(2000)) rows: VarName VarValue %%Fld1 MyData1 %%Fld2 MyData2 Since it has to be generic and is going to be used by different systems on dirrent server, etc, I would like to pass the entire data sets to my procedure. I would not prefer to use temporary or permanent tables as this would possibly complicate the use of the procedure by multiple users at the same time. I also have to consider performance. I've written the basic parser code for inside the procedure but need advice on how would be the best way of getting the 2 data sets into the procedure. Any advice would be greatly appreciated. Hi
You may want to consider using XML instead of HTML. John Show quote "Chan" wrote: > Hi All > > I have to create a very generic procedure that can accept 2 data sets. > These data sets will typically be: > 1) Lines of HTML code saved into a table for frequent use but having > variable fields which have to be replaced with data depending on the request > made to the database > 2) Variable name, variable data records to be used to replace the variables > in the first data set > > e.g. > 1) table1 (HTML varchar(8000)) > rows: > <HTML> > <UL> > <LI>%%Fld1</LI> > <LI>%%Fld2</LI>.... > > > 2) table 2 (VarName varchar(100), VarValue varchar(2000)) > rows: > VarName VarValue > %%Fld1 MyData1 > %%Fld2 MyData2 > > Since it has to be generic and is going to be used by different systems on > dirrent server, etc, I would like to pass the entire data sets to my > procedure. > I would not prefer to use temporary or permanent tables as this would > possibly complicate the use of the procedure by multiple users at the same > time. > > I also have to consider performance. I've written the basic parser code for > inside the procedure but need advice on how would be the best way of getting > the 2 data sets into the procedure. > > Any advice would be greatly appreciated. > No go, unfortunately. There's a strict architecture in our environment
Show quote "John Bell" wrote: > Hi > > You may want to consider using XML instead of HTML. > > John > > "Chan" wrote: > > > Hi All > > > > I have to create a very generic procedure that can accept 2 data sets. > > These data sets will typically be: > > 1) Lines of HTML code saved into a table for frequent use but having > > variable fields which have to be replaced with data depending on the request > > made to the database > > 2) Variable name, variable data records to be used to replace the variables > > in the first data set > > > > e.g. > > 1) table1 (HTML varchar(8000)) > > rows: > > <HTML> > > <UL> > > <LI>%%Fld1</LI> > > <LI>%%Fld2</LI>.... > > > > > > 2) table 2 (VarName varchar(100), VarValue varchar(2000)) > > rows: > > VarName VarValue > > %%Fld1 MyData1 > > %%Fld2 MyData2 > > > > Since it has to be generic and is going to be used by different systems on > > dirrent server, etc, I would like to pass the entire data sets to my > > procedure. > > I would not prefer to use temporary or permanent tables as this would > > possibly complicate the use of the procedure by multiple users at the same > > time. > > > > I also have to consider performance. I've written the basic parser code for > > inside the procedure but need advice on how would be the best way of getting > > the 2 data sets into the procedure. > > > > Any advice would be greatly appreciated. > > Then you will probably have to resort to string manipulation. This may help
http://www.sommarskog.se/arrays-in-sql.html John Show quote "Chan" wrote: > No go, unfortunately. There's a strict architecture in our environment > > "John Bell" wrote: > > > Hi > > > > You may want to consider using XML instead of HTML. > > > > John > > > > "Chan" wrote: > > > > > Hi All > > > > > > I have to create a very generic procedure that can accept 2 data sets. > > > These data sets will typically be: > > > 1) Lines of HTML code saved into a table for frequent use but having > > > variable fields which have to be replaced with data depending on the request > > > made to the database > > > 2) Variable name, variable data records to be used to replace the variables > > > in the first data set > > > > > > e.g. > > > 1) table1 (HTML varchar(8000)) > > > rows: > > > <HTML> > > > <UL> > > > <LI>%%Fld1</LI> > > > <LI>%%Fld2</LI>.... > > > > > > > > > 2) table 2 (VarName varchar(100), VarValue varchar(2000)) > > > rows: > > > VarName VarValue > > > %%Fld1 MyData1 > > > %%Fld2 MyData2 > > > > > > Since it has to be generic and is going to be used by different systems on > > > dirrent server, etc, I would like to pass the entire data sets to my > > > procedure. > > > I would not prefer to use temporary or permanent tables as this would > > > possibly complicate the use of the procedure by multiple users at the same > > > time. > > > > > > I also have to consider performance. I've written the basic parser code for > > > inside the procedure but need advice on how would be the best way of getting > > > the 2 data sets into the procedure. > > > > > > Any advice would be greatly appreciated. > > > |
|||||||||||||||||||||||