oracle - SQL*Plus how to accept text variable from prompt? -


im beginner in psql , have question.

here code:

set serveroutput on accept myvariable prompt "input value: ";  begin   dbms_output.put_line('my input variable is: '||&myvariable);  end; 

question simple: how can pass text variable? if input number works correctly , can read in log number, if pass text "mytext" instead of number, got error:

    old:begin        dbms_output.put_line('my input variable is: '||&myvariable);      end;       new:begin    dbms_output.put_line('my input variable is: '||mytext);  end;      error starting @ line 5 in command:     begin       dbms_output.put_line('my input variable is: '||&myvariable);      end;     error report:     ora-06550: 2 sor, 50 oszlop:     pls-00201: identifier 'mytext' must declared     ora-06550: 2 sor, 3 oszlop:     pl/sql: statement ignored     06550. 00000 -  "line %s, column %s:\n%s"     *cause:    pl/sql compilation error.     *action: 

you have specify data type part of accept statement. if none given, assumes number.

try accept myvariable char prompt 'input value: '; instead.


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -