Article View: borland.public.cppbuilder.database.ado
Article #2599Re: SQL SELECT -- Combine 2 columns
From: Viatcheslav V. Vassiliev
Date: Mon, 21 Apr 2003 06:55
Date: Mon, 21 Apr 2003 06:55
413 lines
7597 bytes
7597 bytes
Here is list of keywords for MS Jet (MS Access) as OLEDB provider reports
them:
ABSOLUTE
ACTION
ADD
ALL
ALLOCATE
ALTER
AND
ANY
ARE
AS
ASC
ASSERTION
AT
AUTHORIZATION
AVG
BEGIN
BETWEEN
BIT
BIT_LENGTH
BOTH
BY
CASCADE
CASCADED
CASE
CAST
CATALOG
CHAR
CHAR_LENGTH
CHARACTER
CHARACTER_LENGTH
CHECK
CLOSE
COALESCE
COLLATE
COLLATION
COLUMN
COMMIT
CONNECT
CONNECTION
CONSTRAINT
CONSTRAINTS
CONTINUE
CONVERT
CORRESPONDING
COUNT
CREATE
CROSS
CURRENT
CURRENT_DATE
CURRENT_TIME
CURRENT_TIMESTAMP
CURRENT_USER
CURSOR
DATE
DAY
DEALLOCATE
DEC
DECIMAL
DECLARE
DEFAULT
DEFERRABLE
DEFERRED
DELETE
DESC
DESCRIBE
DESCRIPTOR
DIAGNOSTICS
DISCONNECT
DISTINCT
DISTINCTROW
DOMAIN
DOUBLE
DROP
ELSE
END
ESCAPE
EXCEPT
EXCEPTION
EXEC
EXECUTE
EXISTS
EXTERNAL
EXTRACT
FALSE
FETCH
FIRST
FLOAT
FOR
FOREIGN
FOUND
FROM
FULL
GET
GLOBAL
GO
GOTO
GRANT
GROUP
HAVING
HOUR
IDENTITY
IMMEDIATE
IN
INDICATOR
INITIALLY
INNER
INPUT
INSENSITIVE
INSERT
INT
INTEGER
INTERSECT
INTERVAL
INTO
IS
ISOLATION
JOIN
KEY
LANGUAGE
LAST
LEADING
LEFT
LEVEL
LIKE
LOCAL
LOWER
MATCH
MAX
MIN
MINUTE
MODULE
MONTH
NAMES
NATIONAL
NATURAL
NCHAR
NEXT
NO
NOT
NULL
NULLIF
NUMERIC
OCTET_LENGTH
OF
ON
ONLY
OPEN
OPTION
OR
ORDER
OUTPUT
OVERLAPS
PARTIAL
POSITION
PRECISION
PREPARE
PRESERVE
PRIMARY
PRIOR
PRIVILEGES
PROCEDURE
PUBLIC
READ
REAL
REFERENCES
RELATIVE
RESTRICT
REVOKE
RIGHT
ROLLBACK
ROWS
SCHEMA
SCROLL
SECOND
SECTION
SELECT
SESSION
SESSION_USER
SET
SIZE
SMALLINT
SOME
SQL
SQLCODE
SQLERROR
SQLSTATE
SUBSTRING
SUM
SYSTEM_USER
TABLE
TEMPORARY
THEN
TIME
TIMESTAMP
TIMEZONE_HOUR
TIMEZONE_MINUTE
TO
TRAILING
TRANSACTION
TRANSLATE
TRANSLATION
TRIGGER
TRIM
TRUE
UNION
UNIQUE
UNKNOWN
UPDATE
UPPER
USAGE
USER
USING
VALUE
VALUES
VARCHAR
VARYING
VIEW
WHEN
WHENEVER
WHERE
WITH
WORK
WRITE
YEAR
ZONE
AdminDB
Alphanumeric
Autoincrement
BAND
Binary
BNOT
BOR
BXOR
Byte
Comp
Compression
Container
Counter
CreateDB
Currency
Database
DateTime
Disallow
ExclusiveConnect
Float4
Float8
General
Guid
IEEEDouble
IEEESingle
Ignore
Image
Index
Inheritable
Integer1
Integer2
Integer4
Logical
Logical1
Long
LongBinary
LongChar
LongText
Memo
Money
Note
Number
Object
OLEObject
OwnerAccess
Pad
Parameters
Password
Percent
Pivot
Proc
SelectSchema
SelectSecurity
Short
Single
Space
String
Tableid
Text
Top
Transform
Uniqueidentifier
UpdateIdentity
UpdateOwner
UpdateSecurity
Varbinary
YesNo
But it is a good idea to always use [].
----------------------------------------------------------------
Regards,
Viatcheslav V. Vassiliev
http://www.oledbdirect.com
The fastest way to access MS SQL Server, MS Jet (MS Access)
and Interbase (through OLEDB) databases.
"Rainer Welzel" <rainer@fgg-welzel.de> �������/�������� � ��������
���������: news:3ea3892b$1@newsgroups.borland.com...
> Hi Viatcheslav ,
> your right, it must something with the Fieldnames.
> Here my used Fieldnames:
>
> Fieldname => NachName, Typ => Text , Comment => Surname of Individual.
Use
> Maiden name for women.
> Fieldname => VorName, Typ => Text , Comment => Name of the Individual
>
> it doesn't works. In the DBGrid I see only the first Field.
>
> I tray an other pair of the above table.
> Fieldname => BirthDate, Typ => Text , Comment => Date of Birth.
> Fieldname => BirtPlac, Typ => Text , Comment => Place of Birth
>
> In the StringList Editor of the ADOQuery Component the Statement:
>
> SELECT BirthDate + ", " + BirthPlac AS Birth FROM tblIndividual
> works very well -- I see two Fields in the DBGrid :
> --------------------------------------------------------------------------
--
> --
> If there some Information on special keywords for Fieldnames ???
>
> Thank you for your help.
>
> Rainer
>
>
> "Viatcheslav V. Vassiliev" <support@oledbdirect.com> schrieb im
Newsbeitrag
> news:3ea24fdc@newsgroups.borland.com...
> > What error do you have? Note that Name is special keyword and use:
> >
> > Select [Name], ([City] + ', ' + [Country]) as [Location] from [tblIndy]
> >
> > If City or Country is not string column, use
> >
> > Select [Name], (CStr([City]) + ', ' + CStr([Country])) as [Location]
from
> > [tblIndy]
> >
> > If this does not help, install latest MDAC and Jet SP.
> >
> > ----------------------------------------------------------------
> > Regards,
> > Viatcheslav V. Vassiliev
> > http://www.oledbdirect.com
> > The fastest way to access MS SQL Server, MS Jet (MS Access)
> > and Interbase (through OLEDB) databases.
> >
> > "Rainer Welzel" <rainer@fgg-welzel.de> �������/�������� � ��������
> > ���������: news:3ea23628@newsgroups.borland.com...
> > > This doesn't works.
> > > I use Jet 4.0
> > > with a ADOQuery and a DBGrid.
> > >
> > > rainer
> > >
> > > "Viatcheslav V. Vassiliev" <support@oledbdirect.com> schrieb im
> > Newsbeitrag
> > > news:3ea14f97@newsgroups.borland.com...
> > > > This depends on your DBMS. In MS SQL Server use (pubs db):
> > > >
> > > > Select (au_lname + ', ' + au_fname) as [name] from authors
> > > >
> > > > ----------------------------------------------------------------
> > > > Regards,
> > > > Viatcheslav V. Vassiliev
> > > > http://www.oledbdirect.com
> > > > The fastest way to access MS SQL Server, MS Jet (MS Access)
> > > > and Interbase (through OLEDB) databases.
> > > >
> > > > "Rainer Welzel" <rainer@fgg-welzel.de> �������/�������� � ��������
> > > > ���������: news:3ea14b69@newsgroups.borland.com...
> > > > > Hi ,
> > > > > I failed to combine 2 fields with the following statement:
> > > > >
> > > > > ADOQueryIND->SQL->Add("SELECT Name, City & ', ' & Country AS
> Location
> > > FROM
> > > > > tblIndi");
> > > > >
> > > > > also
> > > > >
> > > > > ADOQueryIND->SQL->Add("SELECT Name, City || ', ' || Country AS
> > Location
> > > > FROM
> > > > > tblIndi");
> > > > >
> > > > > this statement failed.
> > > > >
> > > > > Have anybody the right syntax ??
> > > > >
> > > > > thx rainer
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>
Technical Details
Message-ID:
<3ea39637@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-08!supernews.com!38.144.126.75.MISMATCH!feed1.newsreader.com!newsreader.com!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mailReferences:
<3ea14b69@newsgroups.borland.com> <3ea14f97@newsgroups.borland.com> <3ea23628@newsgroups.borland.com> <3ea24fdc@newsgroups.borland.com> <3ea3892b$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: 10698b,2ea9fd8801400070 X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2003-04-21 00:03:28 PST From: "Viatcheslav V. Vassiliev" <support@oledbdirect.com> Newsgroups: borland.public.cppbuilder.database.ado References: <3ea14b69@newsgroups.borland.com> <3ea14f97@newsgroups.borland.com> <3ea23628@newsgroups.borland.com> <3ea24fdc@newsgroups.borland.com> <3ea3892b$1@newsgroups.borland.com> Subject: Re: SQL SELECT -- Combine 2 columns Date: Mon, 21 Apr 2003 10:55:58 +0400 Lines: 415 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 NNTP-Posting-Host: 213.247.201.57 Message-ID: <3ea39637@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1050908215 213.247.201.57 (20 Apr 2003 23:56:55 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-08!supernews.com!38.144.126.75.MISMATCH!feed1.newsreader.com!newsreader.com!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail