Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Error while executing User defined function

Author  Topic 

veparala
Starting Member

30 Posts

Posted - 2008-06-17 : 08:56:34
Hi

I have written following function in sql server 2005. I am trying to execite this function using the following command. But it is giving error 'Invalid SQL statement'. Please let me know any syntaxt error in the command?

EXECUTE CheckABI( 'CONTACTMRG', 'NULL', '110371820');



CREATE OR REPLACE FUNCTION "DWADTEST"."CheckABI" ( columnname IN VARCHAR2, columnvalue IN VARCHAR2, ABINumber IN VARCHAR2)

RETURN VARCHAR2

IS

return_value VARCHAR2 (25) := NULL;
tablevalue VARCHAR2 (25) := NULL;

BEGIN

SELECT columnname INTO tablevalue FROM D_BUSI_DEMOG WHERE ABINUM = ABINumber;

IF
columnvalue = NULL
THEN
return_value := tablevalue;
ELSE

return_value := columnvalue;
END IF;

RETURN return_value;

END;

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-06-17 : 09:13:31
You need to use

SELECT dbo.CheckABI( 'CONTACTMRG', 'NULL', '110371820');


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-06-17 : 09:16:58
Are you sure you are using SQL Server 2005?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

veparala
Starting Member

30 Posts

Posted - 2008-06-17 : 09:20:18
sORRY, I AM USING ORACLE
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-06-17 : 09:30:51
quote:
Originally posted by veparala

sORRY, I AM USING ORACLE

Then post your question at Oracle Forums

www.Orafaq.com
www.dbforums.com

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -