Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

UDFs in SQL 7.0

Status
Not open for further replies.

BlackKnight

Programmer
Oct 18, 2000
348
US
Hi folks,

Can a user defined function written in a module be ysed in a SQL 7.0 statement? For example:

"SELECT tblA.*, GetCity(tblA.[strZip]) FROM tblA"

Thanx in advance.

Have a good one!
BK
 
No, not in v& (though you can in v2000, with some limitations).

You can, however, EXEC a stored procedure from within a SELECT.

Robert Bradley

 
Umm... Robert.. you cannot execute a proc from a select... that is to say, you cannot execute a proc and substitute it's return value as a column value in SQL Server.

Sorry...

Tom
 
Dang it, brain! In my defense, I haven't eaten in the last 11 hours.

I think what I was thinking in that organ that passes for brain tissue was that you can issue a SELECT from an EXEC (based on other threads in this forum on building dynamic selects); sometimes I think I'm dyslexic.

Robert Bradley

 
You can do an INSERT..EXEC however... a very useful thing.

That's OK Robert... we are all getting older and closer and closer to senility, alzhiemers, etc.. er.. what was I talking about? :)

Tom
 
Actually, you can use your own UDFs in SQL 7.0 but they have to use an ActiveX control. Normal, access module functions, of course, cannot sooo...to SctiveX I go! <g>
 
You can use sp_oamethod calls to Active-X components, but I strongly discourage this...

And... you still cannot call this method and have it return results into a column in a SELECT statement, which is the scope of this discussion...

Tom Davis
tdavis@sark.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top