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.

Changing Password in Stored Procedure

7 posts in General Discussion Last posting was on 2003-06-02 17:33:58.0Z
Richard Posted on 2003-05-29 18:14:58.0Z
From: "Richard" <Richardr@ldsinc.com>
Subject: Changing Password in Stored Procedure
Date: Thu, 29 May 2003 13:14:58 -0500
Lines: 32
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <ekQ6m8gJDHA.187@forums-2-dub>
Newsgroups: ianywhere.public.general
NNTP-Posting-Host: lds253.ldsinc.com 66.6.104.253
Path: forums-1-dub!forums-master.sybase.com!forums-2-dub.sybase.com
Xref: forums-1-dub ianywhere.public.general:1117
Article PK: 3041

I am having problems trying to change password from a Stored Procedure..

Here is the Procedure:

ALTER procedure DBA.sp_Adm_ChangePwd(@NewPassword char(254))
as
set NOCOUNT on
Declare @NPW varchar(254)
Select @NPW=trim(@NewPassword)
grant connect,to Vradm identified by @NPW


When I execute It does not allow to logon...I have to go into Sybase Central
and change password there. Then I went into the Stored Procedure and edit
and it comes up like this

ALTER procedure DBA.sp_Adm_ChangePwd(@NewPassword char(254))
as
set NOCOUNT on
declare @NPW varchar(254)
select @NPW=trim(@NewPassword)
grant connect,to Vradm identified by encrypted
0x2A135B4F8F4C54DEE50C53BD3140A4EA29E7A568518182E1FBA6F6084080A9A088C847A4


Why the encryption in the Edit mode...
What am I doing wrong

Thanks!
Richard


Stephen Rice Posted on 2003-05-29 18:51:09.0Z
From: "Stephen Rice" <srice_nospam@ianywhere.com>
References: <ekQ6m8gJDHA.187@forums-2-dub>
Subject: Re: Changing Password in Stored Procedure
Date: Thu, 29 May 2003 14:51:09 -0400
Lines: 55
Organization: iAnywhere Solutions
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <ecEJ1QhJDHA.275@forums-2-dub>
Newsgroups: ianywhere.public.general
NNTP-Posting-Host: srice-pc.sybase.com 172.31.142.125
Path: forums-1-dub!forums-master.sybase.com!forums-2-dub.sybase.com
Xref: forums-1-dub ianywhere.public.general:1120
Article PK: 3385

I believe you will find the password is the string @NPW. The GRANT
statement does not take arguments

You will need to use the EXECUTE IMMEDIATE statement and pass it your grant
statement with the password string appended as the string

/steve

--
Stephen Rice
Technical Services Manager
iAnywhere Solutions

- Please Post-
Whitepapers, TechDocs, and bug fixes are all available through the iAnywhere
Developer Community at www.ianywhere.com/developer

"Richard" <Richardr@ldsinc.com> wrote in message
news:ekQ6m8gJDHA.187@forums-2-dub...
> I am having problems trying to change password from a Stored Procedure..
>
> Here is the Procedure:
>
> ALTER procedure DBA.sp_Adm_ChangePwd(@NewPassword char(254))
> as
> set NOCOUNT on
> Declare @NPW varchar(254)
> Select @NPW=trim(@NewPassword)
> grant connect,to Vradm identified by @NPW
>
>
> When I execute It does not allow to logon...I have to go into Sybase
Central
> and change password there. Then I went into the Stored Procedure and edit
> and it comes up like this
>
> ALTER procedure DBA.sp_Adm_ChangePwd(@NewPassword char(254))
> as
> set NOCOUNT on
> declare @NPW varchar(254)
> select @NPW=trim(@NewPassword)
> grant connect,to Vradm identified by encrypted
> 0x2A135B4F8F4C54DEE50C53BD3140A4EA29E7A568518182E1FBA6F6084080A9A088C847A4
>
>
> Why the encryption in the Edit mode...
> What am I doing wrong
>
> Thanks!
> Richard
>
>


Richard Posted on 2003-05-29 20:27:43.0Z
From: Richard
Date: Thu, 29 May 2003 16:27:43 -0400
Newsgroups: ianywhere.public.general
Subject: Re: Changing Password in Stored Procedure
Message-ID: <6FE25B6105BCF27B007066B685256D35.006BFC2085256D35@webforums>
References: <ekQ6m8gJDHA.187@forums-2-dub> <ecEJ1QhJDHA.275@forums-2-dub>
Lines: 3
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Path: forums-1-dub!forums-master.sybase.com!webforums.sybase.com!news
Xref: forums-1-dub ianywhere.public.general:1121
Article PK: 3044

Could you show me an example of how to use ...thanks

Richard


Stephen Rice Posted on 2003-05-30 19:48:52.0Z
From: "Stephen Rice" <srice_nospam@ianywhere.com>
References: <ekQ6m8gJDHA.187@forums-2-dub> <ecEJ1QhJDHA.275@forums-2-dub> <6FE25B6105BCF27B007066B685256D35.006BFC2085256D35@webforums>
Subject: Re: Changing Password in Stored Procedure
Date: Fri, 30 May 2003 15:48:52 -0400
Lines: 20
Organization: iAnywhere Solutions
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <#opUDUuJDHA.280@forums-1-dub>
Newsgroups: ianywhere.public.general
NNTP-Posting-Host: srice-pc.sybase.com 172.31.142.125
Path: forums-1-dub!forums-master.sybase.com!forums-1-dub.sybase.com
Xref: forums-1-dub ianywhere.public.general:1134
Article PK: 3056

execute immediate 'grant connect to abc identified by '||pwd;


--
Stephen Rice
Technical Services Manager
iAnywhere Solutions

- Please Post-
Whitepapers, TechDocs, and bug fixes are all available through the iAnywhere
Developer Community at www.ianywhere.com/developer

<Richard> wrote in message
news:6FE25B6105BCF27B007066B685256D35.006BFC2085256D35@webforums...
> Could you show me an example of how to use ...thanks
>
> Richard


Richard Posted on 2003-06-02 13:56:56.0Z
From: Richard
Date: Mon, 2 Jun 2003 09:56:56 -0400
Newsgroups: ianywhere.public.general
Subject: Re: Changing Password in Stored Procedure
Message-ID: <ED002B6DDE607B2F004C9F9F85256D39.00750C0085256D36@webforums>
References: <ekQ6m8gJDHA.187@forums-2-dub> <ecEJ1QhJDHA.275@forums-2-dub> <6FE25B6105BCF27B007066B685256D35.006BFC2085256D35@webforums> <#opUDUuJDHA.280@forums-1-dub>
Lines: 17
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Path: forums-1-dub!forums-master.sybase.com!webforums.sybase.com!news
Xref: forums-1-dub ianywhere.public.general:1137
Article PK: 3053

Thanks so much for you help...but I must be thick headed. how can I
impilement this in a Stored Procedure. I see how this can work in script
now but I tried to get this statement to work in where I can call in Stored
proc. It keeps encrypting my passwork string varible. Does this not work
in Stored procedure?


ALTER procedure DBA.sp_Adm_ChangePwd(in @NewPassword char(254))
on exception resume
begin
set NOCOUNT on;
begin
declare @NPW varchar(254);
set @NPW=trim(@NewPassword);
grant connect,to Vradm identified by encrypted
0xDB6C60AA6A043CFFB91569EC4820E523965D5373D8465C87FE3E22E8C19FB9BA15F6FCD0
end
end


Reg Domaratzki Posted on 2003-06-02 14:56:23.0Z
From: "Reg Domaratzki" <rdomarat__AT__ianywhere__DOT__com>
References: <ekQ6m8gJDHA.187@forums-2-dub> <ecEJ1QhJDHA.275@forums-2-dub> <6FE25B6105BCF27B007066B685256D35.006BFC2085256D35@webforums> <#opUDUuJDHA.280@forums-1-dub> <ED002B6DDE607B2F004C9F9F85256D39.00750C0085256D36@webforums>
Subject: Re: Changing Password in Stored Procedure
Date: Mon, 2 Jun 2003 10:56:23 -0400
Lines: 38
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <OyC4XgRKDHA.187@forums-2-dub>
Newsgroups: ianywhere.public.general
NNTP-Posting-Host: 172.31.143.163
Path: forums-1-dub!forums-master.sybase.com!forums-2-dub.sybase.com
Xref: forums-1-dub ianywhere.public.general:1139
Article PK: 3388

create procedure NewAdminPwd (in in_pwd varchar(254) )
begin
execute immediate 'grant connect to Vradm identified by ' || trim(in_pwd);
end;

--
Reg Domaratzki, Sybase iAnywhere Solutions
Sybase Certified Professional - Sybase ASA Developer Version 8
Please reply only to the newsgroup

iAnywhere Developer Community : http://www.ianywhere.com/developer
ASA Patches and EBFs : http://downloads.sybase.com/swx/sdmain.stm
-> Choose SQL Anywhere Studio
-> Set "Platform Preview" and "Time Frame" to ALL

<Richard> wrote in message
news:ED002B6DDE607B2F004C9F9F85256D39.00750C0085256D36@webforums...
> Thanks so much for you help...but I must be thick headed. how can I
> impilement this in a Stored Procedure. I see how this can work in script
> now but I tried to get this statement to work in where I can call in
Stored
> proc. It keeps encrypting my passwork string varible. Does this not work
> in Stored procedure?
>
>
> ALTER procedure DBA.sp_Adm_ChangePwd(in @NewPassword char(254))
> on exception resume
> begin
> set NOCOUNT on;
> begin
> declare @NPW varchar(254);
> set @NPW=trim(@NewPassword);
> grant connect,to Vradm identified by encrypted
> 0xDB6C60AA6A043CFFB91569EC4820E523965D5373D8465C87FE3E22E8C19FB9BA15F6FCD0
> end
> end


Richard Posted on 2003-06-02 17:33:58.0Z
From: Richard
Date: Mon, 2 Jun 2003 13:33:58 -0400
Newsgroups: ianywhere.public.general
Subject: Re: Changing Password in Stored Procedure
Message-ID: <B5E5DD679DD579D400607E4885256D39.0058942B85256D39@webforums>
References: <ekQ6m8gJDHA.187@forums-2-dub> <ecEJ1QhJDHA.275@forums-2-dub> <6FE25B6105BCF27B007066B685256D35.006BFC2085256D35@webforums> <#opUDUuJDHA.280@forums-1-dub> <ED002B6DDE607B2F004C9F9F85256D39.00750C0085256D36@webforums> <OyC4XgRKDHA.187@forums-2-dub>
Lines: 3
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Path: forums-1-dub!forums-master.sybase.com!webforums.sybase.com!news
Xref: forums-1-dub ianywhere.public.general:1142
Article PK: 3392

That did the trick...Thanks for clarifing

Richard