Click here to Skip to main content
15,886,137 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i have two tables one queue and other outstand ... now when i click button all data of outstand including there column name should be inserted into message column of queue ... please give some idea or code for it
Posted

1 solution

Here's a scratchy algorithm for it. You can refine it further:

1. User clicks button.
2. Fire a query which will create a string of column name and their values (like an XML) from the outstanding table and insert it into Queue. So, if you have something like: Column1 contains 'A', Column2 contains 'B' and Column3 contains 'C' - use the query:

SQL
Insert into Queue (Message)
Select '<column1>' || Column1 || '</column1>' ||
       '<column2>' || Column2 || '</column2>' ||
       '<column3>' || Column3 || '</column3>'
From Outstanding;


The resultant string will be:
SQL
<column1>A</column1>
<column2>B</column2>
<column3>C</column3>


You can create the string in some other form as well like pipe delimited instead of XML. XML will be better suited I guess. It will help you parse the string easily later in case you have to retrieve it.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900