Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4620272
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T02:32:18+00:00 2026-05-22T02:32:18+00:00

i have to use nested if/then/else statements to check the queries obtained from oracle

  • 0

i have to use nested if/then/else statements to check the queries obtained from oracle db.
i am new to unix. from searching on google, i understand the procedure for storing sql data into variables. but when i have to use nested if statements, how can i do that?

i cannot connect to the database again and again for storing data into variables. can someone please help?

what i am writing here is teh code. excuse the wrong syntax. i am coming from coding for php

    LOGFILE = #enter path here

fetchdate = `sqlplus -s prmappo/prmappo@PRMDB << EOFSQL
select min(call_start_datetime) from error_repository;
exit;
EOFSQL`
if (( "${fetchdate:4:2}" == "02" ));
    then
    $query_1 = select * from error_repository_BKP partition(part_maxval);
    if (($query_1 == NULL));
    then
        $query_2 = "alter table error_repository_BKP
                        exchange partition part_maxval
                        with table error_repository
                        without validation;" >> $LOGFILE
    commit; 
    fi

  $query_3 = "select * from error_repository;"

Also, please tell me how do I read the SQL row data stored in the variables?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T02:32:18+00:00Added an answer on May 22, 2026 at 2:32 am

    If you want to use sqlplus for scripting, easiest is to spool the data in some separated format to a file and interpret the output from that file. You can assign the variables from the fields of the spool file.

    Unless you are manipulating OS objects, it might be smarter to code completely in pl/sql. In that case you have full control and have no problems with assignments at all. If you are only manipulating Oracle objects, try pl/sql. This is a powerful programming language. Doing so also prevents lots of extra database connections. If you use 11g, you can also manipulate OS objects by using the remote job agent.

    Use sqldeveloper to code and debug your code.download from here: Oracle SQL Developer

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a list which have divs inside it.. Now when i use nested
Can we have a nested function in C? What is the use of nested
I have nested iframes and I would like to use onload function for the
I have a container and nested viewmodels and use EditorFor to render nested viewmodels,
I have two nested loop in XSL like this, at this moment I use
If I have code with nested objects like this do I need to use
I have read several articles on when to use nested classes, but none that
I have use these code to upload two images in folder of the root
I have use semantic-analyze-proto-impl-toggle to switch between the function's proto and impl, but when
I have use include ('base.php') script in my other scripts ( more.php ). Now

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.