Re: PL/SQL character Array

From: Steve Cosner <stevec_at_zimmer.csufresno.edu>
Date: 2 Dec 1998 17:03:37 GMT
Message-ID: <743rt9$214$1_at_nntp.csufresno.edu>


In article <36656223.76D7_at_med.pitt.edu>, Joe Condle <condle_at_med.pitt.edu> wrote:
>How can I access individual postions in a string variable in PL/SQL?
>In C I would just declare a char string[10}. If I wanted to put the
>letter J in the third postion I would just do string[3] = "J".
>Is there a way to do this in PL/SQL? I have to build a Y/N string based
>on which values are fetched from the database.

In PL/SQL:
  mystring := substr(mystring,1,2)||'J'||substr(mystring,4);

HTH
Steve Cosner
http://members.aol.com/stevec5088

>Example
> If ATTEND is fetched then a Y goes into the first postion if not N. If
>REFER is fetched then Y goes into the third position and so on. I end
>up witha string YNYYY. I would like to build a procedure that looks at
>the value checks in against the the 5 choices and return a Y or N and
>places it in the right position of my string.
> Any suggestions?
>
>-Joe
Received on Wed Dec 02 1998 - 18:03:37 CET

Original text of this message