SreeramojuPradeep
asked on
Generate xml from sqlite database table for air application
Hi,
Can u let me know is it possible to generate xml based on our requirement from sqlite database table for air application and how????
Thanks & Regards
Can u let me know is it possible to generate xml based on our requirement from sqlite database table for air application and how????
Thanks & Regards
ASKER
But that is through command prompt...
how about sqlite...??
Select * from Scheduler for xml auto
The query is not running in sqlite browser....
how about sqlite...??
Select * from Scheduler for xml auto
The query is not running in sqlite browser....
It will be close to MySQL syntax
For this table structure
"INSERT INTO test_table (first_name, last_name) VALUES('FIRST', 'LAST')";
SQL statment is:
var sqls:SQLStatement = new SQLStatement();
sqls.addEventListener(SQLE vent.RESUL T, result);
sqls.text = "SELECT GROUP_CONCAT('<first>' || first_name || '</first><last>' || last_name || '</last>', '\n') AS xml FROM test_table";
sqls.execute();
Function handler is:
private function result(e:SQLEvent):void
{
var data:Array = sqls.getResult().data;
if(data != null && data.length == 1)
trace(data[0].xml);
}
For this table structure
"INSERT INTO test_table (first_name, last_name) VALUES('FIRST', 'LAST')";
SQL statment is:
var sqls:SQLStatement = new SQLStatement();
sqls.addEventListener(SQLE
sqls.text = "SELECT GROUP_CONCAT('<first>' || first_name || '</first><last>' || last_name || '</last>', '\n') AS xml FROM test_table";
sqls.execute();
Function handler is:
private function result(e:SQLEvent):void
{
var data:Array = sqls.getResult().data;
if(data != null && data.length == 1)
trace(data[0].xml);
}
ASKER
I tried running the same query in sqlite browser but its not working.....i.e its going into Not Responding stage...
can u pls let me know what changes i have to do......
can u pls let me know what changes i have to do......
ASKER
Hi dgofman,
Its working fine....since i was directly checking this from sqlite browser...it was reaching into not responding state....Thanks for that....
If suppose a table has following fields...
EmpName
EmpPhone
EmpEmail...
I will generate xml for this table...
But i would like to populate the same in dropdown menu...
A drop down menu will consist of All EmpName..
Once the user select a particular EmpName it should dropdown side menu showing EmpPhone of that employee and once he selects EmpPhone the side menu should display EmpMail if it exists only...
Its working fine....since i was directly checking this from sqlite browser...it was reaching into not responding state....Thanks for that....
If suppose a table has following fields...
EmpName
EmpPhone
EmpEmail...
I will generate xml for this table...
But i would like to populate the same in dropdown menu...
A drop down menu will consist of All EmpName..
Once the user select a particular EmpName it should dropdown side menu showing EmpPhone of that employee and once he selects EmpPhone the side menu should display EmpMail if it exists only...
ASKER
can u let me know how to use distinct for the above query......
Create Bindable variable
[Bindable]
private var xmlList:XMLList;
Modify my result function
if(data != null && data.length == 1){
xmlList = new XMLList(data[0].xml);
}
and create a ComboBox
<mx:ComboBox labelField="EmpName" dataProvider="{xmlList}"/>
[Bindable]
private var xmlList:XMLList;
Modify my result function
if(data != null && data.length == 1){
xmlList = new XMLList(data[0].xml);
}
and create a ComboBox
<mx:ComboBox labelField="EmpName" dataProvider="{xmlList}"/>
ASKER
Hi,
But my requirement is liittle diff...
I have created a test table....
I have some dummy records....
The data is retrived from as xml....
The same data is populated to menu dropdown....
i.e on click of a button the menu drop down with
xyz initially
on mouse over side menu opens up and displays
Crime
Civil
i.e in the below fashion
Implementing this way can be done.....
But my requirement is liittle diff...
I have created a test table....
Create table ClientDetails(ClientName Text, ComplaintType Text);
I have some dummy records....
The data is retrived from as xml....
The same data is populated to menu dropdown....
i.e on click of a button the menu drop down with
xyz initially
on mouse over side menu opens up and displays
Crime
Civil
i.e in the below fashion
xyz----->Crime
Civil
abc------->Dowry
pqr-------->complain
Implementing this way can be done.....
Past me XML what you are expecting will be easier for me to understand
ASKER
?xml version="1.0" standalone="yes" ?>
<DATAPACKET Version="2.0">
<ROWDATA>
<ROW CLIENT_ID="1" CASE_TYPE="test" CLIENT_NAME="test"/>
<ROW CLIENT_ID="2" CASE_TYPE="crime"CLIENT_NAME="test"/>
<ROW CLIENT_ID="3" CASE_TYPE="murder" CLIENT_NAME="Manu"/>
<ROW CLIENT_ID="4" CASE_TYPE="RealEstate" CLIENT_NAME="Pradeep" />
<ROW CLIENT_ID="5" CASE_TYPE="Criminal" CLIENT_NAME="Pradeep"/>
</ROWDATA>
</DATAPACKET>
1. i would like to select all distinct client names display in menu dropdown..once user mouse over on
client name a side menu opens which display all case type wrt that client name....
ASKER
The concept is to display distinct client names with
case types available wrt to that client...........
case types available wrt to that client...........
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Once i get the table data in xml format....
i would like to give this data has dataprovider to dropdown menu..
which initially displays
Main menu SideMenu
-------------------------- ---------- ---------- ---------- ---------- ---------- -------
Distinct client names only......
CLIENT_NAME1-------------C ASE_TYPE related to CLIENT_NAME1
CLIENT_NAME2-------------- CASE_TYPE related to CLIENT_NAME2
Can u let me know how to get the output in the above format......which is simple has drop down menu....pls this requirement is badly in need.....
i would like to give this data has dataprovider to dropdown menu..
which initially displays
Main menu SideMenu
--------------------------
Distinct client names only......
CLIENT_NAME1-------------C
CLIENT_NAME2--------------
Can u let me know how to get the output in the above format......which is simple has drop down menu....pls this requirement is badly in need.....
ASKER
Is there any other way using which i can get the output in the above way......
You have to open a new question how to retrive XML data in drop down menus
I answered on your question sqllite to XML
I answered on your question sqllite to XML
ASKER
I have opened a new question....can u pls provide me the solution ASAP.....
https://www.experts-exchange.com/questions/26891644/AS3-and-database-SQL-vs-MYSQL.html?sfQueryTermInfo=1+10+30+dgofman+php+sql