Query syntax check

Hello all
I wrote an query and regarding one part, i have syntax problem, when should we seperate different arithmetic operators in a query?
for example
select  density_with_desert.popp  /  density_with_desert.arr  -  sum(darea)  from counytyi don't want to use variables.
thank you im using oracle 11g.
best,david

1003209 wrote:
Hello all
I wrote an query and regarding one part, i have syntax problem, when should we seperate different arithmetic operators in a query?
for example
select  density_with_desert.popp  /  density_with_desert.arr  -  sum(darea)  from counytyi don't want to use variables.
thank you im using oracle 11g.
best,daviduse this:
select sum(density_with_desert.popp) / sum( density_with_desert.arr) - sum(darea) from counyty;
or use this:
select sum(density_with_desert.popp) / sum( density_with_desert.arr) - sum(darea) from counyty group by darea;
Edited by: Gaurav_91 on May 14, 2013 11:53 AM

Similar Messages

  • Warning in query in Extended Syntax Check

    Hi all,
    I perform Extended Syntax Check.
    It generates following warning for the query: -
    In "SELECT SINGLE....", the WHERE condition for the key field "MATNR" does not test for equality. Therefore the single record in question may not be unique.
    (You can hide the message using "#EC *)
    Please tell me what does it mean. How can I suppress this warning?
    Regards,
    Saurabh A. Buksh

    Hi,
    whenu r using select single use a variable or a workarea don't use tables.
    select single matnr from mara into v_matnr
    where matnr in s_matnr.
    also as it is warning message u can neglectit .
    when u  r using select single u should give entire key information also.
    Regards,
    Nagaraj
    Message was edited by: nagaraj kumar nishtala

  • Error in Extended syntax check- Select Query

    Hi all,
    Iam getting this following error in Extended syntax check
    " Large table PA0002: No field of a table index in WHERE
    condition"
    Code :SELECT SINGLE PERNR INTO (G_PERNR) FROM PA0002 WHERE ZZLEGACY_PAYROLL = I_FILETAB-PRNO
                                                           AND ZZLEGACY_PAYSYS = I_FILETAB-PRSYS
                                                           AND ZZLEGACY_PAYINS = I_FILETAB-PRINS.
    can anyone help on this?

    Hi,
    Change the code like this and check............
    For this u need put INSIDE LOOP.
    Select single PERNR into G_PERNR from PA0002 where PERNR = I_FILETAB-PRNO and .......... and ......
    Check like this...
    Thanks.
    If this helps you reward with points.
    Message was edited by: KDeepak
    Message was edited by: KDeepak

  • Function for syntax check on the repository objects

    Hi Experts,
         Can anyone help me in finding out the function module used to do syntax check on Repository objects(PRograms/Smartforms/FUnction Modules...etc.,)
    Regards
    Arif Shaik

    >
    a.shaik wrote:
    > I hope I have sent the query on the ABAP forum itself
    You have posted the query on SAP PI/ XI forum....ABAP forum is different: ABAP Development
    Regards,
    Abhishek.

  • Syntax check warning

    Hi All,
              I hav a small query . i m working in upgrade and in slin syntax check warning i m getting warning
    i hav a statement like   ULINE AT 0(120).
    Its giving a warning " Syntax check warning
    The static output position "0" must be positive."
    Can anyone plzz guide me regarding this,
    thanking u all.
    regards,
    sahakla

    Hi..,
    in list output..
    the list output length  will be counted in terms of characters.. the default list length is 132 characters..
    maximum no.of characters is 1023..
    the count starts from 1.
    thats it !!
    there is nothing much abt it.
    plz do remember to close the thread when ur problem is solved !! reward all helpful answers !!
    regards,
    sai ramesh

  • Extended Program Check Warning For Syntax Check

    Warning:
    Syntax Check Warning
    This Warning only Displayed in SLIN
    WHERE lgtyp IN S_LGTYP.
      Messages :
      In "SELECT SINGLE...", the where condition for the key field "LGTYP" does not test  for equality .
      There fore the single record yuor searching may not be unique.
    IF NOT S_LGTYP[] IS INITIAL.
        SELECT SINGLE * FROM T301
         WHERE lgtyp IN S_LGTYP.----
    >IT SHOWING THIS LINE
        IF SY-SUBRC NE 0.
          MESSAGE E005(Z01).
        ENDIF.
    ENDIF.

    Hi Raghu,
    When you are using SELECT SINGLE, it is always better to use EQ in the condition than IN.
    Instead of using select-options S_LGTYP, declare a parameter: P_LGTYP and if possible re-write the select query as below:
    SELECT SINGLE * FROM T301 into lv_variable
    WHERE lgtyp EQ  P_LGTYP .
    Regards
    Deepa.

  • SYNTAX-CHECK

    Hi Experts,
         How to use SYNTAX-CHECK statement with in the function module?
    Thanks,
    Vickee.

    I have no idea about this.I just want to use SYNTAX-CHECK statement to validate a dynamically generated select query.
    Code:
    APPEND 'DATA dir  TYPE trdir.' TO itab.
    APPEND 'SELECT SINGLE *' TO itab.
    APPEND 'FROM trdir' TO itab.
    APPEND 'INTO dir' TO itab.
    APPEND 'WHERE name = sy-repid.' TO itab.
    SYNTAX-CHECK FOR itab MESSAGE mess LINE lin WORD wrd.
    When I run this ,it through the following error " REPORT/PROGRAM statement missing, or program type is INCLUDE."

  • Get ALWAYS result of syntax check of sqlplus possible ?

    When I pass an sql script to sqlplus as parameter then syntax errors may occur.
    It could happen that I type e.g.
    SELECT * from mytable
    without trailing semicolon.
    In this case sqlplus stops processing and waits forever without informing the
    user about the problems.
    Can I force sqlplus to send syntax check and error results in every case back to the user ?

    Until you tell SQL*Plus that you've completed the statement by adding the semicolon, though, it has no idea when to do the syntax check. It has no idea whether you're in the middle of typing in a query that is going to span multiple lines, whether you've stopped typing to talk to someone in the hall, or whether you intended to submit a query but forgot the semicolon.
    Realistically, this is just part of debugging a script.
    Justin

  • SQL query - syntax help

    Hi All,
    I have a table that has 2 columns X, and Y.
    create table temp(
    x number(5);
    y number (5);
    );I am trying to write a query to check both columns, here is what I mean.
    SELECT CASE
                 IF X = 1 AND Y = 0 THEN 3
              IF X = 2 AND Y = 1 THEN 4
              IF X  = 4 AND Y IS NULL THEN 5
          END AS STATUS
    FROM .....temp ...etc.I know what I want but having problems with the syntax.
    Thanks in Advance for your help.
    I'm using Oracle 11g, SQL Dev 3.0

    select case when x = 1 and y = 0 then 3
                when x = 2 and y = 1 then 4
                when x = 4 and y is null then 5
                else null
            end ans
      from ...for more on the case syntax see either one of these links.
    http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14261/case_statement.htm
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/expressions004.htm

  • How to display first row value returened from a query as checked as default in a report

    How to display first row value returned from a query as checked as default in a report
    Example
    Parameter 1
    Paramerter2
    ABD
    x(checked)
    Test
    DEF
    JMG
    Mudassar

    Hi Mudassar,
    The issue is caused by the order in which the parameters appear in the report data tab can be difference between our report execution and it failing. In other words, “Parameter2” is execution before parameter “A” due to this issue. We can adjust the parameter’s
    order to solve the issue.
    If “Parameter2” is parameter “A”, we cannot use that expression. Because fields cannot be used in report parameter expression, if we want to display the first value returned from a query as default value, we have to fill the “Specify values” text box with
    the specific value in Default Values dialog box.
    Regards,
    Alisa Tang
    Alisa Tang
    TechNet Community Support

  • Ora-01704 string literal too long error  on long query syntax

    I have a query with more than 4000 characters. I can't seem to get ociparse to accept it. The bind variables are not an issue as I am not concatenating any strings to the query syntax. It is just that my query will all the columns and unions etc exceeds 4000 characters. Any way around this short of hiding it in a view ( which I have already done for other long queries ).
    System:
    PHP 4.3.10
    OCI driver
    Oracle 9i Release 2
    Thanks,
    Bryan

    Misread your post, sorry. Oracle limits literal strings to 4,000 chars. According to the documentation it's required that you use bind variables where possible to shorten literal strings below 4,000. You could also try a pl/sql block.
    The error you're getting is being returned by Oracle, not PHP. I've seen it pop up on bugtraq a couple of times for PHP, but the answer is always the same. I'm more of a programmer than a database expert, so forgive me for not having a better answer. You may want to try posting this to one of the more specific oracle forums where someone will probably have a better answer for you.
    http://www.stanford.edu/dept/itss/docs/oracle/9i/server.920/a96525/toc.htm

  • Syntax check error in the standard include

    Hi,
    I have modified one standard include using access key to insert one logic as per businness requirements.Now after inserting that code iam getting syntax error but while activating it is not showing the error and getting activated.
    The include is V05XZZMO in that i have inserted code is as follows
    FORM MOVE_USERFIELDS USING ZP.
      CASE ZP.
        WHEN 'VBRK'.
        header
        MOVE LVBRK-XXXXX TO LFAMTV-ZZXXXXX.
    *{   INSERT         GDVK934083                                        1
              MOVE LVBRK-ZUONR TO LFAMTV-ZZZUONR.
    *}   INSERT
        WHEN 'VBRP'.
        item
        MOVE LVBRP-XXXXX TO LFAMTV-ZZXXXXX.
    *{   INSERT         GDVK934083                                        2
       MOVE LVBRP-MATWA TO LFAMTV-ZZMATWA.
    *}   INSERT
      ENDCASE.
    ENDFORM.
    now it is throwing error saying that LFAMTV doesn't exist...when I double click on that it is taking me to the FM RV_INVOICE_VIEW_2 where it is defined....
    Can anyone know the reason why it is throwing the error when we go for the syntax check but when u activate the program it is getting activated.. so can this error can be neglected?
    Any help on this will be appreciated..
    Regards,
    Rohan.

    Hi,
    First comment ur code and then activate the include.
    Now put a break point in the form and then in the debug mode check the structre LFAMTV is visible or not.
    if yes then once again add ur code and then activate the whole program.
    and now once again debug it and see...., whether the values are updated to the strurure LFAMTV.
    Regards,
    Nagaraj

  • SQL Developer 1.1.0.21: Issues with Data Grid and SQL syntax checking

    In this new release of SQL Dev, when I execute a SQL in the SQL Worksheet and click in the Data Grid in the Results tab and try to navigate within a record using arrow keys, the grid cell enters into edit mode by default and so I cannot use the Left or Right arrow keys to navigate the grid. I am forced to use tab key to navigate. This is counter intuitive in my opinion.
    Is there any option to change this behavior?
    Another issue that I have come across is with SQL syntax checking. In some cases, when I press F9 to execute a SQL, it shows the SQL as executed i.e. shows something like 0.0134 seconds in the toolbar and no results displayed. In reality, the SQL had some syntax error which were NOT reported. This can be frustrating since now I have to fall back to SQL*Plus or TOAD just for syntax check.
    I like the fact that SQLDev highlights the current SQL but it would be more useful if it just indicated the first line of the current sql instead of highlighting the whole sql.
    Manish

    "In this new release of SQL Dev, when I execute a SQL in the SQL Worksheet and click in the Data Grid in the Results tab and try to navigate within a record using arrow keys, the grid cell enters into edit mode by default and so I cannot use the Left or Right arrow keys to navigate the grid. I am forced to use tab key to navigate. This is counter intuitive in my opinion."
    In the "Results" tab, Click Ctrl & Tab keys (at the same time) or with mouse click on any cell other than the first column (a sequence or rownum), you will be able to navigate using the arrow keys.
    "Another issue that I have come across is with SQL syntax checking. In some cases, when I press F9 to execute a SQL, it shows the SQL as executed i.e. shows something like 0.0134 seconds in the toolbar and no results displayed. In reality, the SQL had some syntax error which were NOT reported. This can be frustrating since now I have to fall back to SQL*Plus or TOAD just for syntax check."
    The 0.0134 seconds could be the result of the most recently executed successful statement. Check the Script Output tab for errors. Use F5 (Run Script option) instead of F9.
    "I like the fact that SQLDev highlights the current SQL but it would be more useful if it just indicated the first line of the current sql instead of highlighting the whole sql."
    On the SQL statement (or code), Right Click -> Format SQL (or press Ctrl & B), proper formatting would help.
    I use version 1.0.0.15.57 and seems to be working allright.
    - Babu Rangasamy

  • Getting Error 26 in ALE IDOC scenario .- EDI Syntax Check Error...

    Hi..
    i am working in ALE Idoc scenario...I am getting Status 3 as well as status 26 in we02 transaction in my custom IDOC scenario for outbound process..
    The error is 'EDI- SYntax Check'..
    How to remove this error..
    Pls help.

    ya, there is only one segment available in IDOC..named i.e zseg_a .
    So , error in postion is avoided..
    How to find syntax error then?

  • Syntax check for tables and function modules

    Hi,
    I am writing a program that perform syntax check on object such as executable programs , function modules and tables.
    Syntax check works fine for programs, but not for tables.
    How can I perform syntax check on my tables or structures?
    I get my data from the table TADIR. But I don't get my function modules from there. What is the table for this.
    Thanks 4 ur replies.
    Parvez

    hi
    good
    generally in sap while creating a table or structure we get the error and we solved them,but like reports during runtime it is not possible to check the syntax of a table or structure.
    thanks
    mrutyun^

Maybe you are looking for

  • Weird 23" display pattern (picture)

    Hi there, A few months ago, my 23" cinema display has developed some kind of "marble" pattern , which appears to be underneath the screen surface. I have followed numerous discussions on color consistency woes with this particular monitor, but I have

  • HT1296 How do you retrieve lost songs after sync?

    My daughter bought new songs directly for her Touch but isn't able to find them after she synced.  They were bought through itunes.  How do we get them back?

  • Where can I download oracle portal 10.1.4.2 patch

    Dear All, I have installed ORacle Portal 10.1.2.0.2 and patched with version 10.1.4. I would like to get patchset 10.1.4.2 and do the patching. Can someone point out the location from where I can download the patch set. Best Regards, Bala

  • IPhoto '08 automatically reduces file sizes

    I am using iPhoto to organize and edit my portfolio. I am preparing to print, and noticed that my edited files were reduced from 3MB to 76KB. The detail and resolution are all shot, and the prints will turn out poorly. Why are the file sizes being re

  • Acrobat 8 crashes when extracting pages

    Currently experiencing problems when trying to extract pages from PDFs in Acrobat 8 running on Mac 10.5.5. Extracts the pages but before you are able to save the wheel of death starts to spin and Acrobat freezes. Inserts, deletes etc., and saves with