dbTalk Databases Forums  

SQL Any 12 and function calls as part of a Select

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


Discuss SQL Any 12 and function calls as part of a Select in the sybase.public.sqlanywhere.general forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Rick
 
Posts: n/a

Default SQL Any 12 and function calls as part of a Select - 08-31-2010 , 04:52 PM






This statement worked in SQL Any 10:

Select afn_getmysiteid(), in_isbn, current timestamp from inventory_tb
where in_isbn is not null and in_isbn not in (Select c_isbn from
prx_isbn_in_use_tb)

in SQL Any 12, this statement returns an error: "Column site_id not
found" -- which would be a problem, because the column exists in all
the tables referenced. You'd think I'd get a correlation error
instead!

After playing around with the statement in iSQL, I found that if I
separated the Select and the sub-select, both queries would run
without error.

After much ado and consternation because I thought it had to do with
my proxy table, I finally eliminated the call to my function and the
query worked.

I also changed my query to replace the function call with the same sql
that the function returned:

Select (select site_id from site_tb where site_this_is_me = 1),
in_isbn, current timestamp from inventory_tb where in_isbn is not null
and in_isbn not in (Select c_isbn from prx_isbn_in_use_tb)

.... And that worked too.

Is there something I'm missing? Did some behavior get changed? Is
something broken in SQL Any 12?

Any clues would be great.
Thanks,
Rick.

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.