| Author |
Message |
Michael Peppler *nix forums Guru Wannabe
Joined: 15 May 2005
Posts: 112
|
Posted: Wed Jun 15, 2005 2:28 pm Post subject:
Re: Sybase sitting on its hands or not publishing new features
|
|
|
On Wed, 15 Jun 2005 12:25:31 -0400, Thomas Gagne wrote:
| Quote: | I thought of another - I'd like to be able to use cursors inside
interactive SQL instead of being forced to create procedures when I need a
cursor.
|
You can.
You just need to create the cursor (or declare it, I forget which) in a
separate batch...
Michael
--
Michael Peppler - mpeppler@peppler.org - http://www.peppler.org/
Sybase DBA/Developer
Sybase on Linux FAQ: http://www.peppler.org/FAQ/linux.html |
|
| Back to top |
|
 |
Thomas Gagne *nix forums beginner
Joined: 15 Mar 2005
Posts: 35
|
Posted: Wed Jun 15, 2005 4:54 pm Post subject:
Re: Sybase sitting on its hands or not publishing new features
|
|
|
What do you mean? When I try what I /think/ you mean I get:
tgagne:efinnet 1.1> declare @test int
tgagne:efinnet 1.2> go
tgagne:efinnet 2.1> set @test = 1
tgagne:efinnet 2.2> go
Msg 137, Level 15, State 1
Server 'tgagne', Procedure '', Line 1
Must declare variable '@test'. |
|
| Back to top |
|
 |
Michael Peppler *nix forums Guru Wannabe
Joined: 15 May 2005
Posts: 112
|
Posted: Wed Jun 15, 2005 5:17 pm Post subject:
Re: Sybase sitting on its hands or not publishing new features
|
|
|
On Wed, 15 Jun 2005 14:54:19 -0400, Thomas Gagne wrote:
| Quote: | What do you mean? When I try what I /think/ you mean I get:
tgagne:efinnet 1.1> declare @test int tgagne:efinnet 1.2> go
tgagne:efinnet 2.1> set @test = 1
tgagne:efinnet 2.2> go
Msg 137, Level 15, State 1
Server 'tgagne', Procedure '', Line 1 Must declare variable '@test'.
|
I thought you meant a cursor?
declare cursor ... for select ...
go
declare @foo, etc.
open cursor
while @@sqlstatus = 0
begin
fetch cursor...
end
go
Michael
--
Michael Peppler - mpeppler@peppler.org - http://www.peppler.org/
Sybase DBA/Developer
Sybase on Linux FAQ: http://www.peppler.org/FAQ/linux.html |
|
| Back to top |
|
 |
Thomas Gagne *nix forums beginner
Joined: 15 Mar 2005
Posts: 35
|
Posted: Thu Jun 16, 2005 12:03 am Post subject:
Re: Sybase sitting on its hands or not publishing new features
|
|
|
I did but I thought testing it with a regular declare would indicate how
it would work with a cursor. Perhaps not?
How about that! I just tried it and it worked.
A little inconsistent with the way other "declare" statements work but
hey, what the heck!
Michael Peppler wrote:
| Quote: | On Wed, 15 Jun 2005 14:54:19 -0400, Thomas Gagne wrote:
What do you mean? When I try what I /think/ you mean I get:
tgagne:efinnet 1.1> declare @test int tgagne:efinnet 1.2> go
tgagne:efinnet 2.1> set @test = 1
tgagne:efinnet 2.2> go
Msg 137, Level 15, State 1
Server 'tgagne', Procedure '', Line 1 Must declare variable '@test'.
I thought you meant a cursor?
declare cursor ... for select ...
go
declare @foo, etc.
open cursor
while @@sqlstatus = 0
begin
fetch cursor...
end
go
Michael |
|
|
| Back to top |
|
 |
Anthony Mandic *nix forums Guru Wannabe
Joined: 05 Jul 2005
Posts: 164
|
Posted: Thu Jun 16, 2005 12:11 am Post subject:
Re: Sybase sitting on its hands or not publishing new features
|
|
|
Thomas Gagne wrote:
| Quote: |
I thought of another - I'd like to be able to use cursors inside
interactive SQL instead of being forced to create procedures when I need
a cursor.
|
Er, you can.
| Quote: | Often times I need to create fix scripts that are run-once items.
Creating a procedure, running it, then dropping it doesn't make sense.
|
So why not create a batch?
| Quote: | I would think Sybase engineers would use the database themselves and
would have added some of these features themselves by now. Oh well,
perhaps the ISUG is the only way...
|
Enhancements are one thing. Knowing how to code T-SQL is another.
-am © 2005 |
|
| Back to top |
|
 |
Anthony Mandic *nix forums Guru Wannabe
Joined: 05 Jul 2005
Posts: 164
|
Posted: Thu Jun 16, 2005 12:13 am Post subject:
Re: Sybase sitting on its hands or not publishing new features
|
|
|
Thomas Gagne wrote:
| Quote: |
What do you mean? When I try what I /think/ you mean I get:
tgagne:efinnet 1.1> declare @test int
tgagne:efinnet 1.2> go
tgagne:efinnet 2.1> set @test = 1
tgagne:efinnet 2.2> go
Msg 137, Level 15, State 1
Server 'tgagne', Procedure '', Line 1
Must declare variable '@test'.
|
I don't think you understand what the 'go' does.
Try this instead -
declare @test int
set @test = 1
select @test
go
-am © 2005 |
|
| Back to top |
|
 |
Thomas Gagne *nix forums beginner
Joined: 15 Mar 2005
Posts: 35
|
Posted: Thu Jun 16, 2005 5:07 pm Post subject:
Re: Sybase sitting on its hands or not publishing new features
|
|
|
My point with that example was to show how a variable declared in one
batch is not available in another. I had (wrongly) assumed the same
rule would apply to cursors. The 'go' did exactly what I expected, but
thanks for pointing out I wasn't clear on what the example demonstrated.
Anthony Mandic wrote:
| Quote: | Thomas Gagne wrote:
What do you mean? When I try what I /think/ you mean I get:
tgagne:efinnet 1.1> declare @test int
tgagne:efinnet 1.2> go
tgagne:efinnet 2.1> set @test = 1
tgagne:efinnet 2.2> go
Msg 137, Level 15, State 1
Server 'tgagne', Procedure '', Line 1
Must declare variable '@test'.
I don't think you understand what the 'go' does.
Try this instead -
declare @test int
set @test = 1
select @test
go
-am © 2005 |
|
|
| Back to top |
|
 |
pokerdragon *nix forums beginner
Joined: 23 May 2005
Posts: 14
|
Posted: Thu Jun 16, 2005 7:41 pm Post subject:
Re: upgrade issues - infected processes
|
|
|
| Quote: | OK. Are you using 2PC?
|
Yes, though non-traditionally... we're using it in a single-dataserver
environment. It's a lousy way of doing things, but that's the way the
consultants made it work a decade ago. We're going to be removing that
logic but it will take time.
| Quote: | From your comments, I gather that you are dynamically extending
memory rather than creating it all at once. Is that correct?
|
Correct.
| Quote: | According to the release notes, the ASE 12.5.3 EBFs can only be
installed over ASE 12.5.2 or 12.5.3 for an existing database.
I'm not sure why. The binaries are all selfcontained. Its probably
due to the other things. But I don't know what would affect the
database itself.
|
We did indeed install 12.5.3 over 12.5.2.
Funny thing is, we've now discovered a bug in 12.5.3 ESD1 that is
causing some applications to fail. The bug (Auxiliary scan
descriptors) is fixed in ESD2, but ESD2 causes this error which breaks
our other applications:
01:00000:00223:2005/06/16 15:52:35.59 server The server is probing the
commit service to determine the status of the Sybase two-phase
transaction: 1645643229.SYB_480.RSAM
This message shows up 4 times, then the application fails with 20010:
Attempt to initiate new SQL Server operation with results pending. |
|
| Back to top |
|
 |
Anthony Mandic *nix forums Guru Wannabe
Joined: 05 Jul 2005
Posts: 164
|
Posted: Thu Jun 16, 2005 11:44 pm Post subject:
Re: upgrade issues - infected processes
|
|
|
pokerdragon wrote:
| Quote: |
OK. Are you using 2PC?
Yes, though non-traditionally... we're using it in a single-dataserver
environment. It's a lousy way of doing things, but that's the way the
consultants made it work a decade ago. We're going to be removing that
logic but it will take time.
|
It probably just as well. It sounds very odd to me to use 2PC
with only the one server.
| Quote: | From your comments, I gather that you are dynamically extending
memory rather than creating it all at once. Is that correct?
Correct.
|
That may be the problem. Since that is new to ASE, I would expect
the likelihood of there being bugs in the code to be higher than
in more established code. Since you mentioned that it seems to
happen once it extends, it may be the way its done. I understand
that the memory extend creates a new shared memory segment. It
might be something odd happening at the boundary between two such
segments. Anyway, my contact says they allocate all in one go, so
try that to see if the problem goes away.
| Quote: | According to the release notes, the ASE 12.5.3 EBFs can only be
installed over ASE 12.5.2 or 12.5.3 for an existing database.
I'm not sure why. The binaries are all selfcontained. Its probably
due to the other things. But I don't know what would affect the
database itself.
We did indeed install 12.5.3 over 12.5.2.
|
OK.
| Quote: | Funny thing is, we've now discovered a bug in 12.5.3 ESD1 that is
causing some applications to fail. The bug (Auxiliary scan
descriptors) is fixed in ESD2, but ESD2 causes this error which breaks
our other applications:
01:00000:00223:2005/06/16 15:52:35.59 server The server is probing the
commit service to determine the status of the Sybase two-phase
transaction: 1645643229.SYB_480.RSAM
This message shows up 4 times, then the application fails with 20010:
Attempt to initiate new SQL Server operation with results pending.
|
That last message suggests a bug in your code. It means that
there are results returned from the server that your application
hasn't processed. Basically, you can't start a new transaction
until your client-side code has processed all the results returned
from the server. If you search this newsgroup on Google with
"result pending" as the match, you should find lots of similar
comments in other, old posts. The message you get before that
about the probe isn't an error. But getting rid of the redundant
2PC code will help you.
-am © 2005 |
|
| Back to top |
|
 |
steve *nix forums addict
Joined: 23 Mar 2005
Posts: 70
|
Posted: Wed Jun 29, 2005 4:35 pm Post subject:
Re: storing passwords in a file
|
|
|
"" wrote:
| Quote: | Hi,
I want to store the sa password in a file which I want to read
from a
script file (which will run via cron).
Is there a way to do it so that the unix admin cannot read the
password?
Thanks and regards,
Ashish
|
Hi ashish....
read ur query..
I just made a script where i get the input (login name and
password) from the user.
I tried by keeping the password in a file and then loggin in .I was
succesful!
Just try this
| Quote: | store the password ...for eg..ashish in a file secret
now login as "sa"
|
isql -Usa -Sase_xxx -w100 -P `cat secret`
....here I have used cat command .
try this
--
Posted using the http://www.dbforumz.com interface, at author's request
Articles individually checked for conformance to usenet standards
Topic URL: http://www.dbforumz.com/Sybase-storing-passwords-file-ftopict219204.html
Visit Topic URL to contact author (reg. req'd). Report abuse: http://www.dbforumz.com/eform.php?p=819820 |
|
| Back to top |
|
 |
Anthony Mandic *nix forums Guru Wannabe
Joined: 05 Jul 2005
Posts: 164
|
Posted: Thu Jun 30, 2005 5:31 am Post subject:
Re: storing passwords in a file
|
|
|
crazy_monk wrote:
| Quote: |
"" wrote:
I want to store the sa password in a file which I want to read
from a
script file (which will run via cron).
Is there a way to do it so that the unix admin cannot read the
password?
read ur query..
I just made a script where i get the input (login name and
password) from the user.
I tried by keeping the password in a file and then loggin in .I was
succesful!
Just try this
store the password ...for eg..ashish in a file secret
now login as "sa"
isql -Usa -Sase_xxx -w100 -P `cat secret`
....here I have used cat command .
try this
|
As was pointed out, the root account on Unix can read any file.
As to your solution, the `cat secret` will end up substituting the
contents of the secret file in that position on the command line.
Which means it will be seen with ps (depending on the version of
Unix). The proper way is to echo it into the command so that it
reads the password from standard input. I.e. " ... | isql -U ... - S ...".
Here, no password is supplied on the command line, so isql prompts
for it and reads it from the pipe.
-am © 2005 |
|
| Back to top |
|
 |
Thomas Gagne *nix forums beginner
Joined: 15 Mar 2005
Posts: 35
|
Posted: Thu Jun 30, 2005 6:12 pm Post subject:
Re: storing passwords in a file
|
|
|
Using "is", an isql replacement, I can pass username and password as
environment variables, so they won't appear on the command line. |
|
| Back to top |
|
 |
steve *nix forums addict
Joined: 23 Mar 2005
Posts: 70
|
Posted: Sat Jul 02, 2005 1:36 am Post subject:
Re: storing passwords in a file
|
|
|
"" wrote:
| Quote: | Hi,
I want to store the sa password in a file which I want to read
from a
script file (which will run via cron).
Is there a way to do it so that the unix admin cannot read the
password?
Thanks and regards,
Ashish
|
Hi anthony...
i tried the way which u told me to do...
bt am unsuccessful..
but there is no need to pipe the commands...
even with cat u can provide the password .also it is nt visible
with ps command...
kindly throw some more light on this topic...
regards
monk
--
Posted using the http://www.dbforumz.com interface, at author's request
Articles individually checked for conformance to usenet standards
Topic URL: http://www.dbforumz.com/Sybase-storing-passwords-file-ftopict219204.html
Visit Topic URL to contact author (reg. req'd). Report abuse: http://www.dbforumz.com/eform.php?p=821444 |
|
| Back to top |
|
 |
Luc *nix forums beginner
Joined: 03 Mar 2005
Posts: 10
|
Posted: Mon Jul 25, 2005 10:36 am Post subject:
Re: ASE 12.5 & ResultSet & JAVA
|
|
|
| Quote: | After having estaibilshed a connection with my DB i'm tryng to produce a
resultset and to update my Db. My program runs, and exit without errors,
but i have no output!
this is my problem:
try {
Statement stm = con.createStatement();
res = stm.executeQuery("SELECT * FROM
SCHEMADESCRIPTION");
con.commit();
while (res.next()) {
String Item1 = (String)res.getObject(0);
String Item2 = (String)res.getObject(1);
System.out.println("Values returned");
System.out.println(Item1);
System.out.println(Item2);
}
} catch (SQLException e) {
e.getMessage();
}
The program stops when I try to read the values! In fact I cannot see
System.out.println("Values returned")! The program stops.
Then I modified the program in this way:
int i = 0;
while (res.next()) {
i=i+1;
System.out.println(i);
}
and in this way output returns 52 integers, the numbers of my results!
Connection is established, resultSet are returened, but I cannot read
that values!
|
My jdbc reference book says that the ColumnIndex passed as parameter
to the getXXX methods start with 1, not 0 as in your example.
If that's not the issue, do the first columns in the table have
char values ? What if you use getString, getInt, or whatever type
the column has ? Perhaps there is a problem with the typecasting.
I don't know where other errors are catched but probably there is
some error that is catched and not reported.
Luc. |
|
| Back to top |
|
 |
Webnauta *nix forums beginner
Joined: 25 Jul 2005
Posts: 5
|
Posted: Mon Jul 25, 2005 11:12 am Post subject:
Re: ASE 12.5 & ResultSet & JAVA
|
|
|
Luc wrote:
| Quote: | After having estaibilshed a connection with my DB i'm tryng to produce a
resultset and to update my Db. My program runs, and exit without errors,
but i have no output!
this is my problem:
try {
Statement stm = con.createStatement();
res = stm.executeQuery("SELECT * FROM
SCHEMADESCRIPTION");
con.commit();
while (res.next()) {
String Item1 = (String)res.getObject(0);
String Item2 = (String)res.getObject(1);
System.out.println("Values returned");
System.out.println(Item1);
System.out.println(Item2);
}
} catch (SQLException e) {
e.getMessage();
}
The program stops when I try to read the values! In fact I cannot see
System.out.println("Values returned")! The program stops.
Then I modified the program in this way:
int i = 0;
while (res.next()) {
i=i+1;
System.out.println(i);
}
and in this way output returns 52 integers, the numbers of my results!
Connection is established, resultSet are returened, but I cannot read
that values!
My jdbc reference book says that the ColumnIndex passed as parameter
to the getXXX methods start with 1, not 0 as in your example.
If that's not the issue, do the first columns in the table have
char values ? What if you use getString, getInt, or whatever type
the column has ? Perhaps there is a problem with the typecasting.
I don't know where other errors are catched but probably there is
some error that is catched and not reported.
Luc.
|
Thanks Luc! Now it runs. The problem was the ColumnIndex! Thanks.
The problem still remains when I try an executeUpdate(). I don't
understand why I cannot catch SQLException! the programlog as sa, so it
should let update and creation of new tables. But my program stops! |
|
| Back to top |
|
 |
Google
|
|
| Back to top |
|
 |
|