Advertisement

08.21.2008 at 10:10PM PDT, ID: 23669315
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.0

OUTPUT TO FILE & QUOTE COMMANDS NOT COMPILING IN SYBASE ASA 9.0

Asked by HARLIBRA in Sybase Database, PowerBuilder Programming Language

Tags: ,

Hi there. We are using sybase ASA 9.0. I am trying to compile a stored proc but getting syntax errors on two commands.

1.  OUTPUT TO 'c:\employees.txt'
2.  QUOTE ' '

The error is

[Sybase][ODBC Driver][Adaptive Server Anywhere]Syntax error near 'OUTPUT' on line 14
SQLCODE: -131
SQLSTATE: 42000

Later on I also need to pass a list of office ids as input parameter to this proc. This list if office ids will be pull from a table. The office id is of type varchar. How can I do this. this proc will be called from a  Powerbuilder 10 app. I am attaching code snippet and file both

Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
CREATE PROCEDURE "ARCS"."SP_DND_EXPORT"()
AS
BEGIN
 
  SELECT employee_id , first_name , last_name,
(IF employee.status='A' THEN 1 ELSE 2 ENDIF),
employee.emp_office_id
FROM employee, name
where (name.office_id = employee.emp_office_id)
and (name.person_id = employee.emp_person_id)
and (employee.emp_office_id in ('141','142','143','144','145','146','147','148','169','701','711','712','713','714')) --<---- parameter 1
and employee.status='A' 
and employee.last_update > '2008-06-19'   --<---------  parameter 2
OUTPUT TO 'c:\employees.txt'    --<--------- ERROR 1
QUOTE '' ;              --<------------------ ERROR 2 
SELECT client_id , replace(coalesce(first_name,'nofirstname'),'"','') , replace(last_name,'"',''),
(SELECT COALESCE(MAX(Phone_number),'') from PHONE
	WHERE (PHONE.office_id = client.cli_office_id)
	  and (PHONE.person_id = client.cli_person_id)
	  ) as phone1,
(SELECT COALESCE(Min(Phone_number),'') from PHONE
	WHERE (PHONE.office_id = client.cli_office_id)
	  and (PHONE.person_id = client.cli_person_id)
	  ) as phone2,
(SELECT '') as phone3,
  	IF (CAST((COALESCE((select max("authorization"."frequency" * (CASE "authorization"."unit"  
						WHEN 'H' THEN 2
						WHEN 'Q' THEN 4
						WHEN 'F' THEN 1
						ELSE 1 END ) * 60) 
	from "admission" LEFT OUTER JOIN "authorization" on admission.admission_id = authorization.admission_id 
	where admission.cli_office_id =  client.cli_office_id and 
		     admission.cli_person_id = client.cli_person_id  and
			 ("authorization"."begin_date" = NULL   or  "authorization"."begin_date" <= NOW() ) and
			 ("authorization"."end_date" = NULL    or "authorization"."end_date" >= NOW())), '' )) AS INTEGER)) = 0 then '' endif as maxhours,   
	8 * 60 as notificationhours,
  	(COALESCE((select max(DATEFORMAT("authorization"."begin_date",'MM/DD/YYYY')) 
	from "admission" LEFT OUTER JOIN "authorization" on admission.admission_id = authorization.admission_id 
	where admission.cli_office_id =  client.cli_office_id and 
		     admission.cli_person_id = client.cli_person_id  and
			 ("authorization"."begin_date" = NULL   or  "authorization"."begin_date" <= NOW() ) and
			 ("authorization"."end_date" = NULL    or "authorization"."end_date" >= NOW())),'01/01/2001' ))as period_start_Date,   
  	(COALESCE((select max(DATEFORMAT("authorization"."end_date",'MM/DD/YYYY') )
	from "admission" LEFT OUTER JOIN "authorization" on admission.admission_id = authorization.admission_id 
	where admission.cli_office_id =  client.cli_office_id and 
		     admission.cli_person_id = client.cli_person_id  and
			 ("authorization"."begin_date" = NULL   or  "authorization"."begin_date" <= NOW() ) and
			 ("authorization"."end_date" = NULL    or "authorization"."end_date" >= NOW())),'01/01/2016' ))as period_end_date,   
(IF client.status='A' THEN 1 ELSE 2 ENDIF) as status,
'ABC' as discipline,
'0.0' as billrate,
'0.0' as payrate,
"client"."cli_office_id" as officeid,
'960' as visitlimit
    FROM  "name" , "client" 
   WHERE ( "client"."cli_office_id" = "name"."office_id" ) and  
         ( "client"."cli_person_id" = "name"."person_id" )    
and (client.cli_office_id in ('141','142','143','144','145','146','147','148','169','701','711','712','713','714')) --<---- parameter 1
and status = 1
and client.date_added > '2008-06-19'  --<---------  parameter 2
OUTPUT TO 'C:\clients.txt'   --<--------- ERROR 1
QUOTE '';   --<------------------ ERROR 2
 
END
Attachments:
 
help me
 
 
Loading Advertisement...
 
[+][-]08.22.2008 at 08:39AM PDT, ID: 22291145

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.22.2008 at 08:45AM PDT, ID: 22291200

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.22.2008 at 10:05AM PDT, ID: 22291963

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.23.2008 at 09:41AM PDT, ID: 22297648

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.23.2008 at 11:31AM PDT, ID: 22297982

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.24.2008 at 01:29PM PDT, ID: 22301962

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.25.2008 at 12:21PM PDT, ID: 22308285

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.25.2008 at 03:10PM PDT, ID: 22309731

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.25.2008 at 06:37PM PDT, ID: 22310893

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Sybase Database, PowerBuilder Programming Language
Tags: SYBASE, SYBASE ASA 9.0
Sign Up Now!
Solution Provided By: grant300
Participating Experts: 2
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628