List:MySQL++« Previous MessageNext Message »
From:Tom Riggs Date:May 17 2004 3:19am
Subject:RE: populating the result object - 2
View as plain text  
Have you considered writing a routine to bring the data from you xml file
into a table in your database and then query it? The only other way I see
would not be so simple it would involve researching the MYSQL code to
determine how to "insert" the values into the result object. However it just
occurred to me that one of the examples uses a vector object to receive the
query result. Perhaps you could look at that as a way to implement what you
are trying to accomplish. 

-----Original Message-----
From: Vinay Sambamurthy [mailto:vsmurthy@stripped] 
Sent: Sunday, May 16, 2004 5:06 PM
To: Tom Riggs
Cc: plusplus@stripped
Subject: RE: populating the result object - 2

Hi,
   The class which I am constructing inherits a base class where
everything is in sql form and it has a pure virtual function which
returns a mysql++ Result object. This function needs to be
overridden in my class. The reason behind the base class returning a
Result object is so that all it's derived classes irrespective of which
database it is...can be stored in this mySql++ Result object format from
which i can extract data in a similar way (which means that the main
reason for the Result object is so that I can retrieve data from it using
mySql++ commands like row[i] which would return the ith row in the
Result object). Also, the other database I am
talking abt uses Sql statements for insert, delete, etc internally...but
it exposes different methods such as List, Add etc (which are self
explanatory) through it's WSDL (it's a webservice to which I am
communicating through my C++ class)


Regards,
Vinay

On Sun, 16 May 2004, Tom Riggs wrote:

> I have watched this thread and I do not understand why you would want to
> populate a result object in this way. I am still new to this also but as I
> understand it the purpose of the result object is to then pull the
> information from the query out and perform operations on it like printing
or
> display or modify. You have data in another format are you trying to
insert
> the data into the MYSql database? If so then you can write code to create
> the appropriate insert query from the data you have. What is it that you
> want to do with this data that makes you believe that it should be in a
> result object?
>
> -----Original Message-----
> From: Vinay Sambamurthy [mailto:vsmurthy@stripped]
> Sent: Friday, May 14, 2004 2:18 PM
> To: plusplus@stripped
> Subject: populating the result object - 2
>
> Hi,
>       I have an XML document which i retrieved from some database using
> commands specific to that database. The Xml document contains "field"
> elements of this type
>
>  Ex: <field name="id" type="integer">10</field>
>      <field name="currenttime" type="time">20:10:30</field>
>      <field name="createdBy" type="string">bob</field>
>       and so on....
>
> Now I need to construct a mySQL++ Result object out of it..i.e, i need to
> populate a Result object. But the mySQL++ examples I saw on the internet,
> first construct a query (say for example for retrieving some values) and
> then
> execute
>  Result res = query.store();
>
> But in my case, I have already executed the query using some command that
> the database supports(not mySQL++) and I get a string containing the XML
> document(described above)  as the result of that query. Now is there some
> <way, that I can just populate a Result object with these values? By
> explicity executing some commands like say(for example), res.insertElement
> or something like that, can I populate the Result object?
>
> Thanks
> Vinay
>
>
> --
> MySQL++ Mailing List
> For list archives: http://lists.mysql.com/plusplus
> To unsubscribe:    http://lists.mysql.com/plusplus?unsub=1
>
Thread
populating the result object - 2Vinay  Murthy15 May
RE: populating the result object - 2Tom Riggs16 May
  • RE: populating the result object - 2Vinay Sambamurthy16 May
RE: populating the result object - 2Tom Riggs17 May
  • RE: populating the result object - 2Vinay Sambamurthy18 May
    • Re: populating the result object - 2Sinisa Milivojevic18 May