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. |