FWH 16.08 : Built-in MySql/MariaDB functionality (Updated )

Re: FWH 16.08 : Built-in MySql/MariaDB functionality (Updated )

Postby cnavarro » Fri Dec 09, 2016 9:03 pm

vinhesoft wrote:Mr.Rao

What is the method for deleting a database?

OCn: DeleteDB (cDB)
OCn: DropDB (cDB)
OCn: Delete (cDB)
OCn: Drop (cDB)

I just managed this way:

OCn: QueryResult ('drop databases' + cDB)

Is there any method for this?

Att

João Carlos
VinheSoft


Try with

oCn:DropTable( cTable )
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6548
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: FWH 16.08 : Built-in MySql/MariaDB functionality (Updated )

Postby nageswaragunupudi » Sat Dec 10, 2016 12:44 am

Mr João Carlos

We have not created a method for it because it is not required for regular usage.
Please use:
Code: Select all  Expand view

oCn:Execute( "DROP DATEBASE IF EXISTS " + cDb )
if oCn:nError == 0
  // success
endif
 
Regards

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

Re: FWH 16.08 : Built-in MySql/MariaDB functionality (Updated )

Postby nageswaragunupudi » Sat Dec 10, 2016 12:55 am

dutch wrote:METHOD Cancel() --> Cancels the pending updates/append

How do I know that data pending for updates (rowset has changed)?

Thanks for any help.


if Empty( oRs:ModiCols )
// not modified
else
// modified
endif
Regards

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

Re: FWH 16.08 : Built-in MySql/MariaDB functionality (Updated )

Postby vinhesoft » Sat Dec 10, 2016 9:25 am

Thanks,

Mr.Rao and Cnavarro

Att

Joao Carlos
VinheSoft
João Carlos
VinheSoft Informatica
BCC 7.7 - FHW 24.07 - Harbour 3.2.0dev (r2404101339) for BCC 7.7
vinhesoft
 
Posts: 36
Joined: Sat Sep 03, 2016 3:11 pm
Location: Campinas/SP-Brasil

Re: FWH 16.08 : Built-in MySql/MariaDB functionality (Updated )

Postby nageswaragunupudi » Sun Dec 11, 2016 10:25 pm

New in 16.11:
=========

METHOD Explain( cSql, [aParams], [lShow = .t.] ) --> lValidSQL

Can be used only with SELECT, INSERT and UPDATE Sql statements only. By default (lShow := .t.), the method displays the execution plan of the sql statement in a browse. Knowledgeable programmers can use this information for optimizing the queries.

http://stackoverflow.com/questions/1014 ... plain-plan
https://www.sitepoint.com/using-explain ... l-queries/

Return Value: Whether the SQL statement is valid or not.

Param-2: aParams. If provided, the value are applied to cSql
Param-3: lShow. Default .T., Specifying .F. can be used for quickly testing validity of sql without executing it.
Regards

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

Re: FWH 16.08 : Built-in MySql/MariaDB functionality (Updated )

Postby nageswaragunupudi » Sun Dec 11, 2016 10:38 pm

New in 16.12 (Upcoming)
================

1) Server variables can be accessed as DATAs of the connection object.
Examples:
Code: Select all  Expand view
? oCn:max_allowed_packet
 


2) Built-in MySql functions can be used like methods of connection object, using Harbour variables as parameters
Examples:
Code: Select all  Expand view
 ? oCn:DATEDIFF( Date(), dOldDate )
  ? oCn:UTC_TIMESTAMP()
 


3) Full table rowsets can be opened as DATAs of the connection object.
Examples:
Code: Select all  Expand view
 oRs := oCn:customer
  XBROWSER oRs
  XBROWSER oCn:states FASTEDIT
 


4) New METHOD HideServer()
Normally we can find the names of the server and user by oCn:cServer and oCn:cUser.
Password can never be accessed.
Now, if oCn:HideServer() is executed, even the server-name and user-name can not be accessed from the application program.

5) New DATAs IsMySql and IsMariaDB
Whether the connected server is MySql server or MariaDB server.

6) New DATA nVersion: Server version in Numeric value
Eg Usage:
Code: Select all  Expand view

  If oCn:IsMariaDB or oCn:nVersion >= 5.63
     // do something
  endif
 
Regards

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

Re: FWH 16.08 : Built-in MySql/MariaDB functionality (Updated )

Postby nageswaragunupudi » Sun Dec 11, 2016 11:29 pm

Also New in 16.12 (Upcoming):

Automatic Recovery from Lost Connections:

During execution of a program, connection to the server can be lost either due to connection timeout or due to physical loss of connection like failure or internet or physical connection.

Even after disconnection, the program can continue to browse / view the tables already opened including sorting and filtering, but any attempts to write data, requery, etc will fail.

TimeOut:
It is customary to set time out to 28,800 seconds (8 hours) in many cases. In some cases it is possible that the timeout is set to a very short period.

When any sql is executed for access or writing data, if disconnection is encountered, automatically reconnection is attempted. In case of connections lost due to time out, the recovery is 100% successful. In case of physical loss of connections, the program can continue without accessing data from the server and when the physical connectivity is restored any attempt to read/write data will automatically reconnect to the server and proceed with the execution of the program.
Regards

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

Re: FWH 16.08 : Built-in MySql/MariaDB functionality (Updated )

Postby vilian » Mon Dec 12, 2016 12:46 am

Very Good!!!
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
vilian
 
Posts: 977
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil

Re: FWH 16.08 : Built-in MySql/MariaDB functionality (Updated )

Postby vinhesoft » Wed Jan 04, 2017 10:11 am

Mr Rao

The method: len is not returning the correct field size

see below

{ {'CODGRU', 'N', 3,0}, {'NOMGRU', 'C', 30,0}, {'VALUE', 'N', 12,2} }

oRs: = oCn: Query ('select * from grupo')

oRs: Fields (1): len -> field size 'CODGRU' returns 3 -> Ok
oRs: Fields (2): len -> field size 'NOMGRU' returns 30 -> Ok
oRs: Fields (3): len -> field size 'VALUE' returns 14 -> here you should retune 12

I'm using version 16.12
João Carlos
VinheSoft Informatica
BCC 7.7 - FHW 24.07 - Harbour 3.2.0dev (r2404101339) for BCC 7.7
vinhesoft
 
Posts: 36
Joined: Sat Sep 03, 2016 3:11 pm
Location: Campinas/SP-Brasil

Re: FWH 16.08 : Built-in MySql/MariaDB functionality (Updated )

Postby nageswaragunupudi » Wed Jan 04, 2017 11:43 am

I sent reply to your email on Jan 1st. It appears you did not receive it.

This is the gist of the reply

"This is what is reported by MySql's library "libmysql".
If we create a column as "decimal( n, d )", libmysql reports the length as n+2. Please note it is not n + d.
So, if a column is created as "decimal(10,2)", then libmysql reports the length as 12. ( adds 2 bytes for decimal and -ve sign).
For this reason, even TMySql and TDolphin also report the length as 12 not 10.
Till now, FWMYSQL also is reporting 12 for the same reason. I did not think much about it till I got your email

We shall consider modifying FWHMYSQL library to display the length compatible with our Harbour system. I may make this change in the next version.
Please note, MySql's "decimal(10,2)" is equivalent to Harbour " N, 11, 2 "
Regards

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

Re: FWH 16.08 : Built-in MySql/MariaDB functionality (Updated )

Postby vinhesoft » Wed Jan 04, 2017 11:59 am

Mr. Rao

Thanks

Joao Carlos
VinheSoft
João Carlos
VinheSoft Informatica
BCC 7.7 - FHW 24.07 - Harbour 3.2.0dev (r2404101339) for BCC 7.7
vinhesoft
 
Posts: 36
Joined: Sat Sep 03, 2016 3:11 pm
Location: Campinas/SP-Brasil

Re: FWH 16.08 : Built-in MySql/MariaDB functionality (Updated )

Postby wmanesco » Mon Mar 13, 2017 2:46 pm

Hi,

Is the source code available in any location?

Thanks
wmanesco
 
Posts: 29
Joined: Wed Sep 14, 2016 3:49 pm

Re: FWH 16.08 : Built-in MySql/MariaDB functionality (Updated )

Postby nageswaragunupudi » Mon Mar 13, 2017 2:51 pm

wmanesco wrote:Hi,

Is the source code available in any location?

Thanks

Not available please.
Regards

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

Re: FWH 16.08 : Built-in MySql/MariaDB functionality (Updated )

Postby nageswaragunupudi » Mon Mar 20, 2017 5:52 pm

For MSVC32 Users


If the MSVC32 application is linked with mysqlclient.lib instead of with libmysql32.lib, the exe works independently and does not require libmysql.dll. You can distribute the exe only without any dlls.
Regards

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

Re: FWH 16.08 : Built-in MySql/MariaDB functionality (Updated )

Postby Maurizio » Thu Mar 23, 2017 5:37 pm

Mr. Rao ,

I have to copy a recordset into a DBF (with the same structure) , which the best way ?
(I can't use :SaveToDBF)

oRs := oCn:RowSet(cString)
do while ! oRs:eof()
select(cAl)
dbappend()

-->>> copy oRs in DBF

oRs:skip()
enddo

Regards Maurizio
http://www.nipeservice.com
User avatar
Maurizio
 
Posts: 824
Joined: Mon Oct 10, 2005 1:29 pm

PreviousNext

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 82 guests