How do I use Sql hints in PreparedStatement?

Hi,
I am trying to use a sql query which uses Oracle hints to optimize the query. I am using the ojdbc drivers from Oracle. I am using the PreparedStatement (Java 1.4) to execute this query, but it returns an empty resultset. If I remove the hint, then the query works fine using the PreparedStatement. Does anyone know how to make sql hints work using preparedstatement. I tried it with Statement object and that works (ie. the hint works and returns rows as expected).
The query is as follows:
select /*+ ordered
use_nl(ri ma)
count(*),
ma.columnName
from table1 ri,
table2 ma
where ma.columnName2 = ri.columnName2
and ma.column3 = 1
and ri.column4 = 66
group by ma.columnName
I tried escaping the /*+ but that also didn't work. Any help would be appreciated.
Thanks in advance,
Parag

Must be an old database.
Presumably you tried it in sqlplus and it worked both ways. If not then nothing you do will make it work in java.
Other than that my quess would be that it has nothing to do with the select.
Some possibilities.
1. You are eating exceptions.
2. You are not running the code that you think you are.

Similar Messages

  • How to print Integrity sql in the preparedstatement?

    How to print Integrity sql in the preparedstatement?
    Connection conn = null;
    String sql = "select * from person where name=?";
    PreparedStatement ps = conn.prepareStatement(sql);
    ps.setObject(1, "robin");
    ps.executeQuery();
    i'm wants print Integrity sql.
    For example:select * from person where name='robin'
    How should I do?
    thanks a lot!

    PreparedStatement doesn't offer methods for that. You can write your own implementation of PreparedStatement which wraps the originating PreparedStatement and saves the set* values and writes it to the toString().
    If needed, myself I just print the sql as well as the values-being-set to the debug statement.Logger.debug(query + " " + values);

  • How can I use SQL to check if the receipt is accounted?

    Dear all:
    How can I use SQL to check if the AR receipt is accounted ? Because there is so many receipts to check, I cannot open it to see the detail one by one.
    My environment is :11.5.9
    database : Oracle 9.2.0.8

    Duplicate post.
    How can I use SQL to check if the receipt is accounted?
    Re: How can I use SQL to check if the receipt is accounted?

  • How to find using SQL query application deployed on win 7 machines with SCCM 2012 server or user installed manually.

    Hi,
    how to find using SCCM SQL query,  application deployed on win 7 machines with SCCM 2012 server or user/technician installed manually. Please let me know.

    Thanks, is it not possible via any script also?
    Like Torsten said, how can you tell the difference between CM12 installed applications and locally installed? Once you can answer that, then you can write report.
    Garth Jones | My blogs: Enhansoft and
    Old Blog site | Twitter:
    @GarthMJ

  • How do I use SQL statements to perform calculations with form fields????

    Please help!!! I don't know how to use a SQL statement within my APEX form......
    My form is below. The user will enter the values in the form. Click on Submit. Then we need to run a SQL select statement with those values.
    Our form looks like this:
    Start_Date ____________
    Per_Period ____________
    Period ____________
    [Submit Button]
    The user will enter these 3 values in the form.
    This is an example of an user providing the values:
    Start_Date 03/14/08_______
    Per_Period $200.00________
    Period 4____________
    [Submit Button]
    Then they will click the Submit Button.
    The SQL statement (BELOW) returns output based on the users selections:
    START_DATE PER_PERIOD PERIOD
    14-MAR-2008 00:00 200 Week 1 of 4
    21-MAR-2008 00:00 200 Week 2 of 4
    28-MAR-2008 00:00 200 Week 3 of 4
    04-APR-2008 00:00 200 Week 4 of 4
    Total 800
    This is the full text of the SQL that makes the output above:
    with criteria as (select to_date('03/14/08', 'mm/dd/rr') as start_date,
    4 as periods,
    'Week' as period,
    200 per_period from dual),
    periods as (select 'Week' period, 7 days, 0 months from dual
    union all select 'BiWeek', 14, 0 from dual
    union all select 'Month', 0, 1 from dual
    union all select 'ByMonth', 0, 2 from dual
    union all select 'Quarter', 0, 3 from dual
    union all select 'Year', 0 , 12 from dual
    t1 as (
    select add_months(start_date,months*(level-1))+days*(level-1) start_date,
    per_period,
    c.period||' '||level||' of '||c.periods period
    from criteria c join periods p on c.period = p.period
    connect by level <= periods)
    select case grouping(start_date)
    when 1 then 'Total'
    else to_char(start_date)
    end start_date,
    sum(per_period) per_period,
    period
    from t1
    group by rollup ((start_date, period))
    THANKS VERY MUCH!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    You're just doing a parameterized report, where the input fields are your parameters.
    Check out the Advanced Tutorial titled Parameterized Report here:
    http://download.oracle.com/docs/cd/E10513_01/doc/appdev.310/e10497/rprt_query.htm#BGBEEBJA
    Good luck,
    Stew

  • How can I use SQL TOOLKIT concurrently with Database Connectivity ?

    I have installed LabVIEW 6.1 with the Database Connectivity Toolkit and the SQL Compatibility Toolkit (e.g. _SQL folder). I am trying to make the transition from the SQL Toolkit VIs to the Database Connectivity toolkits, but for compatability with existing systems I would like to be able to run the two sets of VIs concurrently (but not in the same app).
    When I read into 6.1 a connection VI that I wrote with LabVIEW 6.0 and the SQL toolkit the connection reference type gets changed from a number to type connection (see attachments) . Does compatbility mean that my SQL toolkit VIs are converted to a form compatible with the new ADO ?
    Can I use the SQL Toolkit VIs or the Database connectivit
    y VIs in the same installation of 6.1 ?
    Can I have the SQL Toolkit VIs appear on the functions pallette and function as they did when only the SQL toolkit was installed ?
    Attachments:
    CNNCT.vi ‏20 KB
    CNNCT.vi ‏22 KB

    In response to your #2 below:
    Actually it is possible to have the old SQL Toolkit and new Database
    connectivity in the same installation of LabVIEW. I have only tried it on
    6i, but don't see why it wouldn't work on 6.1. The trick is not to install
    the SQL toolkit compatabitily VI's. The old SQL toolkit uses the Intersolve
    dll through ODBC while the new Database connectivity uses ADO so it is
    possible to use both methods not only in the same LabVIEW install, but it
    the same running application. It has been a while since I originally did
    this, so I am posting only to mention that it is possible and not exactly
    how to do it. If anyone is interested in more details just respond.
    Brian
    "Jeff B" wrote in message
    news:[email protected]...
    > First, direct answers to your direct questions:
    >
    > 1. Does compatbility mean that my SQL toolkit VIs are converted to a
    > form compatible with the new ADO ?
    >
    > Yes
    >
    > 2. Can I use the SQL Toolkit VIs or the Database connectivity VIs in
    > the same installation of 6.1 ?
    >
    > No
    >
    > 3. Can I have the SQL Toolkit VIs appear on the functions pallette
    > and function as they did when only the SQL toolkit was installed ?
    >
    > No
    >
    >
    > Now an elaboration:
    >
    > Having the old SQL Toolkit and the new Database Connectivity Toolset
    > installed on the same version of LabVIEW on the same computer is not
    > supported.
    >
    > Once you install the Database Connectivity Toolset, any VIs written
    > with the SQL Toolkit will run, but with the ADO layer, as you
    > suspected.
    >
    > Internally, the only way we can have both the SQL Toolkit and the
    > Database Connectivity Toolset installed on the same computer for
    > troubleshooting customer issues is to have them installed on different
    > versions of LabVIEW. I, for example, have LabVIEW 5.1.2, 6.0.3, and
    > 6.1 all installed on my computer, and I have the SQL Toolkit install
    > on LabVIEW 5.1.2, and the Database Connectivity Toolset installed on
    > LabVIEW 6.0.3. In this configuration I can still run SQL Toolkit VIs
    > independent of the Database Connectivity Toolset if I open and run
    > them in LabVIEW 5.1.2.

  • How can I use sql loader to load a text file into a table

    Hi, I need to load a text file that has records on lines tab delimited into a table. How would I be able to use the sql loader to do this? I am using korn shell to do this. I am very new at this...so any kind of helpful examples or documentation would be very appreciated. I would love to see some examples to help me understand if possible. I need help! Thanks alot!

    You should check out the documentation on SQL*Loader in the online Oracle document titled Utilities. Here's a link to the 9iR2 version of it: http://otn.oracle.com/docs/products/oracle9i/doc_library/release2/server.920/a96652/part2.htm#436160
    Hope this helps.

  • How to group using SQL for the required output.

    hi all,
    i'm currently using oracle 10.2.0.4.0
    create table script :
    CREATE TABLE FORTEST
    ( gpno VARCHAR2(10 BYTE),
      classnumber  VARCHAR2(10 byte),
      age_min NUMBER,
      age_max NUMBER,
      amount NUMBER)insert statement:
    insert into fortest  (GPNO,classnumber,age_min,age_max,amount) values
    ('G123' , 01,0,29,1)
    insert into fortest  (GPNO,classnumber,age_min,age_max,amount) values
    ('G123' , 01,30,35,2)
    insert into fortest  (GPNO,classnumber,age_min,age_max,amount) values
    ('G123' , 01,36,40,3)
    insert into fortest  (GPNO,classnumber,age_min,age_max,amount) values
    ('G123' , 02,0,29,1)
    insert into fortest  (GPNO,classnumber,age_min,age_max,amount) values
    ('G123' , 02,30,35,2)
    insert into fortest  (GPNO,classnumber,age_min,age_max,amount) values
    ('G123' , 02,36,40,5)
    insert into fortest  (GPNO,classnumber,age_min,age_max,amount) values
    ('G123' , 03,0,29,1)
    insert into fortest  (GPNO,classnumber,age_min,age_max,amount) values
    ('G123' , 03,30,35,2)
    insert into fortest  (GPNO,classnumber,age_min,age_max,amount) values
    ('G123' , 03,36,40,3)
    insert into fortest  (GPNO,classnumber,age_min,age_max,amount) values
    ('G124' , 01,0,29,1)
    insert into fortest  (GPNO,classnumber,age_min,age_max,amount) values
    ('G124' , 01,30,35,2)
    insert into fortest  (GPNO,classnumber,age_min,age_max,amount) values
    ('G124' , 01,36,40,3) output required:
    gpno    classnumber    age_min    age_max    amount
    G123    1,3                0        29        1
    G123    1,3                30       35        2
    G123    1,3                36       40        3
    G123    2                  0        29        1
    G123    2                  30       35        2
    G123    2                  36       40        5
    G124    1                  0        29        1
    G124    1                  30       35        2
    G124    1                  36       40        3since for gpno g123, classnumber 1 and 3, the rates are same across all age_min and age_max they need to be grouped together.
    even though gpno 123 classnumber 2 has same rates as classesnumber 1 and 3 for age bands 0 to 29 and 30 to 35,
    the rates are different for age bands 36 to 40. so it should not be grouped together. how can i do this in SQL
    any help is appreciated.
    thanks in advance.

    Hi,
    Tricky problem!
    Unfortunately, LISTAGG was only introduced in Oracle 11.2. About half of the complexity here is the string aggregation, that is, forming the list of classnumbers, such as '1,3', using only functions available in Oracle 10.2.
    Here's one solution:
    WITH     got_gpno_classnumber_cnt   AS
         SELECT     gpno, classnumber, age_min, age_max, amount
         ,     COUNT (*) OVER ( PARTITION BY  gpno
                                      ,            classnumber
                          )   AS gpno_classnumber_cnt
         FROM    fortest
    --     WHERE     ...     -- If you need any filtering, this is where it goes
    ,     pairs          AS
         SELECT    a.gpno
         ,       a.classnumber
         ,       MIN (b.classnumber)
                    OVER ( PARTITION BY  a.gpno
                              ,                    a.classnumber
                      )     AS super_classnumber
         FROM       got_gpno_classnumber_cnt  a
         JOIN       got_gpno_classnumber_cnt  b  ON   a.gpno     = b.gpno
                                      AND  a.age_min     = b.age_min
                                    AND  a.age_max     = b.age_max
                                    AND  a.amount     = b.amount
                                    AND  a.gpno_classnumber_cnt
                                            = b.gpno_classnumber_cnt
         GROUP BY  a.gpno
         ,            a.classnumber
         ,       b.classnumber
         HAVING       COUNT (*)     = MIN (a.gpno_classnumber_cnt)
    ,     got_rnk          AS
         SELECT DISTINCT     
                 gpno, classnumber, super_classnumber
         ,     DENSE_RANK () OVER ( PARTITION BY  gpno
                                   ,                    super_classnumber
                                   ORDER BY          classnumber
                           )         AS rnk
         FROM    pairs
    ,     got_classnumbers     AS
         SELECT     gpno, classnumber, super_classnumber
         ,      SUBSTR ( SYS_CONNECT_BY_PATH (classnumber, ',')
                       , 2
                     )     AS classnumbers     
         FROM     got_rnk
         WHERE     CONNECT_BY_ISLEAF = 1
         START WITH     rnk             = 1
         CONNECT BY     rnk             = PRIOR rnk + 1
              AND     gpno             = PRIOR gpno
              AND     super_classnumber  = PRIOR super_classnumber
    SELECT DISTINCT
           g.gpno
    ,       c.classnumbers
    ,       g.age_min
    ,       g.age_max
    ,       g.amount
    FROM       got_gpno_classnumber_cnt  g
    JOIN       got_classnumbers         c  ON   c.gpno        = g.gpno
                                 AND  c.classnumber  = g.classnumber
    ORDER BY  g.gpno
    ,            c.classnumbers
    ;Output (just as you requested):
    GPNO       CLASSNUMBERS       AGE_MIN    AGE_MAX     AMOUNT
    G123       1,3                      0         29          1
    G123       1,3                     30         35          2
    G123       1,3                     36         40          3
    G123       2                        0         29          1
    G123       2                       30         35          2
    G123       2                       36         40          5
    G124       1                        0         29          1
    G124       1                       30         35          2
    G124       1                       36         40          3

  • How can I use SQL to search for a pattern within a field?

    Hello, Frank, Solomon, ect
    I am now faced with this particular scenario, I've got the SQL to search through a field to find text within the field, but I have to know what it is before it can look for it.
    What I have to do is this:
    Search through a field, for a pattern, and I won't know what the data is I am looking for. Can this be done in SQL?
    For instance, Here is my SQL this far, I was helped allot in order to get to this point.
    select table_name,
           column_name,
           :search_string search_string,
           result
      from (select column_name,
                   table_name,
                   'ora:view("' || table_name || '")/ROW/' || column_name || '[ora:contains(text(),"%' || :search_string || '%") > 0]' str
              from cols
             where table_name in ('TABLE1', 'TABLE2')),
           xmltable (str columns result varchar2(10) path '.')
    When you execute the above SQL, you have to pass in a value. What I really need is to alter the above SQL, to make it search for a pattern that exist's within the text of the field itself.
    Like for instance, lets say the pattern I am looking for is this" xx-xxxxx-xxxx" and it's somewhere in a field.
    I need to alter this SQL to take this pattern and search through all the schemas and tables to look for this pattern match.
    Can be done?

    When you use something dynamically within a function or procedure, roles do not apply and privileges must be granted directly.  So, you need to grant select on dba_tab_cols directly.  If you want to do pattern matching then you should use regular expressions.  The following example grants the proper privileges and uses regexp_instr to find all values containing the pattern xxx-xxxx-xxxx, where /S is used for any non-space character.  I limited the tables in order to save time and output for the test, but you can eliminate that where clause.
    SYS@orcl> CREATE USER test IDENTIFIED BY test
      2  /
    User created.
    SYS@orcl> ALTER USER test QUOTA UNLIMITED ON USERS
      2  /
    User altered.
    SYS@orcl> GRANT CREATE SESSION, CREATE TABLE TO test
      2  /
    Grant succeeded.
    SYS@orcl> GRANT SELECT ON dba_tab_cols TO test
      2  /
    Grant succeeded.
    SYS@orcl> CONNECT test/test
    Connected.
    TEST@orcl> SET LINESIZE 90
    TEST@orcl> CREATE TABLE table1
      2    (tab1_col1  VARCHAR2(60))
      3  /
    Table created.
    TEST@orcl> INSERT ALL
      2  INTO table1 (tab1_col1) VALUES ('xxx-xxxx-xxxx')
      3  INTO table1 (tab1_col1) VALUES ('matching abc-defg-hijk data')
      4  INTO table1 (tab1_col1) VALUES ('other data')
      5  SELECT * FROM DUAL
      6  /
    3 rows created.
    TEST@orcl> CREATE TABLE table2
      2    (tab2_col2  VARCHAR2(30))
      3  /
    Table created.
    TEST@orcl> INSERT ALL
      2  INTO table2 (tab2_col2) VALUES ('this BCD-EFGH-IJKL too')
      3  INTO table2 (tab2_col2) VALUES ('something else')
      4  SELECT * FROM DUAL
      5  /
    2 rows created.
    TEST@orcl> VAR search_string VARCHAR2(24)
    TEST@orcl> EXEC :search_string := '\S\S\S-\S\S\S\S-\S\S\S\S'
    PL/SQL procedure successfully completed.
    TEST@orcl> COLUMN "Searchword"     FORMAT A24
    TEST@orcl> COLUMN "Table"     FORMAT A6
    TEST@orcl> COLUMN "Column/Value" FORMAT A50
    TEST@orcl> SELECT DISTINCT SUBSTR (:search_string, 1, 24) "Searchword",
      2               SUBSTR (table_name, 1, 14) "Table",
      3               SUBSTR (t.column_value.getstringval (), 1, 50) "Column/Value"
      4  FROM   dba_tab_cols,
      5          TABLE
      6            (XMLSEQUENCE
      7           (DBMS_XMLGEN.GETXMLTYPE
      8              ( 'SELECT ' || column_name ||
      9               ' FROM ' || table_name ||
    10               ' WHERE REGEXP_INSTR
    11                     (UPPER (' || column_name || '),''' ||
    12                  UPPER (:search_string) || ''') > 0'
    13              ).extract ('ROWSET/ROW/*'))) t
    14  WHERE  table_name IN ('TABLE1', 'TABLE2')
    15  ORDER  BY "Table"
    16  /
    Searchword               Table  Column/Value
    \S\S\S-\S\S\S\S-\S\S\S\S TABLE1 <TAB1_COL1>matching abc-defg-hijk data</TAB1_COL1>
    \S\S\S-\S\S\S\S-\S\S\S\S TABLE1 <TAB1_COL1>xxx-xxxx-xxxx</TAB1_COL1>
    \S\S\S-\S\S\S\S-\S\S\S\S TABLE2 <TAB2_COL2>this BCD-EFGH-IJKL too</TAB2_COL2>
    3 rows selected.

  • How to use SQL to display Datethat falls between the date range

    Hi,
    I'm figuring out how do i use SQL to select data
    that falls between the date range stated
    (for eg. 19/02/1955 to 19/02/2003)
    I've tried :
    sql="Select * From StudentRecords WHERE DOB BETWEEN #" jTextField21.getText() "#" +" And " +"#" +jTextField22.getText;
    Using BETWEEN statment , but Between Statement isn't doing what i want..
    even those out of range are displayed... any ideas how??
    Thank yOU in advance!

    oracle:
    sql = "Select * From StudentRecords WHERE DOB between TO_DATE('07/04/2003','dd/mm/yyyy') and TO_DATE('08/04/2003','dd/mm/yyyy')";

  • How to use Oracle Hints in OBIEE

    Hello guys
    I have a report that is running forever and I have reviewed the explain plan over and over, which makes me think that the join between these 2 tables are slowing everything down --- The fact table has 10Billion records and the Dim has 10 Millions records. Even if the report has filters on various columns of the 2 tables, it is still taking forever. The explain is showing that its doing a nested loop join of these 2 tables which takes a lot of time.
    I am thinking of using some Hint to force the query to scan the dimension table first (with the filter condition I defined, it will return 80 rows only from Dim table), and then use the result set of the scanning to go and look for matching records only in the fact table. Its should help speed up the query..
    I'd like to know what kind of hints can help with that kind of operation, also how to define these kind of hints in OBIEE. Now I know that in Physical Layers, I can include hints in physical table property, but how to determine which table (fact or dim) to embed the join hints?
    Need advice from anybody who have experience working with hints?
    Much appreciation!

    Just an update:
    I have tried a couple of join operation hints like USE_NL and USE_HASH hints, it changes the join method but didn't help with performance at all.
    The original SQL that OBIEE generates is: ----------Takes about 20 mins to return a dozen rows
    select sum(T991020.LP Amount) as c1,
    T991021.DAYOFWEEK as c2,
    T991021.PU DATES as c3
    from RD_Grant.PU_DATES T991021, Dimension -----Huge
    PU_Grant.PU_FACTS_9 T991020 FACT ----Gigantic
    where (T991020.COMPANY = T991021.COMPANY
    and T991020.DATES = T991021.DATES
    and T991020.DATES between "10/10/2009" and "31/10/2009"
    and T991021.DAYOFWEEK = 'Sunday'
    and T991021.DATES between '09/13/2009' and '11/03/2009')
    group by T991021.PU DATES, T991021.DAYOFWEEK
    Basically I am still thinking of finding a way to force the query to scan the dimension table first (with the filter condition I defined, it will return 80 rows only from Dim table), and then use the result set of the scanning to go and look for matching records only in the fact table. Its should help speed up the query..
    Any suggestions?
    Thanks
    Edited by: user7276913 on Nov 5, 2009 7:07 PM
    Edited by: user7276913 on Nov 5, 2009 7:22 PM

  • How to write SQL hints for this query?

    The query is like:
    select * from foo, t
    where foo.name in
    (select name from bar
    where id in (
    select id from car
    where date < sysdate
    and foo.a = t.b;
    I want the innermostsubquery 'select id from car ...' to be executed first, and the subquery 'select name from bar ...' to be execute second, and the outermost query 'select * from foo,t ...' to be executed the last. How can I write the Oracle sql hints to force the order?
    Thanks.

    user553560
    You might be able to create a large set of hints to force the access path you want - but unless you really know what you are doing with hints, you may find that your solution is very unstable (it might be luck rather than correctness that let's it work to start with).
    The difficulty in this query is the double layer of IN subqueries, so if you can rewrite the query, you might try manually unnesting as follows:
    select
         t1.*. t.*
    from
              select     
                   distinct t2.name
              from     t2
              where     t2.id in (
                        select     t3.id
                             from     t3
                        where     t3.dated < sysdate
         )     v,
         t1,
         t
    where
         t1.name = v.name
    and     t1.a = t.bDepending on your indexing and statistics, you may find that a simple /*+ unnest */ hint in the first subquery will be sufficient to do this for your. Again depending on the statistics you may find that you have to put extra hints into the above to make Oracle use the join method and indexes you think appropriate.
    N.B. The first step (as others have noted) is to check that your statistics are good before you start manipulating the code or using hints.
    Regards
    Jonathan Lewis
    http://jonathanlewis.wordpress.com
    http://www.jlcomp.demon.co.uk

  • How can i use one SQL statement to solve problem?

    How can i use one SQL statement to solve the question below?
    For a Table named A, there is a column named F(char type).
    Now select all the records where F like '%00' and update their F value to '%01'
    Just one SQL statement.Do not use PL/SQL block.
    How to do that?
    Thanks.

    What is the data volume for this table?
    Do you expect lots of rows to have '%00' as their value?
    Following two statements come to mind. Other experts would be able to provide better alternatives:
    If you have index on SUBSTR(f, 2):
    UPDATE A
    SET    f = SUBSTR(f,
                      1,
                      length(f) - 2) || '01'
    WHERE  substr(f,
                  -2) = '00';If most of the rows have pattern '%00':
    UPDATE A
    SET    f = SUBSTR(f,
                      1,
                      length(f) - 2) ||
               DECODE(SUBSTR(f,
                             -2),
                      '00',
                      '01',
                      SUBSTR(f,
                             -2));

  • How to load a default value in to a column when using sql loader

    Im trying to load from a flat file using sql loader.
    for 1 column i need to update using a default value
    how to go about this?

    Hi!
    try this code --
    LOAD DATA
       INFILE 'sample.dat'
       REPLACE
       INTO TABLE emp
       empno   POSITION(01:04) INTEGER EXTERNAL NULLIF empno=BLANKS,
       ename   POSITION(06:15)  CHAR,
       job         POSITION(17:25)  CHAR,
       mgr       POSITION(27:30)  INTEGER EXTERNAL NULLIF mgr=BLANKS,
       sal        POSITION(32:39)  DECIMAL EXTERNAL NULLIF sal=BLANKS,
       comm   POSITION(41:48)  DECIMAL EXTERNAL DEFAULTIF comm = 100,
       deptno  POSITION(50:51)  INTEGER EXTERNAL NULLIF deptno=BLANKS,
       hiredate POSITION(52:62) CONSTANT SYSDATE
      )-hope this will solve ur purpose.
    Regards.
    Satyaki De.

  • How to get tax break up of TDS using SQL query ?

    Hi all,
    We are developing a TDS report using SQL query
    Report will contain VendorCode,Date(ap inv date),Vendor name,
    Bill value,TDS Amount,
    Bill Value – 100.000,
    TDS (2%) - 2.000,
    TDS Surcharge(10% on TDS) - 0.2,
    TDS Cess(2%(TDS+TDS Surcharge)) - 0.044,
    TDS HeCess(1%(TDS+TDS Surcharge)) - 0.022.
    We have developed this report which displays upto
    VendorCode,Date(ap inv date),Vendor name,
    Bill value,TDS Amount.
    How to show tax break up of TDS in SQL query ?
    Thanks,
    With regards,
    Jeyakanthan.

    Hi gauraw,
    Thank for your reply.
    I modified the query , pasted the query
    as below in query generator,
    Select T0.DocNum,T0.DocDate,T0.CardCode as 'Ledger',T1.TaxbleAmnt As 'Bill value',T1.WTAmnt as 'TDSAmt',(TDSAmt * 0.1) as 'TDS_Surch',
    (((TDSAmt0.1) + TDSAmt)0.02)  as 'TDSCess',
    (((TDSAmt0.1) + TDSAmt)0.01)  as 'TDSHCess'
    FROM OPCH T0  INNER JOIN PCH5 T1 ON T0.DocEntry = T1.AbsEntry
    WHERE (T0.DocDate >= '[%0]' and T0.DocDate <= '[%1]')
    on clicking execute its showing error message invalid column
    name 'TDSAmt'.
    With regards,
    Jeyakanthan

Maybe you are looking for

  • Seq of possible taxes for country IN is limited up to 9

    Hi, We have configured the FI Tax procedure and the same condition types are using for the SD Pricing procedure. But thing is, based on our client requirements, we have created 15 condition types to arrive the accounting requirements. So, to create c

  • What exactly does "updating your ipod" mean?

    Yes... like, is it everytime you load new songs? or... what... thanks for your answers!

  • I pod nano 2nd gen is not recognised in i tunes

    when i plug my nano into my mac i tunes loads up but does notshow it in the listings

  • Where is admin config page ? ...

    Hi, I'd like to know if there is some kind of administrator's page that controls a portlet's look and feel, so that all users who access that portlet would get that same look?  If so, can you guide me how to get to there? The reason why I'm asking is

  • Windows XP Mode - 1 VM for multiple users?

    I have multiple users that use one machine (Windows 7 Professionl x64), which in turn they need to run an old application that will only run in Windows XP mode.  However, I have noticed that you have to create a machine for each individual user, as f