Problem with DECODE statement while migrating forms to 6i

Hi,
I'm migrating a form from 5 to 6i. When I compiled the form, I got this error witha decode statement.
The error is
Error 307 at line 15 column 7
too many declarations of "DECODE" match this call
The trigger has this code:
IF :PRUN_RECS_INSERTED = 'Y' THEN
      RETURN ;
   END IF ;
   INSERT INTO GJBPRUN
    ( GJBPRUN_JOB,
      GJBPRUN_ONE_UP_NO,
      GJBPRUN_NUMBER,
      GJBPRUN_ACTIVITY_DATE,
      GJBPRUN_VALUE )
   SELECT :KEYBLCK_JOB,
          :ONE_UP_NO,
           GJBPDFT_NUMBER,
           SYSDATE,
      DECODE(GJBPDFT_VALUE, 'SYSDATE',
                      DECODE(GJBPDEF_LENGTH,'11',TO_CHAR(SYSDATE,'DD-MON-YYYY'), SYSDATE),
                      GJBPDFT_VALUE)
   FROM   GJBPDFT G, GJBPDEFEdited by: Charan on Mar 16, 2011 9:15 AM

Hi Charan
i think it's all about using both CHARACTER and DATE values at the same time in a DECODE statment u should either use char or date datatype.
DECODE compares expr to each search value one by one. If expr is equal to a search, then Oracle Database returns the corresponding result. If no match is found, then Oracle returns default. If default is omitted, then Oracle returns null.
e.g.
If expr and search are character data, then Oracle compares them using nonpadded comparison semantics.
expr, search, and result can be any of the datatypes CHAR, VARCHAR2, NCHAR, or NVARCHAR2.
The string returned is of VARCHAR2 datatype and is in the same character set as the first result parameter.
for more pls have a look here
Hope this helps,
Regards,
Abdetu...

Similar Messages

  • Problem With the Triggers while migrating Forms from 5 to 6i

    When I open the version 5 fmb file in Forms 6i, some of the triggers in the form level triggers and also in data block, are having red arrow marked on them and they seem to have no code in them. So when i compile the form then those triggers are shown as errors and when I close those triggers, they are deleting.
    The error looks like this..
    Error 103 at line 2, column 1
    Encountered the symbol "END" when expecting one of the following:
    begin case declare end exception exit for goto if loop mod null pragma raise
    return select update while with <an identifier>
    <a double-quoted delimited-identifier> <a bind variable> <<
    close current delete fetch lock insert open rollback
    savepoint set sql commit <a single-quoted SQL string>
    And finally the form will compile with out any errors. But when I run the form getting error again saying,
    FRM 10221: Cannot read file

    Hi,
    the forms migration assistant tells you about v2 styles triggers (even if they are not migrated ; ) )
    take a look at :
    [url http://download.oracle.com/docs/cd/E15523_01/doc.1111/e10394/migtool.htm#i100490]Using the Oracle Forms Migration Assistant
    Raises a warning in the Form module's log if V2-style triggers are found.
    There is also a point you must look at.
    In a former project I made a migration from forms 4.5 to 10g and there was foms-level triggers applied at let say the block level or item level (I cant remember exactly) and this is not permitted anymore in 10g.
    Again the forms migration assistant Provides warnings about triggers defined at incorrect levels.
    Hope this helps
    Regards,
    Jean-Yves
    Edited by: JeanYves Bernier on Mar 10, 2011 9:10 PM

  • Problem with Decode statement

    Hi
    I am trying to achieve the following in my report:
    If an employee has a surname of . (dot) or a first name of . (dot), the report should not display a dot. An employee's name is made up of surname, first name and middle name which should all be concatenated together. To try to achieve this, I have the following statement in my report:
    decode(e.Surname, '.', ( LTRIM(RTRIM((INITCAP(e.FIRST_NAME)))||' '||INITCAP(e.MIDDLE_NAME)) ) ,
    e.FIRST_NAME, '.', ( LTRIM(RTRIM((INITCAP(e.Surname)))||' '||INITCAP(e.MIDDLE_NAME)) ) ,
    ( LTRIM(RTRIM((INITCAP(e.SURNAME )))||', '||INITCAP(e.FIRST_NAME)||' '||INITCAP(e.MIDDLE_NAME)) ) ) as emp_name
    FROM Employee e
    Problem: The above statement is only working for those employees with surname of . (dot). It's not working for first names of dot. How can I use the decode statement OR is there any other way of doing it without using the CASE statement?
    It seems my decode statement doesn't work with 2 different fields (surname, firstname) being tested within one decode statement.Thanks.

    Thank you so much InoL . I have used the ltrim with Replace but now have a new problem.
    Because I am joining Surname, First name and middle name together and put a comma after the Surname, the name now appears as follows:
    , Maria Ane (if Surname is a dot)
    Boiler, (if first name is a dot)
    I would like to get rid of a comma and only have comma when surname or first name does not have a dot, i.e. for those people with full names e.g. Blake, Anna Marie.
    InoL, how can I achieve this? Thanks.

  • Problem with sql statement after migration

    Hi, recently I copied a production database X to a remote location, to serve as a test upgrade database. Original is 32 bit and test database is 64 bit. After migration it turned out that one sql statement consumed much more CPU during EXECUTE phase than on production database. Explain plans are the same. Why CPU is different? How can I trace the problem?
    ORIGINAL SERVER TKPROF OUTPUT:
    call count cpu elapsed disk query current rows
    Parse 1 0.12 0.33 0 0 2 0
    Execute 1 542.60 2165.29 2 6 0 0
    Fetch 0 0.00 0.00 0 0 0 0
    total 2 542.73 2165.62 2 6 2 0
    Misses in library cache during parse: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 66 (SPB)
    Rows     Row Source Operation
          0  SORT UNIQUE (cr=6 pr=2 pw=0 time=719909655 us)
          0   FILTER  (cr=6 pr=2 pw=0 time=719909615 us)
          2    NESTED LOOPS  (cr=0 pr=0 pw=0 time=719895787 us)
          2     HASH JOIN  (cr=0 pr=0 pw=0 time=719881575 us)
          2      NESTED LOOPS  (cr=0 pr=0 pw=0 time=1210563833 us)
          2       NESTED LOOPS  (cr=0 pr=0 pw=0 time=1210549798 us)
          2        NESTED LOOPS  (cr=0 pr=0 pw=0 time=1210519159 us)
    330261         REMOTE  TWFLPROCESSINSTANCES (cr=0 pr=0 pw=0 time=29176788 us)
          2         REMOTE  TAMCONTRACTEDITEMD (cr=0 pr=0 pw=0 time=1177866001 us)
          2        REMOTE  TAMPROPVALUES (cr=0 pr=0 pw=0 time=30580 us)
          2       REMOTE  TREPVALUELISTITEMS (cr=0 pr=0 pw=0 time=13973 us)
    24542745      REMOTE  TAMCONTRACTEDITEMD (cr=0 pr=0 pw=0 time=638116004 us)
          2     REMOTE  TWFLPROCESSINSTANCES (cr=0 pr=0 pw=0 time=14154 us)
          2    INDEX RANGE SCAN IDX_PROCES_ID (cr=6 pr=2 pw=0 time=13706 us)(object id 546934)
    Rows     Execution Plan
          0  INSERT STATEMENT   MODE: ALL_ROWS
          0   SORT (UNIQUE)
          0    FILTER
          2     NESTED LOOPS
          2      HASH JOIN
          2       NESTED LOOPS
          2        NESTED LOOPS
          2         NESTED LOOPS
    330261          REMOTE OF 'TWFLPROCESSINSTANCES' (REMOTE)
                         [T6STDBY.WR]
                        SELECT /*+ OPAQUE_TRANSFORM */ "ID","STATUS","STARTDATE"
                        FROM "DIALOG6"."TWFLPROCESSINSTANCES" "PI" WHERE
                          "STATUS"<>'A' AND "STATUS"<>'N' AND "STARTDATE">=:1-30
          2          REMOTE OF 'TAMCONTRACTEDITEMD' (REMOTE)
                         [T6STDBY.WR]
                        SELECT /*+ OPAQUE_TRANSFORM */ "CITEM_ID","ROOTCITEM_ID",
                        "PRODUCT_ID","CONTRACT_ID" FROM
                        "DIALOG6"."TAMCONTRACTEDITEMD" "CI" WHERE "PRODUCT_ID"=
                          934 AND "CONTRACT_ID"=:1
          2         REMOTE OF 'TAMPROPVALUES' (REMOTE) [T6STDBY.WR]
                       SELECT /*+ OPAQUE_TRANSFORM */ "PROPERTY_ID",
                       "VALUEOBJECT_ID","CONTRACTEDITEM_ID","DTO","ISVALID"
                       FROM "DIALOG6"."TAMPROPVALUES" "TV" WHERE "DTO" IS NULL
                       AND "ISVALID"='Y' AND "CONTRACTEDITEM_ID"=:1 AND
                         "PROPERTY_ID"=930326
          2        REMOTE OF 'TREPVALUELISTITEMS' (REMOTE) [T6STDBY.WR]
                      SELECT /*+ OPAQUE_TRANSFORM */ "ID","NAME" FROM
                        "DIALOG6"."TREPVALUELISTITEMS" "TVL" WHERE "ID"=:1
    24542745       REMOTE OF 'TAMCONTRACTEDITEMD' (REMOTE) [T6STDBY.WR]
                     SELECT /*+ OPAQUE_TRANSFORM */ "CITEM_ID","CONTRACT_ID" FROM
                       "DIALOG6"."TAMCONTRACTEDITEMD" "CINAD"
          2      REMOTE OF 'TWFLPROCESSINSTANCES' (REMOTE) [T6STDBY.WR]
                    SELECT /*+ OPAQUE_TRANSFORM */ "ID" FROM
                    "DIALOG6"."TWFLPROCESSINSTANCES" "SYS_ALIAS_1" WHERE "ID"=
                      :1
          2     INDEX   MODE: ANALYZED (RANGE SCAN) OF 'IDX_PROCES_ID'
                    (INDEX)
    REMOTE SERVER TKPROF OUTPUT:
    call count cpu elapsed disk query current rows
    Parse 1 0.15 0.15 0 0 2 0
    Execute      1   1210.69    3831.70          0          6          0           0
    Fetch 0 0.00 0.00 0 0 0 0
    total 2 1210.85 3831.85 0 6 2 0
    Misses in library cache during parse: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 66 (SPB)
    Rows     Row Source Operation
          0  SORT UNIQUE (cr=6 pr=0 pw=0 time=681448432 us)
          0   FILTER  (cr=6 pr=0 pw=0 time=681448397 us)
          2    NESTED LOOPS  (cr=0 pr=0 pw=0 time=681448144 us)
          2     HASH JOIN  (cr=0 pr=0 pw=0 time=681443808 us)
          2      NESTED LOOPS  (cr=0 pr=0 pw=0 time=168646003 us)
          2       NESTED LOOPS  (cr=0 pr=0 pw=0 time=168636029 us)
          2        NESTED LOOPS  (cr=0 pr=0 pw=0 time=168580989 us)
    327667         REMOTE  TWFLPROCESSINSTANCES (cr=0 pr=0 pw=0 time=9177863 us)
          2         REMOTE  TAMCONTRACTEDITEMD (cr=0 pr=0 pw=0 time=158011360 us)
          2        REMOTE  TAMPROPVALUES (cr=0 pr=0 pw=0 time=55007 us)
          2       REMOTE  TREPVALUELISTITEMS (cr=0 pr=0 pw=0 time=9947 us)
    24542745      REMOTE  TAMCONTRACTEDITEMD (cr=0 pr=0 pw=0 time=3509657414 us)
          2     REMOTE  TWFLPROCESSINSTANCES (cr=0 pr=0 pw=0 time=4309 us)
          2    INDEX RANGE SCAN IDX_PROCES_ID (cr=6 pr=0 pw=0 time=160 us)(object id 552075)
    Rows     Execution Plan
          0  INSERT STATEMENT   MODE: ALL_ROWS
          0   SORT (UNIQUE)
          0    FILTER
          2     NESTED LOOPS
          2      HASH JOIN
          2       NESTED LOOPS
          2        NESTED LOOPS
          2         NESTED LOOPS
    327667          REMOTE OF 'TWFLPROCESSINSTANCES' (REMOTE)
                         [T6STDBY.WR]
                        SELECT /*+ OPAQUE_TRANSFORM */ "ID","STATUS","STARTDATE"
                        FROM "DIALOG6"."TWFLPROCESSINSTANCES" "PI" WHERE
                          "STATUS"<>'A' AND "STATUS"<>'N' AND "STARTDATE">=:1-30
          2          REMOTE OF 'TAMCONTRACTEDITEMD' (REMOTE)
                         [T6STDBY.WR]
                        SELECT /*+ OPAQUE_TRANSFORM */ "CITEM_ID","ROOTCITEM_ID",
                        "PRODUCT_ID","CONTRACT_ID" FROM
                        "DIALOG6"."TAMCONTRACTEDITEMD" "CI" WHERE "PRODUCT_ID"=
                          934 AND "CONTRACT_ID"=:1
          2         REMOTE OF 'TAMPROPVALUES' (REMOTE) [T6STDBY.WR]
                       SELECT /*+ OPAQUE_TRANSFORM */ "PROPERTY_ID",
                       "VALUEOBJECT_ID","CONTRACTEDITEM_ID","DTO","ISVALID"
                     FROM "DIALOG6"."TAMPROPVALUES" "TV" WHERE "DTO" IS NULL
                       AND "ISVALID"='Y' AND "CONTRACTEDITEM_ID"=:1 AND
                         "PROPERTY_ID"=930326
          2        REMOTE OF 'TREPVALUELISTITEMS' (REMOTE) [T6STDBY.WR]
                      SELECT /*+ OPAQUE_TRANSFORM */ "ID","NAME" FROM
                        "DIALOG6"."TREPVALUELISTITEMS" "TVL" WHERE "ID"=:1
    24542745       REMOTE OF 'TAMCONTRACTEDITEMD' (REMOTE) [T6STDBY.WR]
                     SELECT /*+ OPAQUE_TRANSFORM */ "CITEM_ID","CONTRACT_ID" FROM
                       "DIALOG6"."TAMCONTRACTEDITEMD" "CINAD"
          2      REMOTE OF 'TWFLPROCESSINSTANCES' (REMOTE) [T6STDBY.WR]
                    SELECT /*+ OPAQUE_TRANSFORM */ "ID" FROM
                    "DIALOG6"."TWFLPROCESSINSTANCES" "SYS_ALIAS_1" WHERE "ID"=
                      :1
          2     INDEX   MODE: ANALYZED (RANGE SCAN) OF 'IDX_PROCES_ID'
                    (INDEX)Edited by: Przemek P on 2012-01-27 07:40
    Edited by: Przemek P on 2012-01-27 07:50

    Could you please edit your post and use \ tags so the output is more user friendly?
    Type: \Your Code Here\It will display as:Your Code Here                                                                                                                                                                                                                                                                                                                                                                       

  • Problem with decode function while dispaly the data ( urgent )

    Hi friends ,
    I want the output like this.
    sample:
    CLIENT CODE: 00027
    PLAN CODE: 01
    SSN Last Name First Name TYPE Frequency Amount
    123-45-6036 Perrault Julia D M 250.00
    123-45-6036 Perrault Julia D Q 400.00
    CLIENT CODE: 00027
    PLAN CODE: 02
    SSN Last Name First Name TYPE Frequency Amount
    123-45-6036 Perrault Julia D S 1000.00
    123-45-7042 Testaverde Alexander D B 50.00
    this is my query:
    SELECT distinct pln.plan_code,
    ind.ssn,
    ind.last_name,
    ind.first_name,
    pln.clt_client_id,
    DECODE(rp.account_code,'AMNT',rp.userid,NULL) amount,
    DECODE(rp.account_code,'FREQ',rp.userid,NULL) frequence,
    DECODE(rp.account_code,'TYPE',rp.userid,NULL) type
    FROM rp_extract_recon rp,
    plan pln,
    indicative ind
    where ind.indicative_id in ( select distinct
    rp1.ind_indicative_id
    from rp_extract_recon rp1
    where rp1.rp_extract_recon_id =
    rp.rp_extract_recon_id )
    and ind.clt_client_id = pln.clt_client_id
    and pln.plan_id = rp.pln_plan_id
    and rp.bat_batch_info_id = 14078
    and rp.rp_report_type_code = 'TEST'
    output for above query:
    PLAN_C SSN LAST_NAME FIRST_NAME CLT_C AMOUNT
    FREQUENCE TYPE
    01 123456036 Perrault Julia 00027 250.00
    01 123456036 Perrault Julia 00027 400.00
    01 123456036 Perrault Julia 00027 M
    01 123456036 Perrault Julia 00027 Q
    01 123456036 Perrault Julia
    00027 D
    02 123456036 Perrault Julia 00027 1000.00
    02 123456036 Perrault Julia 00027 S
    02 123456036 Perrault Julia
    00027 D
    02 123457042 Testaverde Alexander 00027 50.00
    02 123457042 Testaverde Alexander 00027 B
    02 123457042 Testaverde Alexander
    00027 D
    11 rows selected.
    11 rows selected.
    how can i get the above ouput .
    i want the type,frequency,amount values in one line.
    thanks for u r kind help
    srini

    Hi Srini,
    Add Max in the begining and group by at the end of statement.
    Please let me know in both cases if it works or not.
    thanks
    for example
    SELECT distinct pln.plan_code,
    ind.ssn,
    ind.last_name,
    ind.first_name,
    pln.clt_client_id,
    MAX(DECODE(rp.account_code,'AMNT',rp.userid,NULL) amount,
    DECODE(rp.account_code,'FREQ',rp.userid,NULL) frequence,
    DECODE(rp.account_code,'TYPE',rp.userid,NULL) type )
    FROM rp_extract_recon rp,
    plan pln,
    indicative ind
    where ind.indicative_id in ( select distinct
    rp1.ind_indicative_id
    from rp_extract_recon rp1
    where rp1.rp_extract_recon_id =
    rp.rp_extract_recon_id )
    and ind.clt_client_id = pln.clt_client_id
    and pln.plan_id = rp.pln_plan_id
    and rp.bat_batch_info_id = 14078
    and rp.rp_report_type_code = 'TEST'
    GROUP BY
    pln.plan_code,
    ind.ssn,
    ind.last_name,
    ind.first_name,
    pln.clt_client_id,

  • Problem with decode function while dispaly the data

    Hi friends ,
    I want the output like this.
    sample:
    CLIENT CODE: 00027
    PLAN CODE: 01
    SSN Last Name First Name TYPE Frequency Amount
    123-45-6036 Perrault Julia D M 250.00
    123-45-6036 Perrault Julia D Q 400.00
    CLIENT CODE: 00027
    PLAN CODE: 02
    SSN Last Name First Name TYPE Frequency Amount
    123-45-6036 Perrault Julia D S 1000.00
    123-45-7042 Testaverde Alexander D B 50.00
    this is my query:
    SELECT distinct pln.plan_code,
    ind.ssn,
    ind.last_name,
    ind.first_name,
    pln.clt_client_id,
    DECODE(rp.account_code,'AMNT',rp.userid,NULL) amount,
    DECODE(rp.account_code,'FREQ',rp.userid,NULL) frequence,
    DECODE(rp.account_code,'TYPE',rp.userid,NULL) type
    FROM rp_extract_recon rp,
    plan pln,
    indicative ind
    where ind.indicative_id in ( select distinct
    rp1.ind_indicative_id
    from rp_extract_recon rp1
    where rp1.rp_extract_recon_id =
    rp.rp_extract_recon_id )
    and ind.clt_client_id = pln.clt_client_id
    and pln.plan_id = rp.pln_plan_id
    and rp.bat_batch_info_id = 14078
    and rp.rp_report_type_code = 'TEST'
    output for above query:
    PLAN_C SSN LAST_NAME FIRST_NAME CLT_C AMOUNT
    FREQUENCE TYPE
    01 123456036 Perrault Julia 00027 250.00
    01 123456036 Perrault Julia 00027 400.00
    01 123456036 Perrault Julia 00027 M
    01 123456036 Perrault Julia 00027 Q
    01 123456036 Perrault Julia
    00027 D
    02 123456036 Perrault Julia 00027 1000.00
    02 123456036 Perrault Julia 00027 S
    02 123456036 Perrault Julia
    00027 D
    02 123457042 Testaverde Alexander 00027 50.00
    02 123457042 Testaverde Alexander 00027 B
    02 123457042 Testaverde Alexander
    00027 D
    11 rows selected.
    11 rows selected.
    how can i get the above ouput .
    i want the type,frequency,amount values in one line.
    please help me.
    thanks for u r kind help.
    srini

    Hi.
    I have not tested this my self, byt tryit.
    SELECT pln.plan_code,
    ind.ssn,
    ind.last_name,
    ind.first_name,
    pln.clt_client_id,
    MAX(DECODE(rp.account_code,'AMNT',rp.userid,NULL)) amount,
    MAX(DECODE(rp.account_code,'FREQ',rp.userid,NULL)) frequence,
    MAX(DECODE(rp.account_code,'TYPE',rp.userid,NULL)) type
    FROM rp_extract_recon rp,
    plan pln,
    indicative ind
    where ind.indicative_id in ( select distinct
    rp1.ind_indicative_id
    from rp_extract_recon rp1
    where rp1.rp_extract_recon_id =
    rp.rp_extract_recon_id )
    and ind.clt_client_id = pln.clt_client_id
    and pln.plan_id = rp.pln_plan_id
    and rp.bat_batch_info_id = 14078
    and rp.rp_report_type_code = 'TEST'
    GROUP BY pln.plan_code,
    ind.ssn,
    ind.last_name,
    ind.first_name
    /Uffe

  • Problem with java.util while migrating an app. from Apache to OC4J

    Hello.
    I have a application which runs fine under APache/Jserv . This
    application contains bunch of jsp's. In the jsp's even though
    there are no directives for import of java.util.* packages it
    still works fine. But under oc4j the same application does not
    work unless I modify the jsp to include java.util.* in the
    import directive. What am I missing here?.
    Thanks in advance.
    Prakash

    Hi,
    I think that Apache/Jserv does the inlcude of java.util.*
    automatically which OC4J dosen't.
    Thanks,
    Andy
    Hello.
    I have a application which runs fine under APache/Jserv . This
    application contains bunch of jsp's. In the jsp's even though
    there are no directives for import of java.util.* packages it
    still works fine. But under oc4j the same application does not
    work unless I modify the jsp to include java.util.* in the
    import directive. What am I missing here?.
    Thanks in advance.
    Prakash

  • Problem with DECODE block in WHERE clause

    Hi,
    I'm facing problem with DECODE statement. I just simulated my problem in the simple way as follows. If I execute this following query, I should get "hello", but I'm not getting anything (ZERO rows returned).
    SELECT 'hello' FROM DUAL
    WHERE 'sample1' in (DECODE(1, 1, '''sample1'', ''sample2'', ''sample3''',
    2, '''sample4'', ''sample5'', ''sample6'''
    I think some problem is there in my WHERE clause.
    But When I'm exeucting the following query as a seperate query, then I'm getting the value of DECODE block properly, but didn;t understnad why its not returning the same way when I'm putting the same DECODE statement in WHERE clause.
    SELECT DECODE(1, 1, '''sample1'', ''sample2'', ''sample3''',
    2, '''sample4'', ''sample5'', ''sample6'''
    FROM DUAL;
    Please help me to get out of this problem. Thank you so much in advance.
    Thanks,
    Ramji.

    The value returned by SELECT DECODE(1, 1, '''sample1'', ''sample2'', ''sample3''',2, '''sample4'', ''sample5'', ''sample6''') FROM DUAL;
    'sample1', 'sample2', 'sample3' is a single string. Consider it x.
    SELECT 'hello' FROM DUAL WHERE 'sample1' in ( DECODE(1, 1, '''sample1'', ''sample2'', ''sample3''',2, '''sample4'', ''sample5'', ''sample6'''));
    is like SELECT 'hello' FROM DUAL WHERE 'sample1' in ('x');
    or
    SELECT 'hello' FROM DUAL WHERE 'sample1' in ('''sample1'', ''sample2'', ''sample3''') and not
    SELECT 'hello' FROM DUAL WHERE 'sample1' in ('sample1', 'sample2', 'sample3');
    For this same reason SELECT 'hello' FROM DUAL WHERE 'sample1' in (select '''sample1'', ''sample2'', ''sample3''' from dual);
    also does'nt work.
    Please use INSTR to find whether 'sample1' exists in the string 'sample1', 'sample2', 'sample3'.

  • Performance problem with MERGE statement

    Version : 11.1.0.7.0
    I have an insert statement like following which is taking less than 2 secs to complete and inserts around 4000 rows:
    INSERT INTO sch.tab1
              (c1,c2,c3)
    SELECT c1,c2,c3
       FROM sch1.tab1@dblink
      WHERE c1 IN (SELECT c1 FROM sch1.tab2@dblink);I wanted to change it to a MERGE statement just to avoid duplicate data. I changed it to following :
    MERGE INTO sch.tab1 t1
    USING (SELECT c1,c2,c3
       FROM sch1.tab1@dblink
      WHERE c1 IN (SELECT c1 FROM sch1.tab2@dblink) t2
    ON (t1.c1 = t2.c1)
    WHEN NOT MATCHED THEN
    INSERT (t1.c1,t1.c2,t1.c3)
    VALUES (t2.c1,t2.c2,t2.c3);The MERGE statement is taking more than 2 mins (and I stopped the execution after that). I removed the WHERE clause subquery inside the subquery of the USING section and it executed in 1 sec.
    If I execute the same select statement with the WHERE clause outside the MERGE statement, it takes just 1 sec to return the data.
    Is there any known issue with MERGE statement while implementing using above scenario?

    riedelme wrote:
    Are your join columns indexed?
    Yes, the join columns are indexed.
    You are doing a remote query inside the merge; remote queries can slow things down. Do you have to select all thr rows from the remote table? What if you copied them locally using a materialized view?Yes, I agree that remote queries will slow things down. But the same is not happening while select, insert and pl/sql. It happens only when we are using MERGE. I have to test what happens if we use a subquery refering to a local table or materialized view. Even if it works, I think there is still a problem with MERGE in case of remote subqueries (atleast till I test local queries). I wish some one can test similar scenarios so that we can know whether it is a genuine problem or some specific problem from my side.
    >
    BTW, I haven't had great luck with MERGE either :(. Last time I tried to use it I found it faster to use a loop with insert/update logic.
    Edited by: riedelme on Jul 28, 2009 12:12 PM:) I used the same to overcome this situation. I think MERGE needs to be still improved functionally from Oracle side. I personally feel that it is one of the robust features to grace SQL or PL/SQL.

  • Problem with READ Statement in the field routine of the Transformation

    Hi,
    I have problem with read statement with binary search in the field routine of the transformation.
    read statement is working well when i was checked in the debugging mode, it's not working properly for the bulk load in the background. below are the steps i have implemented in my requirement.
    1. I selected the record from the lookuo DSO into one internal table for all entried in source_packeage.
    2.i have read same internal table in the field routine for each source_package entry and i am setting the flag for that field .
    Code in the start routine
    select source accno end_dt acctp from zcam_o11
    into table it_zcam
    for all entries in source_package
    where source = source_package-source
         and accno = source_package-accno.
    if sy-subrc = 0.
    delete it_zcam where acctp <> 3.
    delete it_zcam where end_dt initial.
    sort it_zcam by surce accno.
    endif.
    field routine code:
    read table it_zcam with key source = source_package-source
                                                 accno  = source_package-accno
                                                 binary search
                                                 transportin no fields.
    if sy-subrc = 0.
    RESULT  = 'Y'.
    else.
    RESULT = 'N'.
    endif.
    this piece of code exist in the other model there its working fine.when comes to my code it's not working properly, but when i debug the transformation it's working fine for those accno.
    the problem is when i do full load the code is not working properly and populating the wrong value in the RESULT field.
    this field i am using in the report filter.
    please let me know if anybody has the soluton or reason for this strage behaviour.
    thanks,
    Rahim.

    i suppose the below is not the actual code. active table of dso would be /bic/azcam_o1100...
    1. is the key of zcam_o11 source and accno ?
    2. you need to get the sortout of if endif (see code below)
    select source accno end_dt acctp from zcam_o11
    into table it_zcam
    for all entries in source_package
    where source = source_package-source
    and accno = source_package-accno.
    if sy-subrc = 0.
    delete it_zcam where acctp 3.
    delete it_zcam where end_dt initial.
    endif.
    sort it_zcam by surce accno.
    field routine code:
    read table it_zcam with key source = source_package-source
    accno = source_package-accno
    binary search
    transportin no fields.
    if sy-subrc = 0.
    RESULT = 'Y'.
    else.
    RESULT = 'N'.
    endif.

  • Problem with Consolas font in a form

    I have problem with Consolas font in a form in latest Adobe Reader (v11.0.9)
    It shows dots (password sign) instead of letters. Edit box is not configured for passwords.
    Form was created by Foxit PhantomPDF and it shows correctly in Foxit.
    Can somebody check PDF for errors or warnings?
    http://www60.zippyshare.com/v/71759184/file.html

    You should embed these fonts in the document.
    If you need more help with this, please ask in the Acrobat forum.

  • Problems with decoding an latin1-encoded url

    Hi,
    i have a problem with decoding german umlaut-characters from an URL.
    I'm using Tomcat 5.5 on a Linux server and one on a windows machine for development. Both webapps have the same configurations.
    A servlet decodes the URL-String, parses it and stores the parsed data into a mysql-DB.
    For decoding the query-string i'm using org.apache.commons.codec.net.URLCodec.URLCodec.decode .
    Here's the code:
    String unparsedParameters = request.getQueryString();
    URLCodec codec = new URLCodec("ISO-8859-1");
    result = codec.decode(unparsedParameters);Here an example for a query-string: http://servername:8080/servlet/Import?Etwas%20wurde%20am%2025.08.2010%2010%3A16%3A50%20*ge%E4ndert*
    On the windows machine the word "*ge&auml;ndert*" is decoded correctly. But on the linux server i get "*ge?ndert*". It makes no difference if i write the result into the database or just into a logfile.
    Can anyone help?
    Thanks in advance.
    Edited by: sol1640 on Aug 26, 2010 5:59 AM

    Problem resolved.
    Instead of using the decode-method as described in my fist message now i'm doing the folowing:
    fURLDecodigCharset = "ISO8859-1";
    byte[] bytes = originalParam.getBytes(fURLDecodigCharset);
    byte[] decodeUrl = URLCodec.decodeUrl(bytes);
    result = new String (decodeUrl, fURLDecodigCharset);because the method "decode" decodes the string by using the defaultcharset. And that was the problem.
    >
    The default charset is determined during virtual-machine startup and typically depends upon the locale and charset of the underlying operating system.
    >
    Thats why i've got different behaviours on different systems.
    Thanks

  • Problem with Progress DB while using to connect using JDBC Adapter

    Hi,
      I am facing Problem with Progress DB while using to connect using JDBC Adapter. I am getting the following error in auditlog file like,
    Error during database connection to the database URL  jdbc:JdbcProgress:T:156.5.31.65:2545:/mfgprodev/devbadb 
    /devsche/i_apoext.db using the  JDBC driver "com.progress.sql.jdbc.JdbcProgressDriver" : com.sap.aii.adapter.jdbc.sql.DriverManagerException: Unable to locate a suitable JDBC driver to establish a connection to URL " jdbc:JdbcProgress:T:156.5.31.65:2545:/mfgprodev/devbadb 
    /devsche/i_apoext.db "
    I tried using the following all URLs,
    1. jdbc:JdbcProgress:T:156.5.31.65:2545:i_apoext.       
    2. jdbc:JdbcProgress:T:156.5.31.65:2545:i_apoext.db     
    3.                                                      
    jdbc:JdbcProgress:T:156.5.31.65:2545:/mfgprodev/devbadb 
    /devsche/i_apoext.                                      
    4.                                                      
    jdbc:JdbcProgress:T:156.5.31.65:2545:/mfgprodev/devbadb 
    /devsche/i_apoext.db.                                  
    Can anyone please help me out in solving this issue.
    May be the cause for this is :
    1) The Wrong URL  format
    2) CLASSPATH is not setted properly..
    Can you look more into this stuff.
    Thanks,
    Soorya.

    Hi,
    To access any database fromm XI, using the JDBC adapter, the corresponding drivers have to be installed on the XI server.
    Just check this note 831162.
    Also, check this PDF to install Drivers in XI,
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/3867a582-0401-0010-6cbf-9644e49f1a10

  • Problem with two monitors while using Photoshop, windows move from 2nd screen to 1st screen.

    Problem with two monitors while using Photoshop, windows move from 2nd screen to 1st screen.
    I saved a new workspace and it did not help.
    No problem before I went to Maverick.

    I found the fix, go to System Preferences and open Mission Control and uncheck the box to keep monitors as they were (When switching to an application...........)

  • Problems with Java AQ interface migrating 9i to 10g

    Hi!
    I've got problems with Java AQ Interface migrating from 9i DB, JDBC, AQ to 10g rel.2 DB, JDBC, AQ
    First, i started to occasionally receive NullPointerException in Oracle JDBC 9.2.0.8
    java.lang.NullPointerException
    at oracle.jdbc.driver.OracleStatement.describe(OracleStatement.java:6439)
    at oracle.jdbc.driver.OracleStatement.get_column_index(OracleStatement.java:6203)
    at oracle.jdbc.driver.OracleResultSetImpl.findColumn(OracleResultSetImpl.java:1557)
    at oracle.jdbc.driver.OracleResultSet.getString(OracleResultSet.java:1543)
    at gpnic.messaging.LDAPMessenger.messageFromRS(Unknown Source)
    We were using 9.2.0.8 JDBC and 9i and 10g databases.
    We decided to go up for 10g r2 JDBC Drivers, and 10.2 AQ but started to get the following errors:
    oracle.AQ.AQOracleSQLException: ORA-25216: invalid recipient, either NAME or ADDRESS must be specified
    ORA-06512: на "SYS.DBMS_AQIN", line 454
    ORA-06512: на line 1
         at oracle.AQ.AQOracleQueue.enqueue(AQOracleQueue.java:1267)
         at gpnic.comm.messaging.transport.AQTransportAdapter$AQDestanation.send(AQTransportAdapter.java:607)
         at gpnic.comm.messaging.transport.OutboundThread.run(OutboundThread.java:83)
    I'm specifying address of an agent, but oracle says I am not.
    I tried both native AQ and JMS interfaces, bot got the same error. I specify recipient the following way:
    'consumer' var contains name of AQ agent and is not null
    native AQ interface:
    aqSess = AQDriverManager.createAQSession(db_conn);
    AQQueue destQ = aqSess.getQueue(schema, queue);
    dequeueOptionsOut = new AQDequeueOption();
    dequeueOptionsOut.setWaitTime(AQDequeueOption.WAIT_NONE);
    dequeueOptionsOut.setConsumerName(consumer);
    dequeueOptionsOut.setDequeueMode(AQDequeueOption.DEQUEUE_REMOVE);
    dequeueOptionsOut.setNavigationMode(AQDequeueOption.NAVIGATION_FIRST_MESSAGE);
    AQMessageProperty mpOut = new AQMessageProperty();
    Vector vRecpt = new Vector();
    vRecpt.add(new AQAgent(consumer, null, 0));
    mpOut.setRecipientList(vRecpt);
    AQMessage aqMsg = null;
    AQEnqueueOption eOpt = null;
    //prepare message
    aqMsg = destQ.createMessage();
    CLOB chMsg = CLOB.createTemporary(db_conn, true, CLOB.DURATION_SESSION);
    chMsg.open(CLOB.MODE_READWRITE);
    chMsg.putString(1,msg);
    //creating oracle type message
    gpnic.db.SDSTypes.SdsMsgT oraMsg = new gpnic.db.SDSTypes.SdsMsgT(chMsg);
    AQObjectPayload payload = aqMsg.getObjectPayload();
    payload.setPayloadData(oraMsg);
    //setting properties
    aqMsg.setMessageProperty(mpOut);
    //do enqueueOut
    eOpt = new AQEnqueueOption();
    destQ.enqueue(eOpt, aqMsg); //<- here AQOracleSQLException is thrown
    JMS interface to Oracle AQ:
    TopicSession session;
    TopicConnection connection;
    TopicPublisher publisher;
    AQjmsAgent[] recipientList;
    connection = AQjmsTopicConnectionFactory.createTopicConnection(db_conn);
         session = connection.createTopicSession(true, Session.CLIENT_ACKNOWLEDGE);
         connection.start();
         Topic topic = ((AQjmsSession) session).getTopic(schema, queue);
         publisher = session.createPublisher(topic);
         recipientList = new AQjmsAgent[1];
         recipientList[0] = new AQjmsAgent(consumer, null);
    CLOB chMsg = CLOB.createTemporary(db_conn, true, CLOB.DURATION_SESSION);
    chMsg.open(CLOB.MODE_READWRITE);
    chMsg.putString(1,msg);
    //creating oracle type message
    gpnic.db.SDSTypes.SdsMsgT oraMsg = new gpnic.db.SDSTypes.SdsMsgT(chMsg);
    AdtMessage adtMessage = ((AQjmsSession)session).createAdtMessage();
    adtMessage.setAdtPayload(oraMsg);
    ((AQjmsTopicPublisher) publisher).publish(adtMessage, recipientList); <- here Exception is thrown
    We tried the following combinations
    9i DB, 9i jdbc, 9i aq - enqueue ok
    10g DB, 9i jdbc, 9i aq - enqueue ok
    10g DB, 10g jdbc, 10g aq - exception is thrown
    Can anyone help?

    Duplicate post, please check Upgrade 9i to 10g

Maybe you are looking for

  • MacBook Air wi-fi doesn't work at home but does everywhere else?

    Hello everyone, out of the blue recently my mid-2012 Macbook air started having wifi issues at home.  Everywhere I go except my house the wifi works excellently.  This would lead one to believe my home wifi is at fault, however all of my family's dev

  • Lion and external display

    Hi, When I wake up my MacBoo Pro usingto work with external display, my laptop gets very hot and I with Snow Leo I was used to open the lid to cool it down. It worked fine, because the laptop screen was black but with Lion I cannot do it because afte

  • Slow motion not playing back after 8.02

    I have iPhone 6 plus.  I shot a couple of slow-motion videos when device had iOS 8.0.  I just noticed that these videos are not playing back in slow-mo after the upgrade to iOS 8.02.  Anybody else having this problem?  Any suggestions?

  • How to download LabVIEW 11 Student Edition for OS X

    I received my activation number for LabVIEW 11 Student Edition by email for participating in an online lecture and solving a problem. In the email there was no link to download the software. Where can I find a download link for LabVIEW 11 Student Edi

  • Find Form bean changes in Action

    I have a requirement in struts 1.2 framework where i have 50 to 60 fields in my form in which i have to update only 3Fields(which are changed by the user) so when i submit the form only these 3Fields needs to be updated in the database. How can i ide