Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

adding a character into a field during query

3 posts in General Discussion Last posting was on 2011-08-24 16:04:09.0Z
Detox Posted on 2011-08-17 00:26:26.0Z
Sender: 7741.4e4af47e.1804289383@sybase.com
From: Detox
Newsgroups: ianywhere.public.general
Subject: adding a character into a field during query
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4e4b0ab2.7eb2.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 16 Aug 2011 17:26:26 -0700
X-Trace: forums-1-dub 1313540786 10.22.241.41 (16 Aug 2011 17:26:26 -0700)
X-Original-Trace: 16 Aug 2011 17:26:26 -0700, 10.22.241.41
Lines: 45
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:8145
Article PK: 7161

hello all!

First thanks to all the kind folks who have helped me with
other issues. I really appreciate it!

Now on to my situation,,,,

I need to add a pipe | into a field during export to be used
as a variable in another system.

I currently export into a csv file. The query I use is:


BEGIN
UNLOAD
SELECT phone_home_client, creationdate, appt_time,
staff_email, crecordnumber,appt_type, appt_agency
FROM outcomes WHERE phone_opt_in = 'Yes' AND
DATE(creationdate) = DATE(DATEADD(day, 2,NOW()))
TO '/srv/phonedialer_out/phase2sys1.csv';
END


The end result needs to be in part,,,,
stuff before,'|crecordnumber-appt_type', stuff after

This will allow for an email response subject line to show
the crecordnumber and type of appointment:

Fm: auto-response-frm-dialer
to: email address frm csv export
subj: crecordnumber-referral

txt: blah blah

This will allow the staff to know what type of appointment
was being reminded of. The developer states he needs a pipe
before the crecordnumber to allow for a variable amount of
intigers such as referral, office, etc.

So, I need to add a pipe | into the export and be able to
combine crecordnumber and appt_type into one field. I think
I can join them with a concatation, but am lost after that.

Any ideas will be greatly appreciated


David DeHaan [Sybase iAnywhere] Posted on 2011-08-18 14:34:48.0Z
From: "David DeHaan [Sybase iAnywhere]" <ddehaan_at_sybase_dot_com>
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:5.0) Gecko/20110624 Thunderbird/5.0
MIME-Version: 1.0
Newsgroups: ianywhere.public.general
Subject: Re: adding a character into a field during query
References: <4e4b0ab2.7eb2.1681692777@sybase.com>
In-Reply-To: <4e4b0ab2.7eb2.1681692777@sybase.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4e4d2308@forums-1-dub>
Date: 18 Aug 2011 07:34:48 -0700
X-Trace: forums-1-dub 1313678088 10.22.241.152 (18 Aug 2011 07:34:48 -0700)
X-Original-Trace: 18 Aug 2011 07:34:48 -0700, vip152.sybase.com
Lines: 52
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:8146
Article PK: 7165

I think you want the following expression in the select list:

STRING('|',crecordnumber,'-',appt_type)

On 8/16/2011 8:26 PM, Detox wrote:
> hello all!
>
> First thanks to all the kind folks who have helped me with
> other issues. I really appreciate it!
>
> Now on to my situation,,,,
>
> I need to add a pipe | into a field during export to be used
> as a variable in another system.
>
> I currently export into a csv file. The query I use is:
>
>
> BEGIN
> UNLOAD
> SELECT phone_home_client, creationdate, appt_time,
> staff_email, crecordnumber,appt_type, appt_agency
> FROM outcomes WHERE phone_opt_in = 'Yes' AND
> DATE(creationdate) = DATE(DATEADD(day, 2,NOW()))
> TO '/srv/phonedialer_out/phase2sys1.csv';
> END
>
>
> The end result needs to be in part,,,,
> stuff before,'|crecordnumber-appt_type', stuff after
>
> This will allow for an email response subject line to show
> the crecordnumber and type of appointment:
>
> Fm: auto-response-frm-dialer
> to: email address frm csv export
> subj: crecordnumber-referral
>
> txt: blah blah
>
> This will allow the staff to know what type of appointment
> was being reminded of. The developer states he needs a pipe
> before the crecordnumber to allow for a variable amount of
> intigers such as referral, office, etc.
>
> So, I need to add a pipe | into the export and be able to
> combine crecordnumber and appt_type into one field. I think
> I can join them with a concatation, but am lost after that.
>
> Any ideas will be greatly appreciated


Detox Posted on 2011-08-24 16:04:09.0Z
Sender: 6dd2.4e551f58.1804289383@sybase.com
From: Detox
Newsgroups: ianywhere.public.general
Subject: Re: adding a character into a field during query
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4e5520f9.6e13.1681692777@sybase.com>
References: <4e4d2308@forums-1-dub>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 24 Aug 2011 09:04:09 -0700
X-Trace: forums-1-dub 1314201849 10.22.241.41 (24 Aug 2011 09:04:09 -0700)
X-Original-Trace: 24 Aug 2011 09:04:09 -0700, 10.22.241.41
Lines: 69
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:8149
Article PK: 7170

Thanks for the help! However, I am confused on how exactly
to put it.

Is this how to enter so the data is exported in exact order?

> > UNLOAD
> > SELECT phone_home_client, creationdate, appt_time,
> > staff_email, crecordnumber

STRING('|',crecordnumber,'-',appt_type),
appt_type, appt_agency
> > FROM outcomes WHERE phone_opt_in = 'Yes' AND
> > DATE(creationdate) = DATE(DATEADD(day, 2,NOW()))
> > TO '/srv/phonedialer_out/phase2sys1.csv';
> > END

> I think you want the following expression in the select
> list:
>
> STRING('|',crecordnumber,'-',appt_type)
>
>
> On 8/16/2011 8:26 PM, Detox wrote:
> > hello all!
> >
> > First thanks to all the kind folks who have helped me
> > with other issues. I really appreciate it!
> >
> > Now on to my situation,,,,
> >
> > I need to add a pipe | into a field during export to be
> > used as a variable in another system.
> >
> > I currently export into a csv file. The query I use is:
> >
> >
> > BEGIN
> > UNLOAD
> > SELECT phone_home_client, creationdate, appt_time,
> > staff_email, crecordnumber,appt_type, appt_agency
> > FROM outcomes WHERE phone_opt_in = 'Yes' AND
> > DATE(creationdate) = DATE(DATEADD(day, 2,NOW()))
> > TO '/srv/phonedialer_out/phase2sys1.csv';
> > END
> >
> >
> > The end result needs to be in part,,,,
> > stuff before,'|crecordnumber-appt_type', stuff after
> >
> > This will allow for an email response subject line to
> > show the crecordnumber and type of appointment:
> >
> > Fm: auto-response-frm-dialer
> > to: email address frm csv export
> > subj: crecordnumber-referral
> >
> > txt: blah blah
> >
> > This will allow the staff to know what type of
> > appointment was being reminded of. The developer states
> > he needs a pipe before the crecordnumber to allow for a
> > variable amount of intigers such as referral, office,
> etc. >
> > So, I need to add a pipe | into the export and be able
> > to combine crecordnumber and appt_type into one field.
> > I think I can join them with a concatation, but am lost
> after that. >
> > Any ideas will be greatly appreciated
>