Results 1 to 10 of 10
  1. #1
    Join Date
    Jan 2003
    Location
    The Netherlands
    Posts
    149

    Unanswered: logpath willsqlplus

    Hello,

    When I execute a script like this:
    sqlplusw.exe "sys/?@u70000dm.test.nl as sysdba" @c:\test1.sql
    I want to log to "log.txt". The directory is then the current logdirectory.

    When I execute a script like this:
    sqlplusw.exe "sys/?@u70000dm.test.nl as sysdba" @c:\test1.sql c:\test\
    I want to log to "c:\test\log.txt". The directory is then "c:\test\".

    I made test1.sql
    --------------
    SET ECHO OFF;
    SET FEEDBACK OFF;
    SET SERVEROUT ON;
    SET TERMOUT ON;
    SET DEFINE ON;
    SET VERIFY OFF;

    define mydir = &1
    spool &mydir.log.txt

    BEGIN
    DBMS_OUTPUT.PUT_LINE( 'test' );
    END;
    /

    spool OFF;
    --------------

    When I do the first command:
    sqlplusw.exe "sys/?@u70000dm.test.nl as sysdba" @c:\test1.sql
    The user has to give input. I don't want the user giving any input. How can I do this?

    greetz Coen

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Check this script and see how to apply it to your problem.

  3. #3
    Join Date
    Jan 2003
    Location
    The Netherlands
    Posts
    149

    dosbatch

    Ok,

    It nice for dos, but within my script I can't do anywthing with it.

    thanx anyway.

    greetz

  4. #4
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    What kind of a script is your script? Where did you put this (sqlplusw.exe "sys/?@u70000dm.test.nl as sysdba" @c:\test1.sql) line?

  5. #5
    Join Date
    Jan 2003
    Location
    The Netherlands
    Posts
    149

    Wink dosbatch

    in a dosbox. I need to call the script, because else we have to deliver yet another file(*.bat) to our consultants.

    greetz,

  6. #6
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Well, is it really a BIG problem to deliver a tiny .bat script if it solves the situation you're in?

  7. #7
    Join Date
    Jan 2003
    Location
    The Netherlands
    Posts
    149

    dosbatch

    But then I can also prompt the user for a logpath. Then I don't need a batch file at all.

    Anywayz, I want the nicest solution.

    greetz.

  8. #8
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Fair enough!

    Happy hunting

  9. #9
    Join Date
    May 2004
    Location
    Dominican Republic
    Posts
    721
    Why don't you just always supply the second parameter as well ? Like, if its going to be the current directory, pass null or something and do the logic within the script.

  10. #10
    Join Date
    Jan 2003
    Location
    The Netherlands
    Posts
    149

    Thumbs up old func

    old functionality is no params at end. I can say we change that. But there are always people, who run script without params afterall.
    You could say it's their problem, but I work in the interest of the company.

    greetz Coen

Posting Permissions

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