How to get (return) current Query MySql (FWMARIADB)?

How to get (return) current Query MySql (FWMARIADB)?

Postby dutch » Thu Jul 12, 2018 5: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 19.01 / 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)
User avatar
dutch
 
Posts: 1535
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Re: How to get (return) current Query MySql (FWMARIADB)?

Postby nageswaragunupudi » Thu Jul 12, 2018 5:01 pm

With all previous versions:

Code: Select all  Expand view
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: Select all  Expand view
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: Select all  Expand view
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
User avatar
nageswaragunupudi
 
Posts: 10468
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: How to get (return) current Query MySql (FWMARIADB)?

Postby dutch » Fri Jul 13, 2018 2: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 19.01 / 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)
User avatar
dutch
 
Posts: 1535
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Re: How to get (return) current Query MySql (FWMARIADB)?

Postby nageswaragunupudi » Fri Jul 13, 2018 3:10 am

With FWH 1805, you have the maximum possible flexibility.

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

What more flexibilty you want?
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10468
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: How to get (return) current Query MySql (FWMARIADB)?

Postby dutch » Fri Jul 13, 2018 7: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: Select all  Expand view
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 19.01 / 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)
User avatar
dutch
 
Posts: 1535
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 74 guests