Sql92 Current-value Function

mtbim

New Member
Hi.
I want to learn how to reach CURRENT-VALUE FUNCTION from sql explorer tool.
I can get the value by using
SELECT CURRENT-VALUE(sequence_name) FROM table_name
in procedure editor.
But I want to get this value from SQL Explorer Tool. (So, I am going to use linked server)

I tried
select CURRENT-VALUE(sequence_name) from Pub."_sequence"

I am getting "[JDBC Progress Driver]:Syntax error (7587)" error.

Can you help me for this?
I am using Progress 9.1D
Thanks..
 
According to online knowledgebase (Problem id #P21780), the correct syntax would rather be "SELECT PUB.SequenceName.CURRVAL FROM PUB.TableName;"
 
Thanks
My sequence name: sequence-name


Select PUB.sequence-name.CURRVAL As fld FROM Pub.table_name
I am getting this error:


=== SQL Exception 1 ===
SQLState=42000
ErrorCode=-20003
[JDBC Progress Driver]:Syntax error (7587)

Select PUB."sequence-name".CURRVAL As fld FROM Pub.table_name
I am getting this error:
=== SQL Exception 1 ===
SQLState=HY000
ErrorCode=-210051
[JDBC Progress Driver]:Internal error -1214 (see dsmret.h) in SQL from subsystem DSM SERVICES function dsmSeqGetID called from seq_get_seq_id on for . Save log for Progress technical support.

sequence-name is true. I can get the value from procedure editor.
 
210051 means: "sequence name not found" so your sequence must be having a different name.

I just created in the sports2000 database a sequence with the name "sequence-name" (rather obscure name for a sequence :-) )

And for me this works:
Code:
[SIZE=2][COLOR=#0000ff]select[/COLOR][/SIZE][SIZE=2][COLOR=#0064ff]PUB[/COLOR][/SIZE][SIZE=2]."Sequence-[/SIZE][SIZE=2][COLOR=#0000ff]Name[/COLOR][/SIZE][SIZE=2]".CURRVAL [/SIZE][SIZE=2][COLOR=#0000ff]from [/COLOR][/SIZE][SIZE=2][COLOR=#0064ff]pub[/COLOR][/SIZE][SIZE=2].[/SIZE][SIZE=2][COLOR=#0064ff]customer[/COLOR][/SIZE]

AFAIK an alias cannot be used in cobination with currval.

Casper.
 
I am really sory.
I created new sequence which name is test.
with procedure editor
SELECT CURRENT-VALUE(test) AS fld FROM TableName
works
But with SQL Explorer (connect over TCP, port)
select pub.test.currval from Pub.TableName
doesn't work.

Any ideas?
Service pack problem?
TableName problem?
SequenceName problem?
progress 9.1D versiyon problem?

with sql explorer
SELECT * from Pub."_sequence"
I can see my sequence.

One thing more
I created test sequence at sports2000 database and it works!
What is the problem? uffff
 
I think my database has a problem.
I tested sports, sports2000 databases. They works fine!
I can get sequence last value.

What is the problem about my database?
 
Error:
=== SQL Exception 1 ===
SQLState=HY000
ErrorCode=-210051
[JDBC Progress Driver]:Internal error -1214 (see dsmret.h) in SQL from subsystem DSM SERVICES function dsmSeqGetID called from seq_get_seq_id on for . Save log for Progress technical support.

It seems, there is no sequence at database. (But there is)
My database has a problem I think.
 
Ok. Thanks.
Now, I have to find Service Packs.
at www.progress.com they want me to write sales number. I know only serial.
For this reason I can't download any pack from progress.com.
Could you write me email if you know where I can download service pack
 
Please enter a valid serial number and Sales Order number combination for any Progress product currently under maintenance to activate your Download Center registration. The sales order number can be found on your License Addendum (or Green Sheet) supplied to you when you ordered your most recent product.

So you should have a sales number.... Otherwise its best to contact contact progress directly on these kind of issues.

Casper
 
I got Service Pack 9.1D 009 and installed it.

My problem is solved.

Thanks everybody, specially Casper...
 
Back
Top