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.

Why the requested function replicate must use different procedure name?

3 posts in General Discussion Last posting was on 2012-03-05 03:47:38.0Z
Eisen Posted on 2011-12-15 06:43:29.0Z
Sender: 29a3.4ee71297.1804289383@sybase.com
From: Eisen
Newsgroups: sybase.public.rep-server
Subject: Why the requested function replicate must use different procedure name?
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4ee99711.598a.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 14 Dec 2011 22:43:29 -0800
X-Trace: forums-1-dub 1323931409 10.22.241.41 (14 Dec 2011 22:43:29 -0800)
X-Original-Trace: 14 Dec 2011 22:43:29 -0800, 10.22.241.41
Lines: 23
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.rep-server:9114
Article PK: 870278

Dear all
I've built a MSA environment to replicate database
ase1.db1=>ase2.db2. Since some procedures has DDL inside
like 'create procedure ... drop table ... create table...'
and these DDL can't be replicated to the replicate site. I
have to use the function replication. Now I found in RS15.6
the old "create function replication definition" is declared
to be deprecated, now they are "applied function" and
"request function", one is executing the procedure with
maint user, the other is with the same user. Since this
procedure will record the invoker's dbuser name, like
"insert tb select suser_name()...". I'd have to use the
"request function" one. But soon I found when I create
request function replication definition, the primary
procedure name must be different to the replicate procedure
name...
Of course, I can create another procedure with only one
"exec proc_name" to solve this problem, anyway, it's not so
convenient to use. Does anyone know any solution to this?
Thanks.

Best Regards
Eisen


peta62 Posted on 2012-02-07 21:23:51.0Z
From: peta62 <no@mail.com>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0
MIME-Version: 1.0
Newsgroups: sybase.public.rep-server
Subject: Re: Why the requested function replicate must use different procedure name?
References: <4ee99711.598a.1681692777@sybase.com>
In-Reply-To: <4ee99711.598a.1681692777@sybase.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4f319667@forums-1-dub>
Date: 7 Feb 2012 13:23:51 -0800
X-Trace: forums-1-dub 1328649831 10.22.241.152 (7 Feb 2012 13:23:51 -0800)
X-Original-Trace: 7 Feb 2012 13:23:51 -0800, vip152.sybase.com
Lines: 37
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.rep-server:9146
Article PK: 870309

Hello,
this is only changed syntax, the behaviour is exactly the same as it
used to be. I think the names for requested function have to differ due
to round trips. I do not think you have to use requested function as
long as you catch login/user name and provide it as procedure parameter.
Function string would solve the issue too, since rep server stores
primary login in its variables, but I am not sure you can use it in MSA
environment.
HTH,
Peter

On 12/15/2011 7:43 AM, Eisen wrote:
> Dear all
> I've built a MSA environment to replicate database
> ase1.db1=>ase2.db2. Since some procedures has DDL inside
> like 'create procedure ... drop table ... create table...'
> and these DDL can't be replicated to the replicate site. I
> have to use the function replication. Now I found in RS15.6
> the old "create function replication definition" is declared
> to be deprecated, now they are "applied function" and
> "request function", one is executing the procedure with
> maint user, the other is with the same user. Since this
> procedure will record the invoker's dbuser name, like
> "insert tb select suser_name()...". I'd have to use the
> "request function" one. But soon I found when I create
> request function replication definition, the primary
> procedure name must be different to the replicate procedure
> name...
> Of course, I can create another procedure with only one
> "exec proc_name" to solve this problem, anyway, it's not so
> convenient to use. Does anyone know any solution to this?
> Thanks.
>
> Best Regards
> Eisen


Jeff Tallman [Sybase] Posted on 2012-03-05 03:47:38.0Z
From: "Jeff Tallman [Sybase]" <jeff.tallman@sybase.com>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2
MIME-Version: 1.0
Newsgroups: sybase.public.rep-server
Subject: Re: Why the requested function replicate must use different procedurename?
References: <4ee99711.598a.1681692777@sybase.com> <4f319667@forums-1-dub>
In-Reply-To: <4f319667@forums-1-dub>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4f54375a@forums-1-dub>
Date: 4 Mar 2012 19:47:38 -0800
X-Trace: forums-1-dub 1330919258 10.22.241.152 (4 Mar 2012 19:47:38 -0800)
X-Original-Trace: 4 Mar 2012 19:47:38 -0800, vip152.sybase.com
Lines: 45
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.rep-server:9174
Article PK: 870336

The best option when replicating a stored proc that depends on system
functions (such as getdate(), suser_name(), etc.) is to instead
replicate a proc shell that passes those values as parameters - and then
calls the desired proc with those values. Slight code change, but
easiest and quickest to implement.

On 2/7/2012 4:23 PM, peta62 wrote:
> Hello,
> this is only changed syntax, the behaviour is exactly the same as it
> used to be. I think the names for requested function have to differ due
> to round trips. I do not think you have to use requested function as
> long as you catch login/user name and provide it as procedure parameter.
> Function string would solve the issue too, since rep server stores
> primary login in its variables, but I am not sure you can use it in MSA
> environment.
> HTH,
> Peter
>
>
> On 12/15/2011 7:43 AM, Eisen wrote:
>> Dear all
>> I've built a MSA environment to replicate database
>> ase1.db1=>ase2.db2. Since some procedures has DDL inside
>> like 'create procedure ... drop table ... create table...'
>> and these DDL can't be replicated to the replicate site. I
>> have to use the function replication. Now I found in RS15.6
>> the old "create function replication definition" is declared
>> to be deprecated, now they are "applied function" and
>> "request function", one is executing the procedure with
>> maint user, the other is with the same user. Since this
>> procedure will record the invoker's dbuser name, like
>> "insert tb select suser_name()...". I'd have to use the
>> "request function" one. But soon I found when I create
>> request function replication definition, the primary
>> procedure name must be different to the replicate procedure
>> name...
>> Of course, I can create another procedure with only one
>> "exec proc_name" to solve this problem, anyway, it's not so
>> convenient to use. Does anyone know any solution to this?
>> Thanks.
>>
>> Best Regards
>> Eisen
>