Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2003
    Location
    Karachi, Pakistan
    Posts
    45

    Unanswered: Input in SQL from a OS command prompt

    Hi

    I have some problem to input data in sql statment without opening sql can i do this ?

    like
    $sqlplus scott/tiger @execute ( in that position can i input some values for
    inside procedure
    )
    ---execute statment consist of all the statments which use one by one and
    ---create a ouput into the text file

    if u people know, please reply me as soon as possible

    Thank You

    Noor Ali

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    First create your SQL script, such as this one:
    Code:
    REM example.sql
    
    SET TERMOUT OFF;
    SPOOL example.txt
    
    SELECT ename FROM emp
    WHERE deptno = &1
      AND sal > &2;
    
    SPOOL OFF;
    SET TERMOUT ON;
    EXIT;
    Invoke it from OS prompt using parameters for department number (10)and salary (2000):
    Code:
    OS_$ SQLPLUS -s scott/tiger @example 10 2000
    OS_$ type example.txt
    
    ENAME                                                                           
    ----------                                                                      
    CLARK                                                                           
    KING                                                                            
    DRAKE

  3. #3
    Join Date
    Dec 2003
    Location
    Karachi, Pakistan
    Posts
    45

    Thanks, It works

    Thanks it works

Posting Permissions

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