Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

FORWARD TO in stored procedure or view

3 posts in General Discussion Last posting was on 2005-03-15 14:26:07.0Z
John David Posted on 2005-03-15 12:32:05.0Z
From: John David <John.David83@gmx.net>
User-Agent: Mozilla Thunderbird 0.8 (Windows/20040913)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: ianywhere.public.general
Subject: FORWARD TO in stored procedure or view
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 195.6.255.158
X-Original-NNTP-Posting-Host: 195.6.255.158
Message-ID: <4236d5c5$1@forums-1-dub>
Date: 15 Mar 2005 04:32:05 -0800
X-Trace: forums-1-dub 1110889925 195.6.255.158 (15 Mar 2005 04:32:05 -0800)
X-Original-Trace: 15 Mar 2005 04:32:05 -0800, 195.6.255.158
Lines: 9
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:4220
Article PK: 8093

Hi all,
if I'm try to write a stored procedure or a view containing a FORWARD TO
statement I always get "Syntax error near 'FORWARD' on line x". Inside
ISQL the same FORWARD TO works great.
statement: FORWARD TO AS400 'SELECT Number1 FROM DB1.TABLE1';
ASA: Adaptive Server Anywhere Network Server Version 9.0.2.2451
Any ideas?
TIA,
John


David Fishburn Posted on 2005-03-15 14:08:09.0Z
Newsgroups: ianywhere.public.general
Subject: Re: FORWARD TO in stored procedure or view
From: David Fishburn <fishburn_spam@off.ianywhere.com>
References: <4236d5c5$1@forums-1-dub>
Organization: iAnywhere Solutions
Message-ID: <Xns961A5CE784F06fishburnsybasecom@127.0.0.1>
User-Agent: Xnews/06.08.25 Hamster/2.0.6.0
NNTP-Posting-Host: fishburn-t30.sybase.com
X-Original-NNTP-Posting-Host: fishburn-t30.sybase.com
Date: 15 Mar 2005 06:08:09 -0800
X-Trace: forums-1-dub 1110895689 10.25.98.119 (15 Mar 2005 06:08:09 -0800)
X-Original-Trace: 15 Mar 2005 06:08:09 -0800, fishburn-t30.sybase.com
Lines: 43
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:4222
Article PK: 8095

John David <John.David83@gmx.net> wrote in news:4236d5c5$1@forums-1-dub
of ianywhere.public.general:

JD> if I'm try to write a stored procedure or a view containing a FORWARD
TO
JD> statement I always get "Syntax error near 'FORWARD' on line x". Inside
JD> ISQL the same FORWARD TO works great.
JD> statement: FORWARD TO AS400 'SELECT Number1 FROM DB1.TABLE1';
JD> ASA: Adaptive Server Anywhere Network Server Version 9.0.2.2451

ASA SQL Reference
SQL Statements
FORWARD TO statement

...
Note
The FORWARD TO statement is a server directive and cannot be used within
procedures or batches.


No can do.

--
David Fishburn
Certified ASA Developer Version 8
iAnywhere Solutions - Sybase
Professional Services
Please only post to the newsgroup
Please ALWAYS include version and MORE importantly BUILD number with
EACH post (dbeng9 -v).

EBFs and Maintenance Releases
http://downloads.sybase.com/swx/sdmain.stm

Developer Community / Whitepapers
http://www.ianywhere.com/developer

CaseXpress - to report bugs
http://casexpress.sybase.com

CodeXchange - Free samples
http://ianywhere.codexchange.sybase.com/servlets/ProjectDocumentList


Breck Carter [TeamSybase] Posted on 2005-03-15 14:26:07.0Z
From: "Breck Carter [TeamSybase]" <NOSPAM__bcarter@risingroad.com>
Newsgroups: ianywhere.public.general
Subject: Re: FORWARD TO in stored procedure or view
Organization: RisingRoad Professional Services
Reply-To: NOSPAM__bcarter@risingroad.com
Message-ID: <p2sd31lh0g3n8nad6kt30ijt4879g481sk@4ax.com>
References: <4236d5c5$1@forums-1-dub>
X-Newsreader: Forte Agent 2.0/32.640
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: bcarter.sentex.ca
X-Original-NNTP-Posting-Host: bcarter.sentex.ca
Date: 15 Mar 2005 06:26:07 -0800
X-Trace: forums-1-dub 1110896767 64.7.134.118 (15 Mar 2005 06:26:07 -0800)
X-Original-Trace: 15 Mar 2005 06:26:07 -0800, bcarter.sentex.ca
Lines: 24
X-Authenticated-User: TeamSybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:4223
Article PK: 8097

On 15 Mar 2005 04:32:05 -0800, John David <John.David83@gmx.net>

wrote:

>Hi all,
>if I'm try to write a stored procedure or a view containing a FORWARD TO
>statement I always get "Syntax error near 'FORWARD' on line x". Inside
>ISQL the same FORWARD TO works great.
>statement: FORWARD TO AS400 'SELECT Number1 FROM DB1.TABLE1';
>ASA: Adaptive Server Anywhere Network Server Version 9.0.2.2451
>Any ideas?
>TIA,
>John

Use EXECUTE IMMEDIATE.

Breck


--
SQL Anywhere Studio 9 Developer's Guide
Buy the book: http://www.amazon.com/exec/obidos/ASIN/1556225067/risingroad-20
bcarter@risingroad.com
RisingRoad SQL Anywhere and MobiLink Professional Services
www.risingroad.com