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.

Help

2 posts in General Discussion Last posting was on 2007-10-25 12:16:26.0Z
Herman Miller Posted on 2007-10-25 11:00:09.0Z
Sender: 4e4f.471f581a.1804289383@sybase.com
From: Herman Miller
Newsgroups: ianywhere.public.general
Subject: Help
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <47207739.6b0a.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 25 Oct 2007 04:00:09 -0700
X-Trace: forums-1-dub 1193310009 10.22.241.41 (25 Oct 2007 04:00:09 -0700)
X-Original-Trace: 25 Oct 2007 04:00:09 -0700, 10.22.241.41
Lines: 34
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:6480
Article PK: 2914

I am using the follwoing to create an event, can I get
assistance on what the system doesn't like about the syntax.
I am newbie with this.

begin
if exists (select * from sysevent where
event_name='Start_Mobilink') then
drop event Start_Mobilink;
end if;

create event Start_Mobilink type DatabaseStart
enable handler begin
call xp_cmdshell('dbisqlc -c
"uid=dba;pwd=hmis;ENG=Total;LINKS=TCPIP(HOST=11.111.111.50;DoBroadcast=None)"
c:\check_home.txt', 'no_output');


LOAD TABLE "DBA"."mobilink_setup"
FROM 'C:\\mobilink_ready.txt'
FORMAT 'ASCII' QUOTES ON;

declare @vers char(10);
declare @mchk char(10);
select max(version) into @vers from dba.ctr_central;
select mobilink_on into @mchk from mobilink_setup where
centercode='BRK';
if @mchk='1' then
call xp_cmdshell('c:\lcos\db\dbmlsync.exe -c
"dsn=LCOS;uid=remoteuser;pwd=remote" -k -q -x 100M -os 5M -o
c:\lcos\db\mobilink_BRK.log -e "sv=''2.28''"', 'no_output'
);
end if
end;
end;


Chris Keating (Sybase iAnywhere) Posted on 2007-10-25 12:16:26.0Z
From: "Chris Keating (Sybase iAnywhere)" <keating_spam_free@ianywhere.com>
User-Agent: Thunderbird 2.0.0.6 (Windows/20070728)
MIME-Version: 1.0
Newsgroups: ianywhere.public.general
Subject: Re: Help
References: <47207739.6b0a.1681692777@sybase.com>
In-Reply-To: <47207739.6b0a.1681692777@sybase.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: keating-d620.sybase.com
X-Original-NNTP-Posting-Host: keating-d620.sybase.com
Message-ID: <4720891a$1@forums-1-dub>
Date: 25 Oct 2007 05:16:26 -0700
X-Trace: forums-1-dub 1193314586 10.25.98.110 (25 Oct 2007 05:16:26 -0700)
X-Original-Trace: 25 Oct 2007 05:16:26 -0700, keating-d620.sybase.com
Lines: 79
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:6481
Article PK: 2916

To help those reading your posts, please
1. Include a better subject line... "Help" gives no context to the question
2. Please include all relevant information... i.e., in this example, the
syntax error

The DECLARE statement(s) must be declared with other declarations, such
as a cursor declaration (DECLARE CURSOR) immediately following the BEGIN
keyword of a compound statement.

as in

begin
declare @vers char(10); -- <*** this was moved
declare @mchk char(10); -- <*** this was moved

if exists (select * from sysevent where
event_name='Start_Mobilink') then
drop event Start_Mobilink;
end if;

create event Start_Mobilink type DatabaseStart
enable handler begin
call xp_cmdshell('dbisqlc -c
"uid=dba;pwd=hmis;ENG=Total;LINKS=TCPIP(HOST=11.111.111.50;DoBroadcast=None)"
c:\check_home.txt', 'no_output');


LOAD TABLE "DBA"."mobilink_setup"
FROM 'C:\\mobilink_ready.txt'
FORMAT 'ASCII' QUOTES ON;

select max(version) into @vers from dba.ctr_central;
select mobilink_on into @mchk from mobilink_setup where
centercode='BRK';
if @mchk='1' then
call xp_cmdshell('c:\lcos\db\dbmlsync.exe -c
"dsn=LCOS;uid=remoteuser;pwd=remote" -k -q -x 100M -os 5M -o
c:\lcos\db\mobilink_BRK.log -e "sv=''2.28''"', 'no_output'
);
end if
end;
end;

Herman Miller wrote:
> I am using the follwoing to create an event, can I get
> assistance on what the system doesn't like about the syntax.
> I am newbie with this.
>
> begin
> if exists (select * from sysevent where
> event_name='Start_Mobilink') then
> drop event Start_Mobilink;
> end if;
>
> create event Start_Mobilink type DatabaseStart
> enable handler begin
> call xp_cmdshell('dbisqlc -c
> "uid=dba;pwd=hmis;ENG=Total;LINKS=TCPIP(HOST=11.111.111.50;DoBroadcast=None)"
> c:\check_home.txt', 'no_output');
>
>
> LOAD TABLE "DBA"."mobilink_setup"
> FROM 'C:\\mobilink_ready.txt'
> FORMAT 'ASCII' QUOTES ON;
>
> declare @vers char(10);
> declare @mchk char(10);
> select max(version) into @vers from dba.ctr_central;
> select mobilink_on into @mchk from mobilink_setup where
> centercode='BRK';
> if @mchk='1' then
> call xp_cmdshell('c:\lcos\db\dbmlsync.exe -c
> "dsn=LCOS;uid=remoteuser;pwd=remote" -k -q -x 100M -os 5M -o
> c:\lcos\db\mobilink_BRK.log -e "sv=''2.28''"', 'no_output'
> );
> end if
> end;
> end;