dbTalk Databases Forums  

What is dbunload view_not_found variable for?

sybase.public.sqlanywhere.general sybase.public.sqlanywhere.general


Discuss What is dbunload view_not_found variable for? in the sybase.public.sqlanywhere.general forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Breck Carter [TeamSybase]
 
Posts: n/a

Default What is dbunload view_not_found variable for? - 12-12-2003 , 06:42 AM






The 9.0.0.1235 dbunload generates a "Check View definitions" that
creates and sets a global variable called "view_not_found".

What's the story here? There are no subsequent references to that
variable, no mention in the Help or in the groups.

Breck


--
bcarter (AT) risingroad (DOT) com
Mobile and Distributed Enterprise Database Applications
www.risingroad.com

Reply With Quote
  #2  
Old   
Nick Elson
 
Posts: n/a

Default Re: What is dbunload view_not_found variable for? - 12-12-2003 , 12:39 PM






That variable has been part of the reload.sql file for some time.
I can get it to show it's face whenever I use the -j dbunload option.

If you have no views, but have specified the -j switch there will not
be any 'other' mention to it.

Errors are checked for with this block of statements

-------------------------------------------------
-- Check view definitions
-------------------------------------------------
GRANT CONNECT TO "DBA" IDENTIFIED BY ENCRYPTED 'yadayadayada'
go
CREATE VARIABLE view_not_found INT
go
if object_id('DBA.v_x') is null then
select 1 into view_not_found from "DBA"."v_x"
end if
go
if object_id('DBA.v_y') is null then
select 1 into view_not_found from "DBA"."v_y"
end if
go
commit work
go

When I have no views defined (but have specified -j) no views get enumerated
and none of the

"if object_id( <view_name> ) ... "

test blocks are built.



Are you saying ASA 9 just creates it even when there is no -j switch
invoked?

Either way I don't expect this causes any problems.


"Breck Carter [TeamSybase]" <NOSPAM__bcarter (AT) risingroad (DOT) com> wrote in
message news:ctcjtvg4pinl609cbnr0eilr8ls7s2s32o (AT) 4ax (DOT) com...
Quote:
The 9.0.0.1235 dbunload generates a "Check View definitions" that
creates and sets a global variable called "view_not_found".

What's the story here? There are no subsequent references to that
variable, no mention in the Help or in the groups.

Breck


--
bcarter (AT) risingroad (DOT) com
Mobile and Distributed Enterprise Database Applications
www.risingroad.com



Reply With Quote
  #3  
Old   
Breck Carter [TeamSybase]
 
Posts: n/a

Default Re: What is dbunload view_not_found variable for? - 12-12-2003 , 02:56 PM



No, it's generated as a byproduct of using -j nnn. My point is that
this generated code *does nothing*, it *has no purpose* whatsoever,
because it is just setting a variable that is not used anywhere. So
what is the point of it? That's my question

Breck The Suspicious

On 12 Dec 2003 10:39:10 -0800, "Nick Elson"
<no_spam_nicelson (AT) sybase (DOT) com> wrote:

Quote:
That variable has been part of the reload.sql file for some time.
I can get it to show it's face whenever I use the -j dbunload option.

If you have no views, but have specified the -j switch there will not
be any 'other' mention to it.

Errors are checked for with this block of statements

-------------------------------------------------
-- Check view definitions
-------------------------------------------------
GRANT CONNECT TO "DBA" IDENTIFIED BY ENCRYPTED 'yadayadayada'
go
CREATE VARIABLE view_not_found INT
go
if object_id('DBA.v_x') is null then
select 1 into view_not_found from "DBA"."v_x"
end if
go
if object_id('DBA.v_y') is null then
select 1 into view_not_found from "DBA"."v_y"
end if
go
commit work
go

When I have no views defined (but have specified -j) no views get enumerated
and none of the

"if object_id( <view_name> ) ... "

test blocks are built.



Are you saying ASA 9 just creates it even when there is no -j switch
invoked?

Either way I don't expect this causes any problems.


"Breck Carter [TeamSybase]" <NOSPAM__bcarter (AT) risingroad (DOT) com> wrote in
message news:ctcjtvg4pinl609cbnr0eilr8ls7s2s32o (AT) 4ax (DOT) com...
The 9.0.0.1235 dbunload generates a "Check View definitions" that
creates and sets a global variable called "view_not_found".

What's the story here? There are no subsequent references to that
variable, no mention in the Help or in the groups.

Breck


--
bcarter (AT) risingroad (DOT) com
Mobile and Distributed Enterprise Database Applications
www.risingroad.com

--
bcarter (AT) risingroad (DOT) com
Mobile and Distributed Enterprise Database Applications
www.risingroad.com


Reply With Quote
  #4  
Old   
Nick Elson
 
Posts: n/a

Default Re: What is dbunload view_not_found variable for? - 12-12-2003 , 06:20 PM



Quote:
No, it's generated as a byproduct of using -j nnn.
YES I think that is what I said.

Further it only created when nnn >= 2.

Quote:
My point is that this generated code *does nothing*, it *has no purpose*
whatsoever, because it is just setting a variable that is not used
anywhere.

It will.

Just add some views [nested or otherwise] and it obviously DOES have a
purpose! Or are you seeing a different behaviour than I?

Quote:
So what is the point of it? That's my question
Your proposition is based upon the fact that your usage is asking
for a feature you have no need for. The fact that causes no
serious failure and only puts out a harmless statement should
not be a big concern. <just my opinion/> Go ahead and
submit it as a bug if you want ... but ... I expect you are the
first person to every read the reload.sql file and felt a need
to point that out ... 1st time in probably 8+ years.

From past experience (5,6,&7) and from explicity testing 8.0.2 and 9.0
there is no new [mis-]behaviour here. This feature behaves as it
always have under the 3 states I tested

-j 0
-j 1
-j 2 [assumidly this test is sufficient for any nnn > 2 too]

and with and without views defined.



"Breck Carter [TeamSybase]" <NOSPAM__bcarter (AT) risingroad (DOT) com> wrote in
message news:ut9ktv051lei17o05cbpjr4am0jml755m7 (AT) 4ax (DOT) com...
Quote:
No, it's generated as a byproduct of using -j nnn. My point is that
this generated code *does nothing*, it *has no purpose* whatsoever,
because it is just setting a variable that is not used anywhere. So
what is the point of it? That's my question

Breck The Suspicious

On 12 Dec 2003 10:39:10 -0800, "Nick Elson"
no_spam_nicelson (AT) sybase (DOT) com> wrote:

That variable has been part of the reload.sql file for some time.
I can get it to show it's face whenever I use the -j dbunload option.

If you have no views, but have specified the -j switch there will not
be any 'other' mention to it.

Errors are checked for with this block of statements

-------------------------------------------------
-- Check view definitions
-------------------------------------------------
GRANT CONNECT TO "DBA" IDENTIFIED BY ENCRYPTED 'yadayadayada'
go
CREATE VARIABLE view_not_found INT
go
if object_id('DBA.v_x') is null then
select 1 into view_not_found from "DBA"."v_x"
end if
go
if object_id('DBA.v_y') is null then
select 1 into view_not_found from "DBA"."v_y"
end if
go
commit work
go

When I have no views defined (but have specified -j) no views get
enumerated
and none of the

"if object_id( <view_name> ) ... "

test blocks are built.



Are you saying ASA 9 just creates it even when there is no -j switch
invoked?

Either way I don't expect this causes any problems.


"Breck Carter [TeamSybase]" <NOSPAM__bcarter (AT) risingroad (DOT) com> wrote in
message news:ctcjtvg4pinl609cbnr0eilr8ls7s2s32o (AT) 4ax (DOT) com...
The 9.0.0.1235 dbunload generates a "Check View definitions" that
creates and sets a global variable called "view_not_found".

What's the story here? There are no subsequent references to that
variable, no mention in the Help or in the groups.

Breck


--
bcarter (AT) risingroad (DOT) com
Mobile and Distributed Enterprise Database Applications
www.risingroad.com


--
bcarter (AT) risingroad (DOT) com
Mobile and Distributed Enterprise Database Applications
www.risingroad.com



Reply With Quote
  #5  
Old   
Breck Carter [TeamSybase]
 
Posts: n/a

Default Re: What is dbunload view_not_found variable for? - 12-13-2003 , 07:53 AM



Chill, Nick, I didn't have a "proposition", I was asking a question

....which didn't exactly get explicitly answered, so I ran a test where
-j nnn was not set high enough to deal with the circularity, and lo
and behold, yes, the statements *do* have a purpose... they *fail* if
one of the views doesn't exist. Which is good. And stupid of me, not
to notice how the code actually *worked*

(but gosh, you have to work hard at creating views that need -j nnn,
don't you? You have to create them, and then drop and recreate them in
the reverse order so they get unloaded in the reverse order. Who
*does* that?

Unfortunately, those statements in reload.sql *ALSO FAIL* if there is
no problem with any of the views, but if there is a procedure with the
same name as a view. The call to object_id() fails with an error
message "Select returns more than one row" if you call it for a view
that has the same name as a procedure, or a trigger, all of which is
legal in SQL Anywhere but not ASE.

IMO object_id() should never ever be used, except in environments that
are truly Transact SQL compatible.

All of this came about when trying to deal with the *other* problem
with dbunload: that -j nnn does not help if a view refers to a
procedure in the FROM clause since procedures follow views in
reload.sql... that got posted in the futures ng.

Breck

On 12 Dec 2003 16:20:12 -0800, "Nick Elson"
<no_spam_nicelson (AT) sybase (DOT) com> wrote:

Quote:
No, it's generated as a byproduct of using -j nnn.

YES I think that is what I said.

Further it only created when nnn >= 2.

My point is that this generated code *does nothing*, it *has no purpose*
whatsoever, because it is just setting a variable that is not used
anywhere.

It will.

Just add some views [nested or otherwise] and it obviously DOES have a
purpose! Or are you seeing a different behaviour than I?

So what is the point of it? That's my question

Your proposition is based upon the fact that your usage is asking
for a feature you have no need for. The fact that causes no
serious failure and only puts out a harmless statement should
not be a big concern. <just my opinion/> Go ahead and
submit it as a bug if you want ... but ... I expect you are the
first person to every read the reload.sql file and felt a need
to point that out ... 1st time in probably 8+ years.

From past experience (5,6,&7) and from explicity testing 8.0.2 and 9.0
there is no new [mis-]behaviour here. This feature behaves as it
always have under the 3 states I tested

-j 0
-j 1
-j 2 [assumidly this test is sufficient for any nnn > 2 too]

and with and without views defined.



"Breck Carter [TeamSybase]" <NOSPAM__bcarter (AT) risingroad (DOT) com> wrote in
message news:ut9ktv051lei17o05cbpjr4am0jml755m7 (AT) 4ax (DOT) com...
No, it's generated as a byproduct of using -j nnn. My point is that
this generated code *does nothing*, it *has no purpose* whatsoever,
because it is just setting a variable that is not used anywhere. So
what is the point of it? That's my question

Breck The Suspicious

On 12 Dec 2003 10:39:10 -0800, "Nick Elson"
no_spam_nicelson (AT) sybase (DOT) com> wrote:

That variable has been part of the reload.sql file for some time.
I can get it to show it's face whenever I use the -j dbunload option.

If you have no views, but have specified the -j switch there will not
be any 'other' mention to it.

Errors are checked for with this block of statements

-------------------------------------------------
-- Check view definitions
-------------------------------------------------
GRANT CONNECT TO "DBA" IDENTIFIED BY ENCRYPTED 'yadayadayada'
go
CREATE VARIABLE view_not_found INT
go
if object_id('DBA.v_x') is null then
select 1 into view_not_found from "DBA"."v_x"
end if
go
if object_id('DBA.v_y') is null then
select 1 into view_not_found from "DBA"."v_y"
end if
go
commit work
go

When I have no views defined (but have specified -j) no views get
enumerated
and none of the

"if object_id( <view_name> ) ... "

test blocks are built.



Are you saying ASA 9 just creates it even when there is no -j switch
invoked?

Either way I don't expect this causes any problems.


"Breck Carter [TeamSybase]" <NOSPAM__bcarter (AT) risingroad (DOT) com> wrote in
message news:ctcjtvg4pinl609cbnr0eilr8ls7s2s32o (AT) 4ax (DOT) com...
The 9.0.0.1235 dbunload generates a "Check View definitions" that
creates and sets a global variable called "view_not_found".

What's the story here? There are no subsequent references to that
variable, no mention in the Help or in the groups.

Breck


--
bcarter (AT) risingroad (DOT) com
Mobile and Distributed Enterprise Database Applications
www.risingroad.com


--
bcarter (AT) risingroad (DOT) com
Mobile and Distributed Enterprise Database Applications
www.risingroad.com

--
bcarter (AT) risingroad (DOT) com
Mobile and Distributed Enterprise Database Applications
www.risingroad.com


Reply With Quote
  #6  
Old   
Nick Elson
 
Posts: n/a

Default Re: What is dbunload view_not_found variable for? - 12-15-2003 , 05:21 PM



Quote:
Chill, Nick . . .
My label says "Serve at room temperature" so no need to chill.

Quote:
(but gosh, you have to work hard at creating views that need -j nnn,
don't you? You have to create them, and then drop and recreate them in
the reverse order so they get unloaded in the reverse order. Who
*does* that?
Perhaps, but it can happen through normal schema maintenance.

Quote:
Unfortunately, those statements in reload.sql *ALSO FAIL* if there is
no problem with any of the views, but if there is a procedure with the
same name as a view. The call to object_id() fails with an error
message "Select returns more than one row" if you call it for a view
that has the same name as a procedure, or a trigger, all of which is
legal in SQL Anywhere but not ASE.

IMO object_id() should never ever be used, except in environments that
are truly Transact SQL compatible.
Definitely an oversight worth reporting ... The thread about circular
references should include that point too ... since anybody looking
into that will be in good position to address the non-unique name
problem too.

Quote:
All of this came about when trying to deal with the *other* problem
with dbunload: that -j nnn does not help if a view refers to a
procedure in the FROM clause since procedures follow views in
reload.sql... that got posted in the futures ng.
No -j does not address that problem the implementation never
anticipated that feature.

A simple solution to that problem is the technique of writing out
stubs ahead any possible references. Something somewhat akin to
prototypes in ANSI C ... Such a mechanism could entirely replace
all need for -j or any parsing necessary to build dependency trees.
But that would need to be taken under advisement.




"Breck Carter [TeamSybase]" <NOSPAM__bcarter (AT) risingroad (DOT) com> wrote in
message news:al4mtvosgi3ga4b6loseq3p1r44tgvdmrt (AT) 4ax (DOT) com...
Quote:
Chill, Nick, I didn't have a "proposition", I was asking a question

...which didn't exactly get explicitly answered, so I ran a test where
-j nnn was not set high enough to deal with the circularity, and lo
and behold, yes, the statements *do* have a purpose... they *fail* if
one of the views doesn't exist. Which is good. And stupid of me, not
to notice how the code actually *worked*

(but gosh, you have to work hard at creating views that need -j nnn,
don't you? You have to create them, and then drop and recreate them in
the reverse order so they get unloaded in the reverse order. Who
*does* that?

Unfortunately, those statements in reload.sql *ALSO FAIL* if there is
no problem with any of the views, but if there is a procedure with the
same name as a view. The call to object_id() fails with an error
message "Select returns more than one row" if you call it for a view
that has the same name as a procedure, or a trigger, all of which is
legal in SQL Anywhere but not ASE.

IMO object_id() should never ever be used, except in environments that
are truly Transact SQL compatible.

All of this came about when trying to deal with the *other* problem
with dbunload: that -j nnn does not help if a view refers to a
procedure in the FROM clause since procedures follow views in
reload.sql... that got posted in the futures ng.

Breck

On 12 Dec 2003 16:20:12 -0800, "Nick Elson"
no_spam_nicelson (AT) sybase (DOT) com> wrote:

No, it's generated as a byproduct of using -j nnn.

YES I think that is what I said.

Further it only created when nnn >= 2.

My point is that this generated code *does nothing*, it *has no
purpose*
whatsoever, because it is just setting a variable that is not used
anywhere.

It will.

Just add some views [nested or otherwise] and it obviously DOES have a
purpose! Or are you seeing a different behaviour than I?

So what is the point of it? That's my question

Your proposition is based upon the fact that your usage is asking
for a feature you have no need for. The fact that causes no
serious failure and only puts out a harmless statement should
not be a big concern. <just my opinion/> Go ahead and
submit it as a bug if you want ... but ... I expect you are the
first person to every read the reload.sql file and felt a need
to point that out ... 1st time in probably 8+ years.

From past experience (5,6,&7) and from explicity testing 8.0.2 and 9.0
there is no new [mis-]behaviour here. This feature behaves as it
always have under the 3 states I tested

-j 0
-j 1
-j 2 [assumidly this test is sufficient for any nnn > 2
too]

and with and without views defined.



"Breck Carter [TeamSybase]" <NOSPAM__bcarter (AT) risingroad (DOT) com> wrote in
message news:ut9ktv051lei17o05cbpjr4am0jml755m7 (AT) 4ax (DOT) com...
No, it's generated as a byproduct of using -j nnn. My point is that
this generated code *does nothing*, it *has no purpose* whatsoever,
because it is just setting a variable that is not used anywhere. So
what is the point of it? That's my question

Breck The Suspicious

On 12 Dec 2003 10:39:10 -0800, "Nick Elson"
no_spam_nicelson (AT) sybase (DOT) com> wrote:

That variable has been part of the reload.sql file for some time.
I can get it to show it's face whenever I use the -j dbunload option.

If you have no views, but have specified the -j switch there will not
be any 'other' mention to it.

Errors are checked for with this block of statements

-------------------------------------------------
-- Check view definitions
-------------------------------------------------
GRANT CONNECT TO "DBA" IDENTIFIED BY ENCRYPTED 'yadayadayada'
go
CREATE VARIABLE view_not_found INT
go
if object_id('DBA.v_x') is null then
select 1 into view_not_found from "DBA"."v_x"
end if
go
if object_id('DBA.v_y') is null then
select 1 into view_not_found from "DBA"."v_y"
end if
go
commit work
go

When I have no views defined (but have specified -j) no views get
enumerated
and none of the

"if object_id( <view_name> ) ... "

test blocks are built.



Are you saying ASA 9 just creates it even when there is no -j switch
invoked?

Either way I don't expect this causes any problems.


"Breck Carter [TeamSybase]" <NOSPAM__bcarter (AT) risingroad (DOT) com> wrote in
message news:ctcjtvg4pinl609cbnr0eilr8ls7s2s32o (AT) 4ax (DOT) com...
The 9.0.0.1235 dbunload generates a "Check View definitions" that
creates and sets a global variable called "view_not_found".

What's the story here? There are no subsequent references to that
variable, no mention in the Help or in the groups.

Breck


--
bcarter (AT) risingroad (DOT) com
Mobile and Distributed Enterprise Database Applications
www.risingroad.com


--
bcarter (AT) risingroad (DOT) com
Mobile and Distributed Enterprise Database Applications
www.risingroad.com


--
bcarter (AT) risingroad (DOT) com
Mobile and Distributed Enterprise Database Applications
www.risingroad.com



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.