MYSQL CREATE VIEW
MYSQL CREATE VIEW
Is it possible to execute create sql view through Fivewin and use the same?
Regards,
Milos
Regards,
Milos
Best regards
Milos
[ FWH 21.11 ] [ xHarbour 1.2.3 Intl. (SimpLex) (Build 20150603) ]
Milos
[ FWH 21.11 ] [ xHarbour 1.2.3 Intl. (SimpLex) (Build 20150603) ]
- joseluisysturiz
- Posts: 2064
- Joined: Fri Jan 06, 2006 9:28 pm
- Location: Guatire - Caracas - Venezuela
- Contact:
- nageswaragunupudi
- Posts: 10721
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 8 times
- Contact:
Re: MYSQL CREATE VIEW
mtajkov wrote:Is it possible to execute create sql view through Fivewin and use the same?
Regards,
Milos
Using ADO
Code: Select all | Expand
CsQL := "CREATE VIEW CUSTATE AS SELECT C.ID, C.CITY, S.NAME FROM CUSTOMER C LEFT OUTER JOIN STATES S ON C.STATE = S.CODE"
oCn:Execute( cSql )
oRs := FW_OpenRecordSet( oCn, "SELECT * FROM CUSTATE" )
xbrowser oRs
This worked perfectly with mysql on my pc.
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
Re: MYSQL CREATE VIEW
Thank you for your reply, it works.
Regards,
Milos
Regards,
Milos
Best regards
Milos
[ FWH 21.11 ] [ xHarbour 1.2.3 Intl. (SimpLex) (Build 20150603) ]
Milos
[ FWH 21.11 ] [ xHarbour 1.2.3 Intl. (SimpLex) (Build 20150603) ]
Re: MYSQL CREATE VIEW
I tried to open the view as:
USE CUSTATE VIA "SQLRDD" NEW
but does not work?
Regards,
Milos
USE CUSTATE VIA "SQLRDD" NEW
but does not work?
Regards,
Milos
Best regards
Milos
[ FWH 21.11 ] [ xHarbour 1.2.3 Intl. (SimpLex) (Build 20150603) ]
Milos
[ FWH 21.11 ] [ xHarbour 1.2.3 Intl. (SimpLex) (Build 20150603) ]
- nageswaragunupudi
- Posts: 10721
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 8 times
- Contact:
Re: MYSQL CREATE VIEW
No comments on RDDs
It appears the authors make the RDDs only for individual tables and do not allow to use the full power of sql.
It appears the authors make the RDDs only for individual tables and do not allow to use the full power of sql.
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
Re: MYSQL CREATE VIEW
thank you
Best regards
Milos
[ FWH 21.11 ] [ xHarbour 1.2.3 Intl. (SimpLex) (Build 20150603) ]
Milos
[ FWH 21.11 ] [ xHarbour 1.2.3 Intl. (SimpLex) (Build 20150603) ]
Re: MYSQL CREATE VIEW
nageswaragunupudi wrote:No comments on RDDs
It appears the authors make the RDDs only for individual tables and do not allow to use the full power of sql.
In adordd you can do it like this:
Code: Select all | Expand
cSql := "CREATE VIEW CONTACTS AS SELECT TABLE1.FIRST, TABLE1.LAST,"+;
"TABLE1.AGE, TABLE2.ADDRESS, TABLE2.EMAIL "+;
"FROM TABLE1 LEFT OUTER JOIN TABLE2 ON TABLE1.CODID = TABLE2.CODID"
GETADOCONN():EXECUTE(cSql)
SELE 0
USE CONTACTS
BROWSE()
You can do it also in traditional dbf way:
Code: Select all | Expand
SELE 0
USE table1 ALIAS "TEST1"
SELE 0
USE table2 ALIAS "TEST2"
GO TOP
SELE TEST1
SET RELATION TO CODID INTO TEST2
BROWSE( FIELDS OF EACH AREA)
Regards
Antonio H Ferreira
Antonio H Ferreira
- nageswaragunupudi
- Posts: 10721
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 8 times
- Contact:
Re: MYSQL CREATE VIEW
Mr Antonio
Thanks for the info. You have done a great work.
I shall download and try the new ADORDD as soon as possible.
Thanks for the info. You have done a great work.
I shall download and try the new ADORDD as soon as possible.
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
Re: MYSQL CREATE VIEW
Mr Rao,
I'm looking forward to your comments and ideas.
By the way what do you use as locking scheme in ado? Do you simply trust :locktype?
I'm looking forward to your comments and ideas.
By the way what do you use as locking scheme in ado? Do you simply trust :locktype?
Regards
Antonio H Ferreira
Antonio H Ferreira
- nageswaragunupudi
- Posts: 10721
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 8 times
- Contact:
Re: MYSQL CREATE VIEW
What I do is not probably relevant. Optimistic locking or batch optimistic locking or detached recordsets, depending on the situations, but never lock and wait for user-input.
Even ADS by default uses optimistic locking. Option of Pessimistic locking is provided to accommodate legacy applications.
When you are writing RDD, you need to provide for locking. The question is how to do it.
Whatever locking we request while opening recordset, the provider finally decides what locking is to be provided, which we know by querying the :LockType after opening. To my knowledge, adLockPessimistic is available only for serverside recordsets. Normally used for single records. There is no call for locking, but the moment any field is modified the lock is applied till execution of Update or moving the record.
So probably in our implementation, when reclock() is called, we can lock the record by assigning the same value to an updatable field. ( eg. oRs:Fields( n ):Value := oRs:Fields( n ):Value assuming this field can be updated)
Call to oRs:Update() also unlocks.
Even ADS by default uses optimistic locking. Option of Pessimistic locking is provided to accommodate legacy applications.
When you are writing RDD, you need to provide for locking. The question is how to do it.
Whatever locking we request while opening recordset, the provider finally decides what locking is to be provided, which we know by querying the :LockType after opening. To my knowledge, adLockPessimistic is available only for serverside recordsets. Normally used for single records. There is no call for locking, but the moment any field is modified the lock is applied till execution of Update or moving the record.
So probably in our implementation, when reclock() is called, we can lock the record by assigning the same value to an updatable field. ( eg. oRs:Fields( n ):Value := oRs:Fields( n ):Value assuming this field can be updated)
Call to oRs:Update() also unlocks.
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
Re: MYSQL CREATE VIEW
Im going to try it.
Thanks for the great and simple idea.
Now Im having a strange problem.
When comparing two dates :
if (ownd:numera)->dataultmov > dDataM
msginfo("Data do ult doc "+dtoc((ownd:numera)->dataultmov)+CRLF+;
"Data deste doc "+dtoc(dDataM) )
endif
They show the same date 28.04.15. What might be the reason?
Thanks for the great and simple idea.
Now Im having a strange problem.
When comparing two dates :
if (ownd:numera)->dataultmov > dDataM
msginfo("Data do ult doc "+dtoc((ownd:numera)->dataultmov)+CRLF+;
"Data deste doc "+dtoc(dDataM) )
endif
They show the same date 28.04.15. What might be the reason?
Regards
Antonio H Ferreira
Antonio H Ferreira
- nageswaragunupudi
- Posts: 10721
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 8 times
- Contact:
Re: MYSQL CREATE VIEW
I did not understand your question. Can you please explain more clearly?
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
Re: MYSQL CREATE VIEW
[quote="nageswaragunupudi"
Normally used for single records. There is no call for locking, but the moment any field is modified the lock is applied till execution of Update or moving the record.
So probably in our implementation, when reclock() is called, we can lock the record by assigning the same value to an updatable field. ( eg. oRs:Fields( n ):Value := oRs:Fields( n ):Value assuming this field can be updated)
Call to oRs:Update() also unlocks.[/quote]
I´ve tested it and it works perfectly with adUseclient and adUserServer cursors.
So we never call :Update() in ADO_PUTVALUE and ADO_APPEND and the :Update is then called only ADO_UNLOCK. Right?
The app Im converting gets all the new records an locks and then goes through the Locklist array of each table processing each replace.
Since we move the record we lost the physical lock right?
Starting a transaction can eliminate this ?
Normally used for single records. There is no call for locking, but the moment any field is modified the lock is applied till execution of Update or moving the record.
So probably in our implementation, when reclock() is called, we can lock the record by assigning the same value to an updatable field. ( eg. oRs:Fields( n ):Value := oRs:Fields( n ):Value assuming this field can be updated)
Call to oRs:Update() also unlocks.[/quote]
I´ve tested it and it works perfectly with adUseclient and adUserServer cursors.
So we never call :Update() in ADO_PUTVALUE and ADO_APPEND and the :Update is then called only ADO_UNLOCK. Right?
The app Im converting gets all the new records an locks and then goes through the Locklist array of each table processing each replace.
Since we move the record we lost the physical lock right?
Starting a transaction can eliminate this ?
Regards
Antonio H Ferreira
Antonio H Ferreira
Re: MYSQL CREATE VIEW
nageswaragunupudi wrote:I did not understand your question. Can you please explain more clearly?
(ownd:numera)->dataultmov is 28/04/15
dDataM is 28/04/15
if (ownd:numera)->dataultmov > dDataM
msginfo("Data do ult doc "+dtoc((ownd:numera)->dataultmov)+CRLF+;
"Data deste doc "+dtoc(dDataM) )
endif
The code inside the IF should never be executed but it is and the msginfo shows both with the same date 28.04.15.
What might be the reason?
Regards
Antonio H Ferreira
Antonio H Ferreira