Results 1 to 6 of 6
  1. #1
    Join Date
    Feb 2004
    Posts
    5

    Question Unanswered: how to get a string?

    this is a simple code.

    SET serveroutput on
    set verify off

    accept a prompt 'Please enter name:'

    declare

    aa varchar2(200) :=&a;

    begin

    dbms_output.put_line(aa);
    end;
    /

    when I type " aaa aaa mr.", I got error
    please help me~~~
    Last edited by muykc1; 02-05-04 at 15:24.

  2. #2
    Join Date
    Nov 2003
    Location
    down on the cube farm, left then right then another left
    Posts
    467
    Put single quotes around your input or easier would be single quotes around your variable
    NOTE: Please disregard the label "Senior Member".

  3. #3
    Join Date
    Nov 2003
    Location
    down on the cube farm, left then right then another left
    Posts
    467
    [intervening private messages discussion has occured]

    You said:
    ------------------------------------

    when I make this

    SET serveroutput on
    set verify off

    begin
    dbms_output.put_line('aa');
    end;
    /
    >aa ( I understand this..)
    but..

    for this cod..I tried and changed..several times..but I could not get..

    SET serveroutput on
    set verify off

    accept a prompt 'Please enter name:'

    declare

    aa varchar2(200) := &a; <------ do I need to change here..right??

    begin

    dbms_output.put_line(aa);
    end;
    /

    thanks..


    -------------------------------------
    If you had read your error message you would see that it is complaining about the very line you have indicated above. In other words 'Yes'.
    NOTE: Please disregard the label "Senior Member".

  4. #4
    Join Date
    Feb 2004
    Posts
    5

    got it.

    Originally posted by Todd Barkus
    [intervening private messages discussion has occured]

    You said:
    ------------------------------------

    when I make this

    SET serveroutput on
    set verify off

    begin
    dbms_output.put_line('aa');
    end;
    /
    >aa ( I understand this..)
    but..

    for this cod..I tried and changed..several times..but I could not get..

    SET serveroutput on
    set verify off

    accept a prompt 'Please enter name:'

    declare

    aa varchar2(200) := &a; <------ do I need to change here..right??

    begin

    dbms_output.put_line(aa);
    end;
    /

    thanks..


    -------------------------------------
    If you had read your error message you would see that it is complaining about the very line you have indicated above. In other words 'Yes'.

  5. #5
    Join Date
    Nov 2003
    Location
    down on the cube farm, left then right then another left
    Posts
    467
    There were not that many fish in the barrel. You could have just started shooting until it worked.

    Do you understand why you need the quotes?
    NOTE: Please disregard the label "Senior Member".

  6. #6
    Join Date
    Feb 2004
    Posts
    5

    Thumbs up

    Originally posted by Todd Barkus
    There were not that many fish in the barrel. You could have just started shooting until it worked.

    Do you understand why you need the quotes?
    yes. thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •