FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour How to get (return) current Query MySql (FWMARIADB)?
Posts: 1598
Joined: Fri Oct 07, 2005 05:56 PM
How to get (return) current Query MySql (FWMARIADB)?
Posted: Thu Jul 12, 2018 05:25 AM

I want to revised current query but still keep current query alike.

oCn:Rowset('select * from customer where id=1')

revised query to
::cQuery += ::cQuery+' or id=2'

How can I do it?

Thanks in advance,

Regards,

Dutch



FWH 2304 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio

FWPPC 10.02 / Harbour for PPC (FTDN)

ADS V.9 / MySql / MariaDB

R&R 12 Infinity / Crystal Report XI R2

(Thailand)
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: How to get (return) current Query MySql (FWMARIADB)?
Posted: Thu Jul 12, 2018 05:01 PM
With all previous versions:

Code (fw): Select all Collapse
cSql := "select * from customer ?"

oRs := oCn:RowSet( cSql, { "where id = 1" } )
// Later
oRs:ReQuery( { "where id = 1 or id = 2" } )


Alternatively, if this suits:
Code (fw): Select all Collapse
cSql := "select * from customer where id between ? and ?"

oRs := oCn:RowSet( cSql, { 1, 1 } )
// Later
oRs := oCn:RowSet( cSql, { 1, 2 } )


With FWH 1805 (under release)
Code (fw): Select all Collapse
cSql := "select * from customer where od = 1"
oRs := oCn:RowSet( cSql )
// later
cSql += " or id = 2"
oRs:Requery( cSql )
Regards



G. N. Rao.

Hyderabad, India
Posts: 1598
Joined: Fri Oct 07, 2005 05:56 PM
Re: How to get (return) current Query MySql (FWMARIADB)?
Posted: Fri Jul 13, 2018 02:24 AM

Dear Mr.Rao,

Thank you, but the query is dynamic. It is not exactly the same in a procedure.
In many scenario, I don't need to requery(). But in some case, I have to revised.
Example.
=========
1. I query reservation (booking) with unique number (id) and I copy to new reservation and requery(). I cannot show all lists after copy.
2. I query reservation (booking) with customer name. It will show well after copy and requery(), because it is the same name.

Thanks once again.

Regards,

Dutch



FWH 2304 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio

FWPPC 10.02 / Harbour for PPC (FTDN)

ADS V.9 / MySql / MariaDB

R&R 12 Infinity / Crystal Report XI R2

(Thailand)
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: How to get (return) current Query MySql (FWMARIADB)?
Posted: Fri Jul 13, 2018 03:10 AM
With FWH 1805, you have the maximum possible flexibility.

Example:
Code (fw): Select all Collapse
oRs := oCn:RowSet( "select * from customer" )
// later
oRs:Requery( "select * from states" )

What more flexibilty you want?
Regards



G. N. Rao.

Hyderabad, India
Posts: 1598
Joined: Fri Oct 07, 2005 05:56 PM
Re: How to get (return) current Query MySql (FWMARIADB)?
Posted: Fri Jul 13, 2018 07:32 AM
Dear Mr.Rao,

It's ok for now. I'm waiting for upgrade to 1805.

nageswaragunupudi wrote:With FWH 1805, you have the maximum possible flexibility.

Example:
Code (fw): Select all Collapse
oRs := oCn:RowSet( "select * from customer" )
// later
oRs:Requery( "select * from states" )

What more flexibilty you want?


Thank you so much for your kindness help.
Regards,

Dutch



FWH 2304 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio

FWPPC 10.02 / Harbour for PPC (FTDN)

ADS V.9 / MySql / MariaDB

R&R 12 Infinity / Crystal Report XI R2

(Thailand)

Continue the discussion