SSDT emits spurious SQL71502: Function: [dbo].[***] contains an unresolved reference to an object - sql

I have a number of SqlClr aggregate functions that were once in a separate project...but now with SSDT, I can have them all a single db project. Cool. All of them are in the global namespace. They compile and everything works...but I still get warnings from 4 referencing T-SQL functions in the project. The CLR function being referenced is being referenced from 7 other T-SQL functions without warnings.
I can remove the function and let the intellisense put it back in...it finds the function, too. I reference it exactly the same way everywhere its referenced:
select dbo.SomeClrAggregateFunction( a.Column )
from
dbo.SomeTable a
inner join
dbo.OtherTable b
on a.ColumnOne = b.ColumnOne
group by
b.SomeOtherColumn
Again...everything works..I can compile, deploy and test the referencing functions just fine. I just can't get rid of the warnings. I've got a thing about getting rid of warnings, but suppression seems unseemly.

Related

Kotlin "variable expected" error when doing assignment to Array element

I'm writing the following nested function where dfsVisit uses the arrays "numCaminos" and "colores" declared in the outer function
However the kotlin compiler is giving me a "variable expected" error on the assignments in lines 31 and 34 specifically, this error doesn't show up on any of the other Array assignments within the nested dfsVisit function. I tried de-nesting the functions and passing the arrays as arguments of dfsVisit but the problem persisted on those 2 assignments specifically. Why could this be happening?
I'm running the Kotlin compiler in Manjaro Linux through the repository package
Note: Sorry for using a picture instead of a code block, the post editor was giving me some formatting issues.
Just remove !! from the left side of the assignment. It doesn't really make sense there.

Distinguish two functions with the same name

I want to use multiple external CMake files in my project. Unfortunately two different files use the same CMake function name foo. I don't want to modify these external files.
Is there a way to call one specific function or will CMake error out? Would it help if one of the functions has a named parameter, i.e., foo(a b c …) and foo(DESTINATION a b c …)?
New function's definition replaces the previous one with the same name. So access to the previous function is lost.
If different functions (but with the same name) are used in different subprojects, you may try to build one subproject as ExternalProject, so function's collision wouldn't occure.
In CMake any function definitions contains the only piece of information for the caller - minimal number of parameters which should be passed to the function. By using this information it is impossible to resolve function's overloading, if it would be implemented.

Undefined symbol after removing function from source code

I've removed a function from my Objective-C source code and now the linker complains that there's an undefined symbol referenced in CacheMgrViewController.o. I've tried cleaning the project. I've tried deleting the derived data. Nothing works. What else do I need to do???
It sounds like you have deleted the definition of the C function, but you're still actually calling it from something in or included by CacheMgrViewController.m (or CacheMgrViewController.mm).
A declaration of the definition you had deleted may still exist, or you may have not seen the warning about calling an implicit function (assuming that warning is enabled).
Resolution: Just do a project search for the function name that the linker cannot find and delete any uses of the function (that was your intent by deleting it, yes?).

Linq-to-SQL cast exception with stored procedure that returns unnamed column

I don't own the SP, but it returns a dataset with columns with names like:
FileID, SomethingNormal, Foo, Bar, SUM(bleh)
SUM(bleh) is unnamed. I add the stored proc using the dbml tool in VS2010 and it detects SUM(bleh) as Column1 and gives it an int type, which sounds alright.
However, when trying to run, the moment it tries to get the IEnumerable, it breaks by giving an error:
Specified cast is not valid.
Unhandled Exception: System.InvalidCastException: Specified cast is
not valid. at System.Data.SqlClient.SqlBuffer.get_Int32() at
System.Data.SqlClient.SqlDataReader.GetInt32(Int32 i) at
Read_RejectedRecordsHourlyBySubscriptionResult(ObjectMaterializer1 )
at
System.Data.Linq.SqlClient.ObjectReaderCompiler.ObjectReader2.MoveNext()
That happens the moment I try to iterate or if I get the enumerate manually.
In a dev environment I did SUM(bleh) as TotalBleh (rest assured all this names are fake >_>) and I had no issues with what I've done.
Anything I should know? Thanks!
EDIT:
This appears to be a bug with Linq-to-SQL. Strangely, the bug report says it supports -ONE- anonymous column (although no more) and in this case there is only one.
I will do it with basic SqlCommand and stuff. So much for commodity.

In VB6, how do I call a COM object requiring a pointer to an object?

I'm having trouble with a .NET Assembly that is com visible, and calling certain methods from VB6.
What I have found is that if the parameters are well defined types, (e.g. string), calls work fine. If they are higher level objects, it raises a runtime error '438' suggesting that the property or method is not present. I suspect that this is a question of having the correct signature on the call, but I can't see how to do this correctly.
I believe that I've done everything correct on the .NET side (ComVisible, public interfaces, etc. and even have it down to a simple enough case).
Looking at the output from the typelib viewer, I have the following:
dispinterface ISimple {
properties:
methods:
[id(0x60020000)]
void Add([in] ISimpleMember* member);
[id(0x60020001)]
ISimpleMember* Create();
};
OK. So I have 2 methods in my ISimple interface. One takes an ISimpleMember (Add), whilst the other, returns an ISimpleMember.
The corresponding code in VB looks like this:
Dim item As ISimpleMember
Dim simple As simple
Set item = New SimpleMember
item.S1 = "Hello"
item.S2 = "World"
Set simple = New simple
simple.Add (item) <---- This raised the run time error 438
Set item = simple.Create <---- This works fine, returning me an ISimpleMember
I've tried a couple of things:
1. Dim item as SimpleMember (makes no difference)
2. simple.Add(ObjPtr(item)) - Syntax error
3. simple.Add(ByRef item) - Syntax error
Basically, The run time error is the same as if I had
simple.AMethodThatIHaventWritten()
Also, If I browse References in the VB6 Environment, The Add method is well defined:
Sub Add(member As SimpleMember)
I've found the answer I believe. It was very simple:
When calling a SubRoutine, I shouldn't put the name in braces. the call should have been:
simple.add member
rather than
simple.add(member)
If I change it to a function (i.e. return a value rather than void) the braces are necessary
This seems to work
(Probably) The top 3 VB6 coding mistakes made by devs who now mainly code in C#, Javascript etc. Are:-
Placing ; at the end of lines. Its a syntax error very easily spotted and picked up the compiler.
Not placing Then on the other side of an If condition expression. Again its a syntax error.
Calling a method without retrieving a value and yet using ( ) to enclose the parameter list. With multiple parameters this is a syntax error and easily found. With only one parameter the use of ( ) is interpreted as an expression. Its the result of the ( ) expression which is passed as parameter. This causes problems when ByRef is expected by the callee.