SQLRDD with Harbour

209 views
Skip to first unread message

dagia...@gmail.com

unread,
Aug 26, 2025, 4:11:34 AM (10 days ago) Aug 26
to Harbour Users
Dear Sirs

Good Morning.

How to build sqlrdd from scratch for harbour ?

I have harbour minigui extended Pro. I am not able to run any sample program using sqlrdd. it gives me runtime error. (error.txt attached herewith)

Regards
Yunus.

error.txt

alex;

unread,
Aug 26, 2025, 12:01:31 PM (10 days ago) Aug 26
to Harbour Users
Hi, try https://chat.deepseek.com/

вторник, 26 августа 2025 г. в 11:11:34 UTC+3, dagia...@gmail.com:

alex;

unread,
Aug 26, 2025, 12:02:50 PM (10 days ago) Aug 26
to Harbour Users
and https://groups.google.com/g/minigui-forum

вторник, 26 августа 2025 г. в 11:11:34 UTC+3, dagia...@gmail.com:
Dear Sirs

marcos...@gmail.com

unread,
Aug 26, 2025, 1:23:37 PM (10 days ago) Aug 26
to Harbour Users
Hello,

The error message indicates that the SQL statement is not correct.

***
08/25/25 17:08:54: SQLExecDirect Error
(1064) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'Type=InnoDb' at line 9 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'Type=InnoDb' at line 9
Command sent to database :
CREATE TABLE `payroll` (    `id` REAL (3,0) ,
   `name` CHAR (30) ,
   `sex` CHAR (1) ,
   `title` CHAR (20) ,
   `salary` REAL (6,0) ,
   `department` CHAR (20) ,
   `age` REAL (2,0) ,
   `sr_recno` BIGINT (15) NOT NULL UNIQUE AUTO_INCREMENT
 ) Type=InnoDb
****

The data type REAL(3,0) or REAL(6,0) with specified precision and scale is not valid. In MySQL/MariaDB, REAL is a floating-point numeric type that does not accept precision and scale parameters like DECIMAL(p,s). You should use only REAL, FLOAT, or DOUBLE without parentheses for precision and scale.

AUTO_INCREMENT can only be applied to a column that is a primary key or has a unique index. Here, explicitly declaring the primary key is missing.

In modern MySQL, ENGINE=InnoDB is used instead of TYPE=InnoDB to specify the storage engine.

A corrected and valid version of the statement would be:

CREATE TABLE payroll (
  id REAL,
  name VARCHAR(30),
  sex CHAR(1),
  title VARCHAR(20),
  salary REAL,
  department VARCHAR(20),
  age REAL,
  sr_recno BIGINT NOT NULL UNIQUE AUTO_INCREMENT,
  PRIMARY KEY(sr_recno)
) ENGINE=InnoDB;

https://mariadb.com/docs/server/reference/data-types/numeric-data-types/real
https://mariadb.com/docs/server/reference/data-types/auto_increment
https://mariadb.com/docs/server/reference/data-types/numeric-data-types/bigint

Best regards,

Marcos Jarrin

Francesco Perillo

unread,
Aug 26, 2025, 2:24:39 PM (9 days ago) Aug 26
to harbou...@googlegroups.com
And Id as real sounds really strange actually...

--
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: https://groups.google.com/group/harbour-users
---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/harbour-users/9d65575c-7279-4ccb-a2c9-083e0b04ce5cn%40googlegroups.com.

marcos...@gmail.com

unread,
Aug 26, 2025, 3:06:09 PM (9 days ago) Aug 26
to Harbour Users
The REAL data type in MariaDB is a synonym for DOUBLE

https://mariadb.com/docs/server/reference/data-types/numeric-data-types/real

Example from the official MariaDB documentation

*************************** 1. row ***************************
       Table: real_example
Create Table: CREATE TABLE `real_example` (
  `example` double DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1

Francesco Perillo

unread,
Aug 26, 2025, 3:15:41 PM (9 days ago) Aug 26
to harbou...@googlegroups.com
Sorry, I try to say better:

Usually a field named ID is used as a identifier, a code to uniquely identify an "object" like a client, a supplier, an invoice, whatever. 
Usually an Id used as specified above is an integer (the easy way, auto_increment and unique) or a UID, usually a char[] sequence created with one among different algorithms.

If your field isn't used as above, please disregard this message

Message has been deleted

carloskds

unread,
Aug 28, 2025, 4:37:36 PM (7 days ago) Aug 28
to Harbour Users
CREATE TABLE `payroll` (    `id` REAL (3,0) ,
   `name` CHAR (30) ,
   `sex` CHAR (1) ,
   `title` CHAR (20) ,
   `salary` REAL (6,0) ,
   `department` CHAR (20) ,
   `age` REAL (2,0) ,
   `sr_recno` BIGINT (15) NOT NULL UNIQUE AUTO_INCREMENT
 ) Type=InnoDb <<<<<< ---------------- ACA EL ERROR, deberia ser Engine=InnoDb
en los fuentes de sqlrdd esta Type el cual ya no es soportados por las nuevas versiones del servidor, 
debe modificar el fuente.

sqlrdd2.prg

   //If ::oSql:nSystemID == SYSTEMID_MYSQL
        //cSql += " Type=InnoDb "
   //ENDIF

   IF ::oSql:nSystemID == SYSTEMID_MARIADB
      cSql += " Engine=InnoDb "
   ENDIF

carloskds

unread,
Aug 28, 2025, 4:41:40 PM (7 days ago) Aug 28
to Harbour Users
o por lo menos identificar cuando la versión del servidor es la adecuada y así modificar el fuente...


   IF ::oSql:nSystemID == SYSTEMID_MARIADB
      IF ::oSql:cSystemVers > ...
           cSql += " Engine=InnoDb "
      ELSE
           cSql += " Type=InnoDb "
      ENDIF
   ENDI

dagia...@gmail.com

unread,
Aug 28, 2025, 4:57:48 PM (7 days ago) Aug 28
to Harbour Users
Hello 

I am exploring Payroll sample provided by Grigory Filatov in Hmg Pro (donation ware).

LOCAL aStruct := { ;
      { "ID", "N", 3, 0 }, ;
      { "NAME", "C", 30, 0 }, ;
      { "SEX", "C", 1, 0 }, ;
      { "TITLE", "C", 20, 0 }, ;
      { "SALARY", "N", 6, 0 }, ;
      { "DEPARTMENT", "C", 20, 0 }, ;
      { "AGE", "N", 2, 0 } ;
  
   dbCreate( "payroll", aStruct, "SQLRDD" )

I think the runtime problem is due to bug in SQLRDD libarary provided by him. the library chould be for mysql <5 version. it is not working with mariadb.

any one have correct sqlrdd library please guide me to go through

Thanks & regards
Yunus.
Reply all
Reply to author
Forward
0 new messages