Results 1 to 7 of 7
  1. #1
    Join Date
    Aug 2013
    Posts
    7

    Unanswered: Print my name in sql

    Hi
    How to print my name in sql please help

  2. #2
    Join Date
    Mar 2007
    Posts
    623
    Hi,

    to be exact, the definition of "print" depends on the client tool you are using as "sql" is not very clear in this context.

    Anyway, this query will return one row with one column containing your dbForums user name:
    Code:
    select 'sapthagiris' my_name from dual;

  3. #3
    Join Date
    Nov 2003
    Posts
    2,933
    Provided Answers: 12
    Code:
    set serveroutput on
    /
    begin
      dbms_output.put_line('sapthagiris');
    end;
    /
    I will not read nor answer questions where the SQL code is messy and not formatted properly using [code] tags: http://www.dbforums.com/misc.php?do=bbcode#code

    Tips for good questions:

    http://tkyte.blogspot.de/2005/06/how...questions.html
    http://wiki.postgresql.org/wiki/SlowQueryQuestions
    http://catb.org/esr/faqs/smart-questions.html

  4. #4
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    Quote Originally Posted by sapthagiris View Post
    Hi
    How to print my name in sql please help
    neither SQL nor PL/SQL has a "print" statement.

    to where should the results be placed?
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  5. #5
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Code:
    SQL> var my_name varchar2(20);
    SQL> exec :my_name := 'sapthagiris';
    
    PL/SQL procedure successfully completed.
    
    SQL> print my_name
    
    MY_NAME
    --------------------------------
    sapthagiris
    
    SQL>

  6. #6
    Join Date
    Aug 2013
    Posts
    7
    Thank you...

  7. #7
    Join Date
    Feb 2012
    Posts
    44
    Quote Originally Posted by anacedent View Post
    neither SQL nor PL/SQL has a "print" statement.

    to where should the results be placed?
    in a log file? error handling?

Posting Permissions

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