I'm converting some code that uses the Mysql/Mariadb C api from text
queries to prepared statements, and would like my public interfaces to
use struct tm (Unix "broken-down" time) instead of MYSQL_TIME.
Never found much need for DBMS-specific date/time conversion routines.
Those sorts of things belong in the application logic, not in the
database.
In article <ut2e0k$2fd1e$8@dont-email.me>,
Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
Never found much need for DBMS-specific date/time conversion routines. >>Those sorts of things belong in the application logic, not in the
database.
What a totally pointless response.
On Fri, 15 Mar 2024 19:18:51 -0000 (UTC), Lew Pitcher wrote:
I'm converting some code that uses the Mysql/Mariadb C api from text
queries to prepared statements, and would like my public interfaces to
use struct tm (Unix "broken-down" time) instead of MYSQL_TIME.
Never found much need for DBMS-specific date/time conversion routines.
Those sorts of things belong in the application logic, not in the
database.
I assume you've not done my work with or on DBs. A lot of application
logic not to mention triggers are in the database itself in the form of >PL/SQL, t-SQl (or whatever procedural extension of SQL the DB supports) >procedures/functions. A lack of datetime functionality would be a show >stopper in a lot of cases.
In article <ut3rse$2ri7l$1@dont-email.me>, <Muttley@dastardlyhq.com> wrote: >....
I assume you've not done my work with or on DBs. A lot of application
logic not to mention triggers are in the database itself in the form of >>PL/SQL, t-SQl (or whatever procedural extension of SQL the DB supports) >>procedures/functions. A lack of datetime functionality would be a show >>stopper in a lot of cases.
This is A) obvious and B) Off-topic.
Feel free to continue to discuss it - but please observe etiquette and
change the subject line accordingly (as I have done).
At this point, the likelihood that OP will ever get a meaningful/helpful >response is quickly approaching zero. Incidentally, I don't quite see what
In article <ut3rse$2ri7l$1@dont-email.me>, <Muttley@dastardlyhq.com> wrote: ...
I assume you've not done my work with or on DBs. A lot of application
logic not to mention triggers are in the database itself in the form of >>PL/SQL, t-SQl (or whatever procedural extension of SQL the DB supports) >>procedures/functions. A lack of datetime functionality would be a show >>stopper in a lot of cases.
This is A) obvious and B) Off-topic.
Feel free to continue to discuss it - but please observe etiquette and
change the subject line accordingly (as I have done).
At this point, the likelihood that OP will ever get a meaningful/helpful response is quickly approaching zero. Incidentally, I don't quite see what OP's problem is - i.e., it looks like he's already come pretty close to a solution already (by himself).
For my program, it is more convenient (and more conventional) if I express >date/time values as "broken-down time" in struct tm variables. However, the >MYSQL C prepared statement interface requires all DATE and TIME values be >expressed as MYSQL_TIME variables.
On Fri, 15 Mar 2024 21:19:16 -0000 (UTC)
Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
On Fri, 15 Mar 2024 19:18:51 -0000 (UTC), Lew Pitcher wrote:
I'm converting some code that uses the Mysql/Mariadb C api from text
queries to prepared statements, and would like my public interfaces to
use struct tm (Unix "broken-down" time) instead of MYSQL_TIME.
Never found much need for DBMS-specific date/time conversion routines. >>Those sorts of things belong in the application logic, not in the
database.
I assume you've not done my work with or on DBs. A lot of application logic not to mention triggers are in the database itself in the form of PL/SQL, t-SQl
(or whatever procedural extension of SQL the DB supports) procedures/functions.
A lack of datetime functionality would be a show stopper in a lot of cases.
On Sat, 16 Mar 2024 15:43:10 -0000 (UTC)
Lew Pitcher <lew.pitcher@digitalfreehold.ca> wrote:
For my program, it is more convenient (and more conventional) if I express >>date/time values as "broken-down time" in struct tm variables. However, the >>MYSQL C prepared statement interface requires all DATE and TIME values be >>expressed as MYSQL_TIME variables.
All the databases I've worked on have had awkward (from a C/C++ API POV) datetime structures. I imagine the reason is that their date range is way broader than the unix one whether 32 or 64 bit so can't be stored as a simple integer value.
On Sat, 16 Mar 2024 15:43:10 -0000 (UTC)
Lew Pitcher <lew.pitcher@digitalfreehold.ca> wrote:
For my program, it is more convenient (and more conventional) if I express >>date/time values as "broken-down time" in struct tm variables. However, the >>MYSQL C prepared statement interface requires all DATE and TIME values be >>expressed as MYSQL_TIME variables.
All the databases I've worked on have had awkward (from a C/C++ API POV) datetime structures. I imagine the reason is that their date range is way broader than the unix one whether 32 or 64 bit so can't be stored as a simple integer value.
On Sat, 16 Mar 2024 10:22:06 +0000, Muttley wrote:
On Fri, 15 Mar 2024 21:19:16 -0000 (UTC)
Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
Never found much need for DBMS-specific date/time conversion routines. >>>Those sorts of things belong in the application logic, not in the >>>database.
And, that's where I'm trying to put them. /BUT/, the database /stores/ date/time values that the application logic must manipulate, and it is
/the interface/ between database and application that I'm concerned
about.
Apparently, the MYSQL date range is alot /narrower/ than the Unix
(64bit) time_t timestamp and struct tm ones.
On Sat, 16 Mar 2024 15:43:10 -0000 (UTC), Lew Pitcher wrote:
On Sat, 16 Mar 2024 10:22:06 +0000, Muttley wrote:
On Fri, 15 Mar 2024 21:19:16 -0000 (UTC)
Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
Never found much need for DBMS-specific date/time conversion routines. >>>>Those sorts of things belong in the application logic, not in the >>>>database.
And, that's where I'm trying to put them. /BUT/, the database /stores/
date/time values that the application logic must manipulate, and it is
/the interface/ between database and application that I'm concerned
about.
If you are trying to convert your database schema to get rid of date/time >types, I would recommend using a higher-level language than C for this
Hi, Guys
I'm converting some code that uses the Mysql/Mariadb C api from
text queries to prepared statements, and would like my public
interfaces to use struct tm (Unix "broken-down" time) instead of
MYSQL_TIME.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 307 |
Nodes: | 16 (2 / 14) |
Uptime: | 75:30:49 |
Calls: | 6,915 |
Files: | 12,382 |
Messages: | 5,432,543 |