[Info-vax] Rdb question

IanD iloveopenvms at gmail.com
Sun Jul 24 12:01:47 EDT 2022


On Saturday, July 23, 2022 at 1:46:41 AM UTC+10, Arne Vajhøj wrote:
> On 7/22/2022 3:35 AM, Jan-Erik Söderholm wrote: 
> > Den 2022-07-22 kl. 01:29, skrev Arne Vajhøj: 
> >> I am not good at Rdb. 
> >> 
> >> CONNECT TO 'ATTACH FILENAME disk4:[rdb]test' 
> >> 
> >> should connect to that database. 
> >> 
> >> But it fails with alias already in use. 
> > 
> > Yes, you probably already have an active attach 
> > which uses the "default connection", and since you 
> > did not specify a new "alias", it tried to use the 
> > same default connection.
> Yes. I just doesn't know where that connection comes from.
> >> CONNECT TO 'ATTACH ALIAS test FILENAME disk4:[rdb]test' 
> >> 
> >> works fine, but I have to prefix all table names with "test." and 
> >> I do not like that. 
> >> 
> >> What is the correct syntax for: 
> >> 
> >> CONNECT TO 'ATTACH JUSTOVERWRITETHEDEFAULTALIAS FILENAME disk4:[rdb]test' 
> > 
> > If you want a new default connection you need to DISCONNECT the open one.
> DISCONNECT did not help.
> > From where are you doing that? Rdb interactive SQL?
> Program using SQL Services.
> > Do you need multiple connections? If not, just use 
> > a default connection and only use ATTACH.
> That works! 
> 
> :-) 
> 
> Arne


I don't have access to RDB anymore so sorry if what I remember is wrong...

I think you used to be able to define a logical SQLINI that points to an initialization file where you can execute SQL commands prior to being dropped into interactive SQL. See if one exists and is pre-defining your db handle

DISCONNECT ALL; from memory is how you can disconnect from all prior attachments/aliases or perhaps DISCONNECT RDB$DBHANDLE ?

 Looks like you've solved your issue anyhow, so this post is late to the call



More information about the Info-vax mailing list