Can't perceive what's wrong with SELECT.

Hello,
I've executed this select -
select *
from tax.tax_payer@reis tp
left outer join re_right@reis r on (tp.tin = r.tin or tp.tin = r.tin_a1 or tp.tin = r.tin_a2)
where (r.right_status = -1 or r.right_status is null)
--and r.right_id is not null
and tp.je_id = 12;
As a result, I've gotten an error message -
ORA-00933: SQL command not properly ended.
It is curious, that if I remove comment from the last but one line, the select has bee succesfully done -
select *
from tax.tax_payer@reis tp
left outer join re_right@reis r on (tp.tin = r.tin or tp.tin = r.tin_a1 or tp.tin = r.tin_a2)
where (r.right_status = -1 or r.right_status is null)
and r.right_id is not null
and tp.je_id = 12;
What's wrong?
P.S. Oracle 10.2.0.1.0

Hi,
As Preta has said above, Everything seems to be correct.
Can you check like this
First run the following
select count(0)
from tax.tax_payer@reis tp
left outer join re_right@reis r on (tp.tin = r.tin or tp.tin = r.tin_a1 or tp.tin = r.tin_a2)
where (r.right_status = -1 or r.right_status is null)If ths above is ok then try
select count(0)
from tax.tax_payer@reis tp
left outer join re_right@reis r on (tp.tin = r.tin or tp.tin = r.tin_a1 or tp.tin = r.tin_a2)
where (r.right_status = -1 or r.right_status is null)
and r.right_id is not nulland then
select count(0)
from tax.tax_payer@reis tp
left outer join re_right@reis r on (tp.tin = r.tin or tp.tin = r.tin_a1 or tp.tin = r.tin_a2)
where (r.right_status = -1 or r.right_status is null)
and r.right_id is not null
and tp.je_id = 12This will tell you where you may be missing something.
Cheers!!!
Bhushan

Similar Messages

  • After upgrade my Iphone 4 to iso5, I can't add contact and I can't access the settings for mail,contacts and calender. The moment I select the setting for Mails, Contact and Calender it will jump back to home. Can someone advice what's wrong with it?

    After upgrade my Iphone 4 to iso5, I can't add contact and I can't access the settings for mail,contacts and calender. The moment I select the setting for Mails, Contact and Calender it will jump back to home. Can someone advice what's wrong with it?Problr

    Dear All
    i have done the same activity ( buy a new iphone 4 -> upgrade to ios5 - > configure email) with success-
    than when i start to move the contacts from old mobile to iphone (using the microsim) i receive the same crash
    in disgnosis e use i saw 2 dump with this title 'latestCrash-Preferences.plist and LatestCrash.plist. in each file the date is the same and i read:
    Exception Tyle: EXC_CRASH (SIGABRT)
    Exception code: 0x00000000, 0x00000000
    Chrashed Thread: 6
    in thread 6: name: Dispatch queue:
    com.apple.addressBookUI.ContactsSettingPlugin
    and thaan a lot of data.
    Have you any idea?
    thank in advance
    Fabio

  • My iPhone 4S won't turn on it's been off for two days now. I tried charging it but it makes a noise every 8 seconds,holding the buttons down and also plugging it to a computer. I need help on what to do or if anybody can tell me what's wrong with my phone

    My iPhone 4S won't turn on it's been off for two days now. I tried charging it but it makes a noise every 8 seconds,holding the buttons down and also plugging it to a computer. I need help on what to do or if anybody can tell me what's wrong with my phone

    Yes ive tried a different charger and it also nothing shows when i plug it in just makes a noise

  • HT1212 my iphone 5's screen blacks out every now and then. the phone is turned on but the screen is black and i can receive calls. what is wrong with my phone

    my iphone 5's screen blacks out every now and then. the phone is turned on but the screen is black and i can receive calls. what is wrong with my phone?

    I have to believe this has something to do with iOS 7 issues. I have taken my screen blacked out 5s twice to the Genius Bar and the found a bunch of system apps had crashed.  So if this is the case, is iOS7 the problem?

  • When on the phone to someone the phone crackles and hangs up so the other person can't hear what is wrong with it? :(

    When on the phone to someone the phone crackles and hangs up so the other person can't hear what is wrong with it? :(

    That iPhone needs to be tested by the techs at an Apple store genius bar to see what is faulty in the hardware.

  • Can you see what's wrong with my sql clause?

    Select afkogltri sum( afpowemng ) as yqty
        from   ( afpo inner join afko on afpoaufnr = afkoaufnr )
        into   ( d_gltri , d_wemng )
        where  afpo~matnr = wa_pir-matnr
               and year( afko~gltri ) = year( sy-datum )
        group by afko~gltri. 
    The above is my sql clause, when I do a syntax check, it said:"Comma without preceding colon (after SELECT ?)"
    Can you tell me what's wrong with this sql clause?
    Thank you very much!

    Hi,
    Select Bgltri sum( Awemng ) <b>as yqty</b> (????)
    into ( d_gltri , d_wemng )
    from afpo as A inner join afko as B
    on Aaufnr = Baufnr 
    where A~matnr = wa_pir-matnr
    and year( B~gltri ) = year( sy-datum )
    group by B~gltri.
    ENDSELECT.
    eg<b>:... INTO (f1, ..., fn</b>)
    Places the result set in the target area (f1, ..., fn). The fields of the result set are transported to the target fields fi from left to right. INTO (f1, ..., fn) is allowed only if a list with n elements is also specified in the SELECT clause.
    <b>If the result of a selection is a table, the data is retrieved in a processing loop introduced by SELECT and concluded by ENDSELECT. The processing passes through the loop once for each line read. If the result is a single record, the closing ENDSELECT is omitted.</b>
    Example
    Output a list of all airlines (with short description and name):
    TABLES SCARR.
    DATA:  CARRID   LIKE SCARR-CARRID,
           CARRNAME LIKE SCARR-CARRNAME,
    SELECT CARRID CARRNAME
           INTO (CARRID, CARRNAME)
           FROM SCARR.
      WRITE: / CARRID, CARRNAME.
    ENDSELECT
    Thanks & Regards,
    Judith.

  • Can anybody see what is wrong with this SQL statement?

    Hey guys, just a quick question. Can anybody tell me what is wrong with this line of SQL? I keep getting a syntax error message. I've been trying for ages and I can't see any problem at all!"
    {code}prepStat = connection.prepareStatement("INSERT INTO WeatherHistory (Date, Location, Overview, Temperature, WindDirection, WindSpeed, Pressure) VALUES ('"+date+"','"+location+"','"+temp+"','"+windDir+"','"+windSpd+"','"+pressure+"')");{code}
    All the field names and variables definitely exist so I can't see what the problem is!

    DHD wrote:
    Thanks for the replies.
    I've matched the correct number of column names and variables, but still no luck.
    And how exactly am I misusing Prepared Statements here?As noted above, not according to the code you posted. I didn't just pluck something out of my @ss and throw it out there. There was a reason behind what I said. And, if you mean you changed it, and you still got an exception, then post that exception (completely), and your new code, which is, hopefully, using PreparedStatement, (properly).

  • TS5185 iMessage does not send message, but when I turn if off, then I can text? what is wrong with my Iphone 4S?

    My Iphone 4 is not sending Imessage, but when I turn it off, I can text? What can I do to fix my phone?

    iMessage is separate from texting - SMS/MMS.
    http://support.apple.com/kb/ts2755

  • Pictrivia 6 - Can you identify what's wrong with this setup?

    What's Pictrivia?
    It's a trivia presented as a picture - more picture, less words. If you love  solving puzzles, racking your brains on brain teasers,you would love this one.
    Who can participate?
    It's open to all. You can participate on Facebook, Twitter or here. If you are subscribed to our Facebook or Twitter channels, you'll see the message posted on early Saturday mornings  pacific time.
    How often will you post a trivia?
    Once a week on Fridays.
    How do I answer?
    You  can answer by replying to this discussion. If you saw the post on our  Facebook page or Twitter, simply comment on the post or reply to our  tweet.
    What do I get?
    Intellectual stimulation, thrill and pleasure of solving a puzzle!
    What's the skill level required?
    Beginners
    When will I know the right answer?
    On the following Wednesday.

    Access layer switch will became bridge root。(default priority,lowest MAC address 1111.1111.1111)。And this L2 network will working at low efficiency。

  • Can i know what is wrong with this sql?

    i have an error of invalid character.
    SELECT SUM(counter),TO_DATE(logdatetime)
    FROM NYP_LIBPORTAL.PORTAL_HOME_NON_LOGIN_LOG
    WHERE logdatetime = logdatetime
    AND (TO_DATE(logdatetime, 'DD-MON-YYYY') BETWEEN
    TO_DATE('01-JAN-2007', 'DD-MON-YYYY') AND TO_DATE('31-JAN-2007', 'DD-MON-YYYY'))
    GROUP BY TO_DATE (logdatetime);
    May i know is there any way that i need to make the changes?

    your problem is likely to be the TO_DATE(logdatetime) - if logdatetime is a DATE datatype, then you should never, ever use TO_DATE on it.
    But I suspect this has been sorted in a later post of yours?

  • Can someone see what is wrong with this?  Im stumped

       public class Card {
         int suit;
         int value;
         static int isStraight = 0;
         static int isFlush = 0;
         static int handCounter = 0;
         static int cardCounter = 0;
         boolean inUse = false;
         public int getSuit() {
              return suit;
         public void setSuit(int suit) {
              this.suit = suit;
         public int getValue() {
              return value;
         public void setValue(int value) {
              this.value = value;
         public boolean isInUse() {
              return inUse;
         public void setInUse(boolean inUse) {
              this.inUse = inUse;
        public static int checkPairs(int[] handValues){
             for (int x = 0; x<5; x++ ){
                  for (int y = 0; y<5; y++ ){
                       if(handValues[x]==handValues[y]){
                            cardCounter ++;
                  handCounter = handCounter + (cardCounter - 1);
                   cardCounter = 0;
             System.out.println(handCounter);
             return handCounter;
        public static int checkStraight(int[] handValues){
                  if(handValues[0] == (handValues[1]-1)){
                       if (handValues[1] == (handValues[2]-1)){
                            if (handValues[2] == (handValues[3]-1)){
                                 if (handValues[3] == (handValues[4]-1)){
                                      ///System.out.println("straight");
                                          isStraight = 1;
                                      if (handValues[4] == 12){
                                            isStraight = 2;
                  return isStraight;
        public static int checkFlush(Card[]inputHand){
             if (inputHand[0].suit == inputHand[1].suit){
                  if (inputHand[1].suit == inputHand[2].suit){
                       if (inputHand[2].suit == inputHand[3].suit){
                            if (inputHand[3].suit == inputHand[4].suit){
                                 isFlush = 1;
             return isFlush;
    //handCheckerApp ,
    import tcdIO.*;
    public class handCheckerApp {
         ///these string arrays just hold the names of the values
         static String[] suitsArray = {"hearts" , "spades" , "diamonds" , "clubs" };
         static String[] valuesArray = {"two" , "three" , "four" , "five" , "six" , "seven" , "eight" , "nine" , "ten" , "jack" , "queen" , "king" ,"ace" };
         public static void main (String arguments []) {
              Terminal terminal = new Terminal();
              Card[] inputHand = new Card[5];
              Card[] deck = new Card[52];
              Card currentCard = new Card();
              for(int number = 0 ; number <= 12 ; number++){
                   deck[number]= new Card();
                   deck[number].suit = 0;
                   deck[number].value = number;
              for(int number = 13 ; number <= 25 ; number++){
                   deck[number]= new Card();
                   deck[number].suit = 1;
                   deck[number].value = (number - 13);
              for(int number = 26 ; number <= 38 ; number++){
                   deck[number]= new Card();
                   deck[number].suit = 2;
                   deck[number].value = (number - 26);
              for(int number = 39 ; number <= 51 ; number++){
                   deck[number]= new Card();
                   deck[number].suit = 3;
                   deck[number].value = (number - 39);
              terminal.println("Poker Hand Checker");
              terminal.println("~~~~~~~~~~~~~~~~~~");
              terminal.println("Suits key:..Hearts = 1");
              terminal.println("...................Spades = 2");
              terminal.println("...................Diamonds = 3");
              terminal.println("...................Clubs = 4");
              terminal.println(".............................");
              terminal.println("Values key:.Twos = 2");
              terminal.println("......................Threes = 3");
              terminal.println("......................Fours = 4");
              terminal.println("......................Fives = 5");
              terminal.println("......................Sixes = 6");
              terminal.println("......................Sevens = 7");
              terminal.println("......................Eights = 8");
              terminal.println("......................Nines = 9");
              terminal.println("......................Tens = 10");
              terminal.println("......................Jacks = 11");
              terminal.println("......................Queens = 12");
              terminal.println("......................Kings = 13");
              terminal.println("......................Aces = 14");
          ///this block of code marks cards in the deck as in use and adds them to the hand 
          for(int i = 0; i < 5; i++){///for1
              currentCard.value = (terminal.readInt("please enter card " + (i+1) + " value: " )-2);
              currentCard.suit = (terminal.readInt("please enter card " + (i+1) + " suit: " )-1);
              for (int x = 0; x< 52; x++){///for2
                   if (deck[x].value == currentCard.value){///if1
                        if (deck[x].suit == currentCard.suit){///if2
                            if (deck[x].inUse == true){///elseif1
                                 terminal.println("you chose that card already");
                                 i--;
                            }///if3
                            else if(deck[x].inUse == false){///if3
                                 deck[x].inUse = true;
                                 inputHand[i] = deck[x];
                                 terminal.println("this card is the " + valuesArray[(inputHand.value)] + " of " + suitsArray[(inputHand[i].suit )]);
                        }///elseif1
                   }///if2
              }///if1
         }///for2
         }///for1     
         int handValues[] = {inputHand[0].value, inputHand[1].value, inputHand[2].value, inputHand[3].value, inputHand[4].value};
         java.util.Arrays.sort(handValues);     
         ///this method checks for pairs, two pairs, three of a kind, full house & four of a kind
         Card.checkPairs(handValues);
         if (Card.handCounter == 2) {
                   terminal.println("You have a pair");
              if (Card.handCounter == 4) {
                   terminal.println("You have two pair");
              if (Card.handCounter == 6) {
                   terminal.println("You three of a kind");
              if (Card.handCounter == 8) {
                   terminal.println("You have a full house");
              if (Card.handCounter == 12) {
                   terminal.println("You have four of a kind");
              } else {
                   terminal.println("");
              Card.checkStraight(handValues);
              Card.checkFlush(inputHand);
                   if (Card.isStraight == 1 && Card.isFlush == 0){
                        terminal.println("You have a straight");
                   if (Card.isStraight == 1 && Card.isFlush == 1){
                        terminal.println("You have a straight flush");
                   if (Card.isStraight == 2 && Card.isFlush == 0){
                        terminal.println("You have a royal straight");
                   if (Card.isStraight == 2 && Card.isFlush == 1){
                        terminal.println("You have a royal straight flush");
                   if (Card.isStraight == 0 && Card.isFlush == 1){
                        terminal.println("You have a flush");
                   if (Card.isStraight == 0 && Card.isFlush == 0){
                        terminal.println("");
    Okay it's not recognising deck.inUse....i can't see why.
    Can someone possibly point out some suggestions. Thanks, much appreciated.

    > if (deck[x].inUse == true){///elseif1
    >
    it's giving me an error on this If else statement...
    sorry ....
    How about going the extra mile and actually posting the error message you receive rather than expecting everyone to guess? The more pertinent information you can provide, the easier it is to answer your question. And you want your question answered easily and quickly, right?
    ~

  • What is wrong with select? rownum, unique

    SELECT o FROM ( SELECT UNIQUE(OWNER) AS o, ROWNUM AS the_row_num FROM all_tables) WHERE the_row_num BETWEEN 1 and 3;
    I wanted to have unique values from owner column from 1 to 3 (there are more unique values there).

    The UNIQUE applies to the entire column list - not just owner.
    One way:
    select o
      from (select unique owner as o
              from all_tables
             order by owner)
    where rownum <= 3;If you want to get rows x to y based on some order instead of just the first three, then:
    http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:127412348064

  • TS1286 iPAD 3 Will not connect to Itunes . can not connect  What is wrong with it. Need to backup my I pad to I cloud.

    I can not backup to I cloud I tunes keeps saying can connect to Ipad.  Need to backup to I cloud.

    Backup to iCloud
    Settings>iCloud>Storage and Backup>Backup Now

  • My mac desktop computer won't turn on how can I know what's wrong with it?

    It won't make the start up noise at all. Also the screen won't light. All I hear is a click noise when I click the power button. I've tried connecting it to other power outlets yet it still won't work?

    Michelle ~ Welcome to the Support Communities. This Apple doc may help:
    Troubleshooting: My computer won't turn on
    ...Found by searching Apple's Knowledge Base HERE.

  • What's Wrong With This Script

    A couple of years ago I was using an AppleScript file (thanks to someone else's assistance) but it no longer works.
    I have an extra internal drive, that is partitioned, and used for sequential daily backups. When the computer starts up, of course all the drives mount - but I prefer that they are off the desktop until neded.
    Rather than selecting the volumes and then dragging to the Trash, I found it easier to have a script run at startup which then asks if the drives should be unmounted.
    Things were great - until I upgraded to Tiger.
    I am hoping that someone can tell me what's wrong with the script so that I can start using it again. As you can probably tell, I don't have any experience in AppleScript. At the moment the script runs - it presents the dialogue box - and then just ends after a response, but the drives do not unmount.
    The partitions on the drive are called Monday Tuesday Wednesday Thursday Saturday
    The existing script is as follows:
    on run
    display dialog "Unmount All Backup Drives?" buttons {"Yes", "No"} default button 1
    set x to button returned of result
    if x is "Yes" then tell application "Finder" to eject "Monday"
    end run

    This relates to another (current) thread in AppleScript discussions.
    Your script works with Panther as that operating system allows INTERNAL drives to be "ejected" (and, if you eject one volume on a partitioned drive, all the volumes on that drive are ejected -- this explains why ejecting "Monday" actually ejected Monday through Friday).
    With Tiger, you would find that your script works exactly as expected with EXTERNAL drives, but INTERNAL drives need a different approach.
    To get behavior exactly as you had before, try this script:
    --BEGINNING
    display dialog "Unmount All Backup Drives?" buttons {"Yes", "No"} default button 1
    set x to button returned of result
    if x is "Yes" then set driveName to "Monday"
    set driveInfo to do shell script "diskutil list | grep \"" & driveName & "\""
    set driveID to last word of driveInfo
    do shell script "diskutil unmountDisk " & driveID & ""
    --END
    For reasons that aren't entirely clear to me, this approach, while it works reliably, is very slow -- on my fast machine, the unmount process takes nearly 20 seconds. (Using UNIX directly in Terminal, with the same command, is very quick.) (In the AS, the delay occurs in second "do shell script.")
    Another puzzle that has cropped up is described in the related thread "Applescript to Mount/Unmount a Disk . . ." (current). While the above approach works for Justin Surpless, it often prompts for a password -- unacceptable in his application. I've not seen this on my PPC (and I tried 10.4.7, which he's using); his may be an Intel Mac, if that could be the difference.

Maybe you are looking for

  • Returning 2D array from a stored procedure

    hi, i'm trying to return a nested table from a procedure.can any one help me out i'm getting the fallowing error. SQL> ed Wrote file afiedt.buf 1 declare 2 TYPE data_t IS TABLE OF NUMBER 3 INDEX BY PLS_INTEGER; 4 TYPE array_t IS TABLE OF data_t 5 IND

  • Have Adobe CC Complete for Students & Teachers but apps are telling me I'm on a free subscription

    I have had problems renewing my CC subscription, for the first month of renewing I lost my promo subscription because customer care couldn't give it back after suggesting that I cancel the current subscription. For the second month, my subscription c

  • Can't see downloaded App

    Just purchased a new playbook, I decided to download a TV app. It downloaded now problem and shows up in MY World list of Apps but it doesn't show on home page, what do I need to do to fix it?

  • Problem Starting LDAP

    when I start the slapd service, I receive the following error: ld.so.1: ./ns-slapd: fatal: relocation error: file /usr/iplanet/server5/bin/msg/lib/linsuni31.so: symbol log: referenced symbol not found killed I am running Iplanet Messaging Server 5.2

  • HT5621 Apple ID and Primary Email Address

    I can't edit the 'Apple ID and Primary Email Address' section and I want to change my Apple ID name badly...