MYSQL

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • CHAR(a,t) AND LIMIT functions

    1 answers - 1256 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    MaxDB 7.6.00.34 (linux 32)
    SQLStudio 7.6.00.27
    Good afternoon List,
    When querying my database I get unexpected results in using the CHAR and
    LIMIT functions.
    About the CHAR(a,t) function. The help explains "CHAR(a,t) is a function
    (conversion function
    <>) that converts the
    date values <>, time
    values <>, or
    timestamp values <
    to a character string".
    SELECT CHAR(MYTIMESTAMPENTRY) AS STRDATE FRM MYTABLE works fine.
    SELECT CHAR(MYTIMESTAMPENTRY,'YYYY-MM-DD') AS STRDATE FRM MYTABLE
    doesn't work. I get the following error message : Syntax error or access
    violation;-5015 PS(31) Missing keyword
    About the limit function. I've read a post about that but there was no
    answer. According to the documentation I could use the limit function
    that way : LIMIT nbrows offset.
    SELECT * FRM MYTABLE RDER BY NAME LIMIT 100 works fine. It sends the
    100 first names contained by MYTABLE in alphabetical order.
    SELECT * FRM MYTABLE RDER BY NAME LIMIT 100 10 sends the 110 first
    names contained by MYTABLE in alphabetical order instead of sending 100
    names from the 10th.
    Any idea about those problems ?
    Kind regards
    Xavier.
  • No.1 | | 2129 bytes | |

    Hello Xavier

    Wed, 31 Jan 2007 18:17:10 +0100, Xavier CAMIER
    <xavier.camier (AT) batinor (DOT) frwrote:

    MaxDB 7.6.00.34 (linux 32)
    SQLStudio 7.6.00.27

    Good afternoon List,

    When querying my database I get unexpected results in using the CHAR and
    LIMIT functions.

    About the CHAR(a,t) function. The help explains "CHAR(a,t) is a function
    (conversion function
    <>) that converts the
    date values <>, time
    values <>, or
    timestamp values <
    to a character string".

    CHAR(a,t)
    is a function (conversion function) that converts the date values, time
    values, or timestamp values to a character string (expression a) with the
    format for date values, time values, or timestamp values specified in t.

    t (second parameter) is:
    <datetimeformat::= EUR | INTERNAL | IS | JIS | USA

    SELECT CHAR(MYTIMESTAMPENTRY) AS STRDATE FRM MYTABLE works fine.
    SELECT CHAR(MYTIMESTAMPENTRY,'YYYY-MM-DD') AS STRDATE FRM MYTABLE
    doesn't work. I get the following error message : Syntax error or access
    violation;-5015 PS(31) Missing keyword

    Try :
    SELECT CHAR (DATE (MYTIMESTAMPENTRY)) AS STRDATE FRM MYTABLE
    R
    SELECT CHAR (DATE (MYTIMESTAMPENTRY), IS) AS STRDATE FRM MYTABLE
    R
    SELECT CHAR (DATE (MYTIMESTAMPENTRY), EUR) AS STRDATE FRM MYTABLE
    if you want only date fraction.

    About the limit function. I've read a post about that but there was no
    answer. According to the documentation I could use the limit function
    that way : LIMIT nbrows offset.

    SELECT * FRM MYTABLE RDER BY NAME LIMIT 100 works fine. It sends the
    100 first names contained by MYTABLE in alphabetical order.
    SELECT * FRM MYTABLE RDER BY NAME LIMIT 100 10 sends the 110 first
    names contained by MYTABLE in alphabetical order instead of sending 100
    names from the 10th.

    This is new for me.
    LIMIT works only in version 7.6.0.34 not in older version 7.6.0.16
    unfortunately (we are using mostly this version).

    Any idea about those problems ?
    Kind regards
    Xavier.
    --

Re: CHAR(a,t) AND LIMIT functions


max 4000 letters.
Your nickname that display:
In order to stop the spam: 8 + 8 =
QUESTION ON "MYSQL"

EMSDN.COM