Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2002
    Location
    India
    Posts
    40

    Unanswered: Probs to call two.sql files based on parameter passed ..urgent

    Hi all

    I have the following code.....

    What i want is i will pass one parameter to file , based on that
    it has to call two different files...

    If parameter is "S" then call S.sql else call D.sql....

    But when i run this , it shows me the following error...

    PLS-00103: Encountered the symbol "START" when expecting one of the following:
    begin declare exit for goto if loop mod null pragma raise
    return select update while <an identifier>
    <a double-quoted delimited-identifier> <a bind variable> <<
    close current delete fetch lock insert open rollback
    savepoint set sql execute commit forall
    <a single-quoted SQL string>

    So help me resolve this...but i have to call two files based on the parameter

    ....is there any other way to do this..please help me ASAP..as this is urgent

    ================================================
    set echo off verify ON termout ON feedback ON
    set linesize 132 newpage 0

    define mode = '&1'
    remark DEFAULT_VALUE = 'S'

    column "MODE" new_value mode format A1

    SELECT nvl('&mode','S') "MODE" FROM dual;

    BEGIN

    IF '&MODE' = 'S' then

    start E:\upload\S.sql '&MODE'

    ELSE

    start E:\upload\D.sql '&MODE'

    END IF;
    END;
    /

    ================================================

    Thanks
    Suryadevara

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    >I have the following code...
    You certainly do.
    The code appears to be a disjointed combination of SQL*Plus & PL/SQL.
    In pure SQL there is no IF .... THEN construct.
    Rhetorical question...
    What PL/SQL keyword is used to signify the start of a PL/SQL code block?
    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.

  3. #3
    Join Date
    Apr 2004
    Posts
    246
    You almost had it

    set echo off verify ON termout ON feedback ON
    set linesize 132 newpage 0

    define mode = '&1'
    remark DEFAULT_VALUE = 'S'

    column "MODE" new_value mode format A1

    SELECT nvl('&mode','S') "MODE" FROM dual;

    start E:\upload\&mode '&MODE'

Posting Permissions

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