Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2005
    Posts
    7

    Unanswered: return code or condition code

    Hi,

    Is it a condition code I can check before execute the next SQL command ?

    Like, I don't want to execute select statement if "create table" fails.
    If the create table is successful, I want to run select statement and go on.

    drop table cd.zzz_newacct1 ;
    create table cd.zzz_newacct1 as (select * from cd.zzz_newacct) ;
    select * from cd.zzz_newacct1 ;
    ...

    thanks

  2. #2
    Join Date
    Feb 2005
    Location
    Germany
    Posts
    22
    Hello,
    you can do this only with pl/sql (within begin ... end ) and with an exception handler when using sqlplus. SQL has no logic suitable for this (if ... then ... else ... ).

    Or you use jdbc or so, then each statement has it's own return code.
    Greetings, Martin

  3. #3
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    RTFM
    http://download-west.oracle.com/docs...13.htm#1014742


    WHENEVER SQLERROR
    {EXIT [SUCCESS|FAILURE|WARNING|n|variable|:BindVariable]
    [COMMIT|ROLLBACK]|CONTINUE [COMMIT|ROLLBACK|NONE]}
    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.

Posting Permissions

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