[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: ODBC in SQRs



Elvis,

We are on SQL Server and I am trying use ODBC to Select data from a DB2
database.

DBATEST is the database owner in DB2.   I need it in order for a Select to run
on DB2.

The part for the error below that confounds me is the reference to a "&name".
Its as if the compiler is expecting an SQR column defined when it is optional.
When I add an SQR column (e.g. &Z.ROW_IDENT) I get the same error.  Also, I've
verified that my ROW_IDENT field is the correct field.  I even tried adding a
WHERE clause.

Is there something that needs to defined in the SQR or SQCs beside the reference
to ODBC in the Begin-Select?
Or do Begin-Selects require a unique syntax for DB2?

ERROR
SQR 1303) Error in SQL (perhaps missing &name after expression):
SELECT ROW_IDENT  FROM DBATEST.FIT_HR_PROF_CHGS
(SQR 1304) Check SELECT columns, expressions and 'where' clause for
syntax.

Thanks again,
Les




Elvis Pressly <elvisdman@HOTMAIL.COM> on 10/05/2001 12:26:08 PM

Please respond to sqr-users@list.iex.net

To:   SQR-USERS@list.iex.net
cc:    (bcc: Les Brugere/Systems/ais)

Subject:  Re: ODBC in SQRs



I assumed that your database reside in AS400 then you really do not
need to use -DB connectivity unless you want to get a table from
different database. Your DSN should already been configured thru
ODBC admin using client access ODBC driver (for AS400) or any ODBC
driver suited for a particular platform like ORACLE.

One thing I notice in your select statement is the

        FROM DBATEST.FIT_HR_PROF_CHGS   <<<

Can please explain to me what DBATEST is?


>From: Les Brugere <Les_Brugere@AISMAIL.WUSTL.EDU>
>Reply-To: sqr-users@list.iex.net
>To: SQR-USERS@list.iex.net
>Subject: Re: ODBC in SQRs
>Date: Fri, 5 Oct 2001 11:26:13 -0500
>
>Elvis,
>
>Thank you for the tip.
>
>I did try the ticks but I am still getting the same error.
>
>Do you know if there are environment variables that must be setup within
>the SQR
>for MVS/DB2/AS400  or within a delivered SQC?
>
>Thanks again,
>Les
>
>
>
>
>Elvis Pressly <elvisdman@HOTMAIL.COM> on 10/05/2001 11:15:33 AM
>
>Please respond to sqr-users@list.iex.net
>
>To:   SQR-USERS@list.iex.net
>cc:    (bcc: Les Brugere/Systems/ais)
>
>Subject:  Re: ODBC in SQRs
>
>
>
>It has to be something like this:
>
>BEGIN-SELECT -DB'DSN=FIDTFSRL;UID=WPUSTST;PWD=PSHR'
>
>You can also read the SQR manual for more information.
>
>
> >From: Les Brugere <Les_Brugere@AISMAIL.WUSTL.EDU>
> >Reply-To: sqr-users@list.iex.net
> >To: SQR-USERS@list.iex.net
> >Subject: ODBC in SQRs
> >Date: Fri, 5 Oct 2001 09:48:10 -0500
> >
> >Hello,
> >
> >I'm attempting to access a DB2 database using the ODBC command as
>follows:
> >
> >BEGIN-SELECT -DBDSN=FIDTFSRL;UID=WPUSTST;PWD=PSHR
> >Z.ROW_IDENT &Z.ROW_IDENT
> >FROM DBATEST.FIT_HR_PROF_CHGS Z
> >END-SELECT
> >
> >The IBM DB2 ODBC DRIVER is installed and the DSN is called FIDTFSRL.
>The
> >platform is NT/SQL Server.
> >
> >I continue to recieve this error:
> >
> >(SQR 1303) Error in SQL (perhaps missing &name after expression):
> >SELECT ROW_IDENT  FROM DBATEST.FIT_HR_PROF_CHGS
> >(SQR 1304) Check SELECT columns, expressions and 'where' clause for
>syntax.
> >
> >SQR: Program Aborting.
> >
> >I also used the following 2 variations of the code resulting in the same
> >error
> >as above:
> >
>
>!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

>
> >BEGIN-SELECT -DBDSN=FIDTFSRL;UID=WPUSTST;PWD=PSHR
> >ROW_IDENT &Z.ROW_IDENT
> >FROM DBATEST.FIT_HR_PROF_CHGS
> >END-SELECT
> >
>
>!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

>
> >BEGIN-SELECT -DBDSN=FIDTFSRL;UID=WPUSTST;PWD=PSHR
> >ROW_IDENT
> >FROM DBATEST.FIT_HR_PROF_CHGS
> >END-SELECT
> >
> >Any thoughts are greatly appreciated!
> >
> >Thanks,
> >Les
>
>
>_________________________________________________________________
>Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp