473,326 Members | 2,173 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Can anyone correct this code

Expand|Select|Wrap|Line Numbers
  1. CREATE FUNCTION FN_APPCONSULTANTS(DOCIDPATIENTVISIT VARCHAR,ADMDATE DATE,ELS NUMBERIC)
  2. RETURNS VARCHAR 
  3.  
  4. LANGUAGE SQL
  5. CONTAINS SQL
  6. BEGIN ATOMIC
  7.  
  8.  
  9. DECLARE strAPPCONSULTANTS VARCHAR(2000);
  10. DECLARE v_EMPNAME VARCHAR(100);
  11.  
  12. DECLARE GETAPPCONS CURSOR with return to client for select EMP.FIRSTNAME || ' ' || EMP.MIDDLENAME || ' ' || EMP.LASTNAME EMPNAME
  13. from nmcfo.PATIENTAPPOINTMENTS PA, nmcfo.EMPLOYEES EMP,nmcfo.PATIENTVISITS PV
  14. where PA.RESOURCECODE = EMP.EMPLOYEECODE AND PA.RESOURCEENTITYCODE = 'CONS' AND
  15. (PA.APMNTDATETIME >= ADMDATE AND PA.APMNTDATETIME <= dateadd('dd',ELS, ADMDATE)) AND
  16. PA.DOCIDPATIENTS IN
  17. (SELECT PV.DOCIDPATIENTS FROM nmcfo.PATIENTVISITS PV
  18. WHERE PV.DOCID = DOCIDPATIENTVISIT);
  19.  
  20. OPEN GETAPPCONS
  21. LOOP
  22. FETCH GETAPPCONS INTO v_EMPNAME
  23. strAPPCONSULTANTS = v_EMPNAME ||' , '|| strAPPCONSULTANTS;
  24. END LOOP;
  25. RETURN (strAPPCONSULTANTS);
  26. END
  27. !
Its showing error compound return line number 12.

Thanks in advance
Anand
Mar 25 '08 #1
0 972

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: RT | last post by:
I have followed the step by step instructions in the login manual Created login page Use LSC01 This works - login and get redirected to the proper page My problem is the cookie variables...
19
by: Leif K-Brooks | last post by:
Has anyone ever tried implementing a simple unstructured BASIC dialect in Python? I'm getting interested in language implementation, and looking at a reasonably simple example like that could be...
4
by: Chronologic | last post by:
All, I have an issue I would like some expert help on. I understand, or so I believe, that C# does not support the concept of a "compile time macro". At least not in the sense I'm looking...
33
by: O-('' Q) | last post by:
....to translate the following to C#.NET style? var i: Integer; begin txtMyIP.Lines.Clear; sHTML := HTTP.Get('http://www.network-tools.com/'); if sHTML = '' then Exit; sIpAddr := 'IP...
169
by: JohnQ | last post by:
(The "C++ Grammer" thread in comp.lang.c++.moderated prompted this post). It would be more than a little bit nice if C++ was much "cleaner" (less complex) so that it wasn't a major world wide...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.