Issue While Calling a Function in Crystal from Oracle

Post Author: digik
CA Forum: Crystal Reports
Hi there,
I have a function in Oracle which fetches values in to table type. When I run this query in Oracle SQL Plus it is giving me records. But the same query in Crystal is giving zero records?
Function SQL
Create or Replace Function getReport(numTrades IN NUMBER,AsOfDateFrom IN DATE,AsOfDateTo IN DATE,compareDate IN DATE,productType IN VARCHAR2,dataGrade IN NUMBER,DataGradeThreshold IN NUMBER)Return top_movers_type_tableAStableRow top_movers_type := top_movers_type(NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,  NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,  NULL,NULL,NULL);resulttable top_movers_type_table := top_movers_type_table(); IDvar              VARCHAR2(12);         CURR_DATEvar         DATE;        PRODUCTvar          VARCHAR2(6);        DESCRIPTIONvar      VARCHAR2(100);        COUPONvar           NUMBER(14,10);        SETLMNT_DATEvar      DATE;        CURR_PRICEvar       NUMBER(14,10);        COMPARE_PRICEvar    NUMBER(14,10);        PRICE_DELTAvar      NUMBER(24,20);        PRICE_DELTA_PCTvar  NUMBER(24,20);        TRD_AMT_OR_UPBvar   NUMBER(20,2);        UPB_PRICE_DELTAvar   NUMBER(35,15);        COMPARE_DATEvar     DATE;        DATA_GRADEvar       NUMBER(4,0);        TRADE_PRICEvar     NUMBER(14,10);        TRADE_DATEvar      DATE;        PROD_SPECIFIC_FLDvar VARCHAR2(10);           COMPARE_PRICE_FROMvar  VARCHAR2(10);        TOT_COUNTvar NUMBER(10);                        CURSOR TopmoversCursor IS        select ID,CURR_DATE,  PRODUCT, DESCRIPTION, COUPON, SETLMNT_DATE,         CURR_PRICE, COMPARE_PRICE, PRICE_DELTA, PRICE_DELTA_PCT,         TRD_AMT_OR_UPB, UPB_PRICE_DELTA, COMPARE_DATE, DATA_GRADE,         TRADE_PRICE, TRADE_DATE, PROD_SPECIFIC_FLD, COMPARE_PRICE_FROM,   TOT_COUNT  from ( select SECU_CUSIP_ID ID,  FA_MTM_EFF_DT CURR_DATE, FA_TYP_DESC PRODUCT , FA_PTR COUPON,  TRD_STLM_DT SETLMNT_DATE,  CURR_PRC CURR_PRICE, DATA_QLTY_CD DATA_GRADE,  TRD_PRC_PCT TRADE_PRICE,  SECU_TRD_DT TRADE_DATE,  SECU_STAMPS_TYP_DESC DESCRIPTION,  COMPARE_PRC COMPARE_PRICE,   UPB TRD_AMT_OR_UPB, COMPARE_DATE COMPARE_DATE,  COMPARE_PRC_FROM COMPARE_PRICE_FROM,  PROD_SPC_FLD PROD_SPECIFIC_FLD,  PRC_DELTA PRICE_DELTA, ABS_PRC_DELTA,  UPB_PRICE_DELTA, PRC_DELTA_PCT PRICE_DELTA_PCT, dense_rank() over (order by ABS_PRC_DELTA desc) as TOPN, count(SECU_CUSIP_ID) over () as TOT_COUNT from ( select SECU_CUSIP_ID, FA_MTM_EFF_DT,FA_TYP_DESC,FA_PTR,  TRD_STLM_DT, CURR_PRC ,DATA_QLTY_CD, TRD_PRC_PCT ,  SECU_TRD_DT, SECU_STAMPS_TYP_DESC , COMPARE_PRC,  UPB,  COMPARE_DATE, COMPARE_PRC_FROM, PROD_SPC_FLD,  (CURR_PRC - COMPARE_PRC) as PRC_DELTA, abs(CURR_PRC - COMPARE_PRC) as ABS_PRC_DELTA, ((CURR_PRC - COMPARE_PRC)*100)/COMPARE_PRC as PRC_DELTA_PCT, ((CURR_PRC - COMPARE_PRC) *  UPB)/100000000  as UPB_PRICE_DELTA from ( select F1.SECU_CUSIP_ID, F1.FA_MTM_EFF_DT,F1.FA_TYP_DESC,F1.FA_PTR,  F1.TRD_STLM_DT, F1.FA_MTM_PRC_PCT as CURR_PRC ,F1.DATA_QLTY_CD, F1.TRD_PRC_PCT ,  F1.SECU_TRD_DT, decode(MVS.SECU_STAMPS_TYP_DESC,null,'N/A','','N/A',MVS.SECU_STAMPS_TYP_DESC) SECU_STAMPS_TYP_DESC , NVL(F2.FA_MTM_PRC_PCT,F1.TRD_PRC_PCT) COMPARE_PRC,  F1.FA_CURR_UPB_AMT/1000000 as UPB, NVL(F2.FA_MTM_EFF_DT,F1.SECU_TRD_DT) as COMPARE_DATE, Decode(F2.FA_MTM_PRC_PCT,null,'TRADE','INVENTORY') as COMPARE_PRC_FROM, DECODE(F1.FA_TYP_DESC,        'AGNCY',REMIC_AGNC_DTL.REMIC_CLS_PRIN_PMT_TYP_CD,        'MBS',MBS_DTL.MBS_WALA_NO,        'ARM',ARM_DTL.MBS_WALA_NO,        'REMIC',REMIC_DTL.REMIC_TYP_CD,        'MFMBS',MF_MBS_DTL.SECU_YLD_MANT_DELTA_TERM,        'CAB','N/A',        'PCERT','N/A',        'MRB','N/A',        'STRIP','N/A',        'SFWL','N/A',        'ARMWL','N/A',        'MFWL','N/A','NULL') as PROD_SPC_FLD from FA_MARK F1 , FA_MARK F2, MV_SEC_TYP MVS, MBS_DTL, MRB_DTL,  MF_MBS_DTL ,REMIC_AGNC_DTL ,REMIC_DTL, ARM_DTL where F1.SECU_CUSIP_ID = F2.SECU_CUSIP_ID () and F1.FA_MTM_ID = MBS_DTL.FA_MTM_ID () and F1.FA_MTM_ID = MRB_DTL.FA_MTM_ID () and F1.FA_MTM_ID = MF_MBS_DTL.FA_MTM_ID () and F1.FA_MTM_ID = REMIC_AGNC_DTL.FA_MTM_ID () and F1.FA_MTM_ID = REMIC_DTL.FA_MTM_ID () and F1.FA_MTM_ID = ARM_DTL.FA_MTM_ID () and F1.FA_TYP_DESC = F2.FA_TYP_DESC () and F1.TRD_STAT_CD = F2.TRD_STAT_CD () and F1.SECU_STAMPS_TYP_CD = MVS.SECU_STAMPS_TYP_CD () and F1.FA_MTM_EFF_DT >= '01-May-2007' and F1.FA_MTM_EFF_DT <= '31-May-2007' and F1.DATA_QLTY_CD >= 1 and F1.DATA_QLTY_CD <= 10 and F1.TRD_STAT_CD = 5 and F1.FA_TYP_DESC = 'MBS' and F2.FA_MTM_EFF_DT() = '30-Apr-2007' and F2.DATA_QLTY_CD ()>= 1        and F2.DATA_QLTY_CD (+)<= 10 ) where COMPARE_PRC > 0  order by ABS_PRC_DELTA desc )        ) where TOPN <= numTrades;BEGIN
OPEN TopmoversCursor(numTrades ,AsOfDateFrom ,AsOfDateTo ,compareDate ,productType ,dataGrade ,DataGradeThreshold); LOOP  FETCH TopmoversCursor INTO IDvar,CURR_DATEvar,  PRODUCTvar, DESCRIPTIONvar, COUPONvar, SETLMNT_DATEvar,         CURR_PRICEvar, COMPARE_PRICEvar, PRICE_DELTAvar, PRICE_DELTA_PCTvar,         TRD_AMT_OR_UPBvar, UPB_PRICE_DELTAvar, COMPARE_DATEvar, DATA_GRADEvar,         TRADE_PRICEvar, TRADE_DATEvar, PROD_SPECIFIC_FLDvar, COMPARE_PRICE_FROMvar,   TOT_COUNTvar;  EXIT WHEN TopmoversCursor%NOTFOUND;  ResultTable.extend;  ResultTable(resultTable.Last):= top_movers_type(IDvar,CURR_DATEvar,  PRODUCTvar, DESCRIPTIONvar, COUPONvar, SETLMNT_DATEvar,         CURR_PRICEvar, COMPARE_PRICEvar, PRICE_DELTAvar, PRICE_DELTA_PCTvar,         TRD_AMT_OR_UPBvar, UPB_PRICE_DELTAvar, COMPARE_DATEvar, DATA_GRADEvar,         TRADE_PRICEvar, TRADE_DATEvar, PROD_SPECIFIC_FLDvar, COMPARE_PRICE_FROMvar,   TOT_COUNTvar); END LOOP;CLOSE TopmoversCursor;RETURN resultTable;END getReport;/
Select Query
select * from (getReport(1,sysdate,sysdate,sysdate,0,2,4))

Post Author: digik
CA Forum: Crystal Reports
Hi there,
I have a function in Oracle which fetches values in to table type. When I run this query in Oracle SQL Plus it is giving me records. But the same query in Crystal is giving zero records?
Function SQL
Create or Replace Function getReport(numTrades IN NUMBER,AsOfDateFrom IN DATE,AsOfDateTo IN DATE,compareDate IN DATE,productType IN VARCHAR2,dataGrade IN NUMBER,DataGradeThreshold IN NUMBER)Return top_movers_type_tableAStableRow top_movers_type := top_movers_type(NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,  NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,  NULL,NULL,NULL);resulttable top_movers_type_table := top_movers_type_table(); IDvar              VARCHAR2(12);         CURR_DATEvar         DATE;        PRODUCTvar          VARCHAR2(6);        DESCRIPTIONvar      VARCHAR2(100);        COUPONvar           NUMBER(14,10);        SETLMNT_DATEvar      DATE;        CURR_PRICEvar       NUMBER(14,10);        COMPARE_PRICEvar    NUMBER(14,10);        PRICE_DELTAvar      NUMBER(24,20);        PRICE_DELTA_PCTvar  NUMBER(24,20);        TRD_AMT_OR_UPBvar   NUMBER(20,2);        UPB_PRICE_DELTAvar   NUMBER(35,15);        COMPARE_DATEvar     DATE;        DATA_GRADEvar       NUMBER(4,0);        TRADE_PRICEvar     NUMBER(14,10);        TRADE_DATEvar      DATE;        PROD_SPECIFIC_FLDvar VARCHAR2(10);           COMPARE_PRICE_FROMvar  VARCHAR2(10);        TOT_COUNTvar NUMBER(10);                        CURSOR TopmoversCursor IS        select ID,CURR_DATE,  PRODUCT, DESCRIPTION, COUPON, SETLMNT_DATE,         CURR_PRICE, COMPARE_PRICE, PRICE_DELTA, PRICE_DELTA_PCT,         TRD_AMT_OR_UPB, UPB_PRICE_DELTA, COMPARE_DATE, DATA_GRADE,         TRADE_PRICE, TRADE_DATE, PROD_SPECIFIC_FLD, COMPARE_PRICE_FROM,   TOT_COUNT  from ( select SECU_CUSIP_ID ID,  FA_MTM_EFF_DT CURR_DATE, FA_TYP_DESC PRODUCT , FA_PTR COUPON,  TRD_STLM_DT SETLMNT_DATE,  CURR_PRC CURR_PRICE, DATA_QLTY_CD DATA_GRADE,  TRD_PRC_PCT TRADE_PRICE,  SECU_TRD_DT TRADE_DATE,  SECU_STAMPS_TYP_DESC DESCRIPTION,  COMPARE_PRC COMPARE_PRICE,   UPB TRD_AMT_OR_UPB, COMPARE_DATE COMPARE_DATE,  COMPARE_PRC_FROM COMPARE_PRICE_FROM,  PROD_SPC_FLD PROD_SPECIFIC_FLD,  PRC_DELTA PRICE_DELTA, ABS_PRC_DELTA,  UPB_PRICE_DELTA, PRC_DELTA_PCT PRICE_DELTA_PCT, dense_rank() over (order by ABS_PRC_DELTA desc) as TOPN, count(SECU_CUSIP_ID) over () as TOT_COUNT from ( select SECU_CUSIP_ID, FA_MTM_EFF_DT,FA_TYP_DESC,FA_PTR,  TRD_STLM_DT, CURR_PRC ,DATA_QLTY_CD, TRD_PRC_PCT ,  SECU_TRD_DT, SECU_STAMPS_TYP_DESC , COMPARE_PRC,  UPB,  COMPARE_DATE, COMPARE_PRC_FROM, PROD_SPC_FLD,  (CURR_PRC - COMPARE_PRC) as PRC_DELTA, abs(CURR_PRC - COMPARE_PRC) as ABS_PRC_DELTA, ((CURR_PRC - COMPARE_PRC)*100)/COMPARE_PRC as PRC_DELTA_PCT, ((CURR_PRC - COMPARE_PRC) *  UPB)/100000000  as UPB_PRICE_DELTA from ( select F1.SECU_CUSIP_ID, F1.FA_MTM_EFF_DT,F1.FA_TYP_DESC,F1.FA_PTR,  F1.TRD_STLM_DT, F1.FA_MTM_PRC_PCT as CURR_PRC ,F1.DATA_QLTY_CD, F1.TRD_PRC_PCT ,  F1.SECU_TRD_DT, decode(MVS.SECU_STAMPS_TYP_DESC,null,'N/A','','N/A',MVS.SECU_STAMPS_TYP_DESC) SECU_STAMPS_TYP_DESC , NVL(F2.FA_MTM_PRC_PCT,F1.TRD_PRC_PCT) COMPARE_PRC,  F1.FA_CURR_UPB_AMT/1000000 as UPB, NVL(F2.FA_MTM_EFF_DT,F1.SECU_TRD_DT) as COMPARE_DATE, Decode(F2.FA_MTM_PRC_PCT,null,'TRADE','INVENTORY') as COMPARE_PRC_FROM, DECODE(F1.FA_TYP_DESC,        'AGNCY',REMIC_AGNC_DTL.REMIC_CLS_PRIN_PMT_TYP_CD,        'MBS',MBS_DTL.MBS_WALA_NO,        'ARM',ARM_DTL.MBS_WALA_NO,        'REMIC',REMIC_DTL.REMIC_TYP_CD,        'MFMBS',MF_MBS_DTL.SECU_YLD_MANT_DELTA_TERM,        'CAB','N/A',        'PCERT','N/A',        'MRB','N/A',        'STRIP','N/A',        'SFWL','N/A',        'ARMWL','N/A',        'MFWL','N/A','NULL') as PROD_SPC_FLD from FA_MARK F1 , FA_MARK F2, MV_SEC_TYP MVS, MBS_DTL, MRB_DTL,  MF_MBS_DTL ,REMIC_AGNC_DTL ,REMIC_DTL, ARM_DTL where F1.SECU_CUSIP_ID = F2.SECU_CUSIP_ID () and F1.FA_MTM_ID = MBS_DTL.FA_MTM_ID () and F1.FA_MTM_ID = MRB_DTL.FA_MTM_ID () and F1.FA_MTM_ID = MF_MBS_DTL.FA_MTM_ID () and F1.FA_MTM_ID = REMIC_AGNC_DTL.FA_MTM_ID () and F1.FA_MTM_ID = REMIC_DTL.FA_MTM_ID () and F1.FA_MTM_ID = ARM_DTL.FA_MTM_ID () and F1.FA_TYP_DESC = F2.FA_TYP_DESC () and F1.TRD_STAT_CD = F2.TRD_STAT_CD () and F1.SECU_STAMPS_TYP_CD = MVS.SECU_STAMPS_TYP_CD () and F1.FA_MTM_EFF_DT >= '01-May-2007' and F1.FA_MTM_EFF_DT <= '31-May-2007' and F1.DATA_QLTY_CD >= 1 and F1.DATA_QLTY_CD <= 10 and F1.TRD_STAT_CD = 5 and F1.FA_TYP_DESC = 'MBS' and F2.FA_MTM_EFF_DT() = '30-Apr-2007' and F2.DATA_QLTY_CD ()>= 1        and F2.DATA_QLTY_CD (+)<= 10 ) where COMPARE_PRC > 0  order by ABS_PRC_DELTA desc )        ) where TOPN <= numTrades;BEGIN
OPEN TopmoversCursor(numTrades ,AsOfDateFrom ,AsOfDateTo ,compareDate ,productType ,dataGrade ,DataGradeThreshold); LOOP  FETCH TopmoversCursor INTO IDvar,CURR_DATEvar,  PRODUCTvar, DESCRIPTIONvar, COUPONvar, SETLMNT_DATEvar,         CURR_PRICEvar, COMPARE_PRICEvar, PRICE_DELTAvar, PRICE_DELTA_PCTvar,         TRD_AMT_OR_UPBvar, UPB_PRICE_DELTAvar, COMPARE_DATEvar, DATA_GRADEvar,         TRADE_PRICEvar, TRADE_DATEvar, PROD_SPECIFIC_FLDvar, COMPARE_PRICE_FROMvar,   TOT_COUNTvar;  EXIT WHEN TopmoversCursor%NOTFOUND;  ResultTable.extend;  ResultTable(resultTable.Last):= top_movers_type(IDvar,CURR_DATEvar,  PRODUCTvar, DESCRIPTIONvar, COUPONvar, SETLMNT_DATEvar,         CURR_PRICEvar, COMPARE_PRICEvar, PRICE_DELTAvar, PRICE_DELTA_PCTvar,         TRD_AMT_OR_UPBvar, UPB_PRICE_DELTAvar, COMPARE_DATEvar, DATA_GRADEvar,         TRADE_PRICEvar, TRADE_DATEvar, PROD_SPECIFIC_FLDvar, COMPARE_PRICE_FROMvar,   TOT_COUNTvar); END LOOP;CLOSE TopmoversCursor;RETURN resultTable;END getReport;/
Select Query
select * from (getReport(1,sysdate,sysdate,sysdate,0,2,4))

Similar Messages

  • PInvoke - Issue while calling DJVU function from C# Code - Attempted to read or write protected memory

    Hi,
    I know there are many questions in this subject but none of them help to resolve the issue I am currently facing.
    Below is the signature of C Function from DJVULibre added in .NET code
    [DllImport("C:\\Program Files\\DJVULIBRE\\LIBDJVULIBRE.dll", CharSet=CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
    private unsafe static extern int ddjvu_page_render(IntPtr page, ddjvu_render_mode_t mode, IntPtr pagerect,
    IntPtr renderrect,
    IntPtr pixelformat,
    ulong rowsize,
    [Out][MarshalAs(UnmanagedType.LPArray)]byte[] imagebuffer);Below is how I am calling this function in the c# codebyte* buffer = (byte *)Memory.Alloc(nSize);
    try
    IntPtr ptr1 = (IntPtr)Memory.Alloc(Marshal.SizeOf(prect));
    Marshal.StructureToPtr(prect, ptr1, false);
    IntPtr ptr2 = (IntPtr)Memory.Alloc(Marshal.SizeOf(rrect));
    Marshal.StructureToPtr(rrect, ptr2, false);
    byte[] array = new byte[nSize];
    fixed (byte* p = array) Memory.Copy(buffer, p, nSize);
    ddjvu_page_render(page, ddjvu_render_mode_t.DDJVU_RENDER_MASKONLY, ptr1, ptr2, fmt, (ulong)stride, array);
    finally
    Memory.Free(buffer);
    }call to ddjvu_page_render in above code is throwing "Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
    Prior to this post I must have tried all the option could find in various blogs.
    Appreciate any help, is almost a day I am clueless, your timely help could save my job

    Thanks Viorel, below is the definition of original C function
    DDJVUAPI int
    ddjvu_page_render(ddjvu_page_t *page,
    const ddjvu_render_mode_t mode,
    const ddjvu_rect_t *pagerect,
    const ddjvu_rect_t *renderrect,
    const ddjvu_format_t *pixelformat,
    unsigned long rowsize,
    char *imagebuffer );below is how the code is calling this function in C#, the in pointers are all valid pointer I checked in debugging window byte* buffer = (byte *)Memory.Alloc(nSize);
    try
    IntPtr ptr1 = (IntPtr)Memory.Alloc(Marshal.SizeOf(prect));
    Marshal.StructureToPtr(prect, ptr1, false);
    IntPtr ptr2 = (IntPtr)Memory.Alloc(Marshal.SizeOf(rrect));
    Marshal.StructureToPtr(rrect, ptr2, false);
    byte[] array = new byte[nSize];
    fixed (byte* p = array) Memory.Copy(buffer, p, nSize);
    ddjvu_page_render(page, ddjvu_render_mode_t.DDJVU_RENDER_MASKONLY, ptr1, ptr2, fmt, (ulong)stride, array);
    finally
    Memory.Free(buffer);

  • Issue with calling custom function in merge command -10g

    Hi,
    I have ran into issue while calling a custom function in merge command.
    It throws error 'Invalid identifier'. Oracle doesnt understand that it is a function and take the function name as column name.
    Since no such collumn name exists, it throws 'Invalid identifier'.
    Interestingly, merge command works fine when it has a oracle function (replace, decode).
    The oracle version is 10.2.0.3
    It is very urgent.
    Any pointers will be helpful.
    Regards,
    Ravi

    I don't have privileges to create dblink, but this is working for me.
    So, i don't think function can be a issue here.
    satyaki>
    satyaki>select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
    PL/SQL Release 10.2.0.1.0 - Production
    CORE    10.2.0.1.0      Production
    TNS for Linux: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    Elapsed: 00:00:01.02
    satyaki>
    satyaki>
    satyaki>create table hist_tab
      2     as
      3       select * from emp
      4       where sal between 2000 and 4000;
    Table created.
    Elapsed: 00:00:00.09
    satyaki>
    satyaki>select * from hist_tab;
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO JOB1      DOB
          7844 TURNER     SALESMAN        7698 08-SEP-81       2178          0         30 SALESMAN
    Elapsed: 00:00:00.00
    satyaki>
    satyaki>
    satyaki>update hist_tab
      2     set mgr = 7794;
    1 row updated.
    Elapsed: 00:00:00.01
    satyaki>
    satyaki>commit;
    Commit complete.
    Elapsed: 00:00:00.00
    satyaki>
    satyaki>select * from hist_tab;
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO JOB1      DOB
          7844 TURNER     SALESMAN        7794 08-SEP-81       2178          0         30 SALESMAN
    Elapsed: 00:00:00.00
    satyaki>
    satyaki>
    satyaki>
    satyaki>
    satyaki>create table tran_tab
      2     as
      3       select * from emp
      4       where sal between 2000 and 7000;
    Table created.
    Elapsed: 00:00:00.00
    satyaki>
    satyaki>select * from tran_tab;
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO JOB1      DOB
          7844 TURNER     SALESMAN        7698 08-SEP-81       2178          0         30 SALESMAN
          7902 FORD       ANALYST         7566 03-DEC-81    5270.76                    20 ANALYST
    Elapsed: 00:00:00.00
    satyaki>
    satyaki>ed
    Wrote file afiedt.buf
      1  create or replace function fun(c_in number)
      2     return number
      3     is
      4       c_out number(4);
      5     begin
      6       if c_in < 7900 then
      7          c_out := 0;
      8       else
      9         c_out := 1;
    10       end if;
    11       return c_out;
    12*    end;
    13  /
    Function created.
    Elapsed: 00:00:01.00
    satyaki>
    satyaki>merge into hist_tab o
      2  using (
      3     select empno,
      4            ename,
      5            job,
      6            mgr,
      7            hiredate,
      8            sal,
      9            comm,
    10            deptno,
    11            job1,
    12            dob
    13     from (
    14              select k.*,
    15                     rank() over(order by fun(k.empno)) rn
    16              from tran_tab k
    17          )
    18     where rn = 1
    19     ) n
    20  on ( o.empno = n.empno)
    21  when matched then
    22    update set o.ename = n.ename,
    23               o.job = n.job,
    24               o.mgr = n.mgr,
    25               o.hiredate = n.hiredate,
    26               o.sal = n.sal,
    27               o.comm = n.comm,
    28               o.deptno = n.deptno,
    29               o.job1 = n.job1,
    30               o.dob = n.dob
    31  when not matched then
    32    insert(
    33            o.empno,
    34            o.ename,
    35            o.job,
    36            o.mgr,
    37            o.hiredate,
    38            o.sal,
    39            o.comm,
    40            o.deptno,
    41            o.job1,
    42            o.dob
    43          )
    44    values(
    45            n.empno,
    46            n.ename,
    47            n.job,
    48            n.mgr,
    49            n.hiredate,
    50            n.sal,
    51            n.comm,
    52            n.deptno,
    53            n.job1,
    54            n.dob
    55          );
    1 row merged.
    Elapsed: 00:00:00.03
    satyaki>
    satyaki>select * from hist_tab;
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO JOB1      DOB
          7844 TURNER     SALESMAN        7698 08-SEP-81       2178          0         30 SALESMAN
    Elapsed: 00:00:00.00
    satyaki>You can check the final output with old output. It is working perfectly - i guess.
    Regards.
    Satyaki De.

  • How to compare a parameter while calling a function?

    Hello,
    I have a powershell script with a function doing a switch process. While calling the function in the script I want to compare if the parameter is contained in the switch condition of the function.
    function test{
    [CmdletBinding()]
    Param(
    [Parameter(
    Mandatory=$False,
    ValueFromPipeline=$True,
    ValueFromPipelineByPropertyName=$False
    [string]$InputValue
    $Param = switch($InputValue){
    A {"string1,string2,string3"}
    B {"string1,string2,string3"}
    C {"string1,string2,string3"}
    Return $Param}
    If ((test($search)) -match ""){
    $scrDynMSGArry = (test($search)).Split(",")
    $NV = [PSCustomObject]@{
    Param = $ParamString1 = $scrDynMSGArry[0]
    String2 = $scrDynMSGArry[1]
    String3 = $scrDynMSGArry[2]
    Error message is: InvokeMethodOnNull for doing the split and reading the array.
    I think there is a problem doing the comparison but have no idea to solve this.
    Can anybody help?
    Regards, Doreen

    This appears to be what you are trying to do:
    \_(ツ)_/
    From how he is wording things, it sounds to me that if I pass $search the letter F, he wants to check to see if the switch statement contains a case for F, and if not do something. I do not think this can be done but he could always have a Default case,
    returning something to indicate they need to choose something else, or the default parameters needed for whatever he is doing to work.
    If you find that my post has answered your question, please mark it as the answer. If you find my post to be helpful in anyway, please click vote as helpful.
    Don't Retire Technet
    She please ;-)
    But clayman2 is right: $search can be F, G, ... but I want to use the function "test" only if its A,B or C.
    I thought if $search is F it does not enter the if part beacause the condition is not true:
    If ((test($search)) -match "")
    You think thats not possible?
    Would it be better to compare $search with my conditions (A, B or C are defined and known) for itself and then enter the function "test"? Can I have or conditions in the if part like
    If ($search -eq "A"){$scrDynMSGArry = (test($search)).Split(",")
    $NV = [PSCustomObject]@{
    String1 = $scrDynMSGArry[0]
    String2= $scrDynMSGArry[1]
    String3= $scrDynMSGArry[2]
    elseif ($search -eq "B"){$scrDynMSGArry = (test($search)).Split(",")
    elseif ($search -eq "C"){$scrDynMSGArry = (test($search)).Split(",")

  • How to call java function with parameter from javascript in adf mobile?

    how to call java function with parameter from javascript in adf mobile?

    The ADF Mobile Container Utilities API may be used from JavaScript or Java.
    Application Container APIs - 11g Release 2 (11.1.2.4.0)

  • Calling Web Service passing xml from Oracle Forms

    Hello,
    I need to call a .net web service from Oracle Forms that passes in xml data and returns xml data.
    I have seen several examples of how to create a wrapper in jdev and then to import the code
    into forms. I just have not seen any examples that are passing parmameters especially not xml
    as a parameter and that have an active wsdl that I can see how it relates to the code created.
    I have a wrapper but cannot figure out where and what notation to use to include passing in
    an xml object.
    Does anyone have an example passing in xml where the wsdl is still available to see?'
    Forms version 10.1.2.0.2. Jdev 10.1.3.4
    Thanks,
    Linda
    Edited by: lboyce on Jan 5, 2009 2:30 PM

    Also here you have several options...
    1. you can make a PJC (bean) which include a webservice stub generated with axis (you can make a stub and also test a webservice with this tool: www.soapui.org)..
    2. you can make a database webservice with JPublisher and then just call a pl/sql wrapper for this webservice
    4. you can call a webservice with java api (HttpsURLConnection, HttpURLConnection or with apache HTTPClient api) from your PJC for example:
    the code below is used as java stored procedure to call a .net webservice on https
    ====================================
    public static int getPStopnja(String polica, String reg_oznaka,
    String ime_osiguranika,
    String naziv_osiguranika,
    String leasing,
    String[] doc) {
    String l_polica="";
    String l_reg_oznaka="";
    String l_ime_osiguranika="";
    String l_naziv_osiguranika="";
    String l_leasing ="";
    URL url = null;
    HttpsURLConnection conn = null;
    BufferedReader br = null;
    String lineIn = null;
    StringBuffer sb = new StringBuffer();
    OutputStream os = null;
    int rc = 0;
    //kontrole
    l_polica = polica==null ? "":polica;
    l_reg_oznaka = reg_oznaka==null ? "": reg_oznaka;
    l_ime_osiguranika = ime_osiguranika==null ? "": ime_osiguranika;
    l_naziv_osiguranika = naziv_osiguranika==null ? "": naziv_osiguranika;
    l_leasing = leasing==null ? "": leasing;
    String body = "&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;";
    body += "&lt;soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:web=\"https://services.huo.hr/web_ao/\"&gt;";
    body += "&lt;soapenv:Header/&gt;";
    body += "&lt;soapenv:Body&gt;";
    body += "&lt;web:get_pstupanj&gt;";
    body += "&lt;web:param_in&gt;";
    body += "&lt;web:polica&gt;"+l_polica+"&lt;/web:polica&gt;";
    body += "&lt;web:reg_oznaka&gt;"+l_reg_oznaka+"&lt;/web:reg_oznaka&gt;";
    body += "&lt;web:ime_osiguranika&gt;"+l_ime_osiguranika+"&lt;/web:ime_osiguranika&gt;";
    body += "&lt;web:naziv_osiguranika&gt;"+l_naziv_osiguranika+"&lt;/web:naziv_osiguranika&gt;";
    body += "&lt;web:leasing&gt;"+l_leasing+"&lt;/web:leasing&gt;";
    body += "&lt;/web:param_in&gt;";
    body += "&lt;/web:get_pstupanj&gt;";
    body += "&lt;/soapenv:Body&gt;";
    body += "&lt;/soapenv:Envelope&gt;";
    SSLContext sslContext = null;
    try {
    sslContext = SSLContext.getInstance("TLS");
    X509TrustManager[] xtmArray = new X509TrustManager[|http://forums.oracle.com/forums/] { xtm };
    sslContext.init(null, xtmArray, new java.security.SecureRandom());
    } catch (GeneralSecurityException gse) {
    doc[0] = gse.toString();
    return -1;
    if (sslContext != null) {
    conn.setDefaultSSLSocketFactory(sslContext.getSocketFactory());
    try {
    conn.setDefaultHostnameVerifier(hnv);
    } catch (Exception ex) {
    doc[0] = ex.toString();
    return -1;
    try {
    URL st = new URL("https://services.huo.hr/web_ao/web_ao.asmx");
    conn = (HttpsURLConnection)st.openConnection();
    conn.setRequestMethod("POST");
    conn.setRequestProperty("Host", "services.huo.hr");
    conn.setRequestProperty("Content-Length", "" + body.length());
    conn.setRequestProperty("SOAPAction",
    "\"https://services.huo.hr/web_ao/get_pstupanj\"");
    conn.setRequestProperty("Content-Type", "text/xml;charset=UTF-8");
    conn.setDoOutput(true);
    OutputStreamWriter wr =
    new OutputStreamWriter(conn.getOutputStream());
    wr.write(body);
    wr.flush();
    BufferedReader in =
    new BufferedReader(new InputStreamReader(conn.getInputStream()));
    String inputLine;
    while ((inputLine = in.readLine()) != null) {
    sb.append(new String(inputLine.getBytes(),"UTF-8"));
    in.close();
    //System.out.println(new String(sb.toString().getBytes(),"ISO8559_2"));
    doc[0] = sb.toString();
    return 0;
    } catch (Exception e) {
    doc[0] = e.toString() + " ===&gt; " + body + " ==&gt;length= " + body.length();
    return -1;
    ====================================
    best regards
    Edited by: Peterv6i on Jan 6, 2009 8:34 AM
    Edited by: Peterv6i on Jan 6, 2009 8:40 AM

  • Issue while calling COBOL program from Component Interface in PeopleSoft HRMS 9.2

    In HRMS 9.2, I am facing problem while calling the remote call function through component interface. In GP_ABS_EESS_REQ (Navigation Main Menu > Self Service > Time Reporting > Report Time > Absence Request) component, we have “Forecast Balance” button as shown below:
    This button checks for eligibility for leave being applied. While using component interface, it executes FORCAST_PB field change event peoplecode which contains a remote call to a cobol program as below:
    RemoteCall("PSRCCBL", "PSCOBOLPROG", "GPPOLRUN", "NET_RETURN_CD", &NET_RETURN_CD, "NET_TXN_ID", &NET_TXN_ID, "NET_TXN_NUM", &NET_TXN_NUM, "NET_MSG_ID", &NET_MSG_ID, "NET_MSG_PRM_CNT", &NET_MSG_PRM_CNT, "NET_MSG_PRM1", &NET_MSG_PRM1, "NET_MSG_PRM2", &NET_MSG_PRM2, "NET_MSG_PRM3", &NET_MSG_PRM3);
    I am getting following error while executing it via component interface:
    (2,148) - Think-time PeopleCode event (RemoteCall), but a SQL update has occurred in the commit interval. (2,148) FUNCLIB_GP_ABS.FCST_PB.FieldFormula Name:Abs_ForecastExec  PCPC:5311  Statement:60
    Called from:GP_ABS_EESS_REQ.GBL.DERIVED_ABS_SS.FCST_PB.FieldChange  Statement:26
    (91,34) - Error changing value. {Z_GP_ABS_EESS_REQ_CI.FCST_PB} (91,34)
    (18,2) - Data being added conflicts with existing data. (18,2)
    (91,37) - Error saving Component Interface. {Z_GP_ABS_EESS_REQ_CI} (91,37)
      After commenting out this line of code, I was able to save the CI successfully. But I need to execute this statement before saving CI so that I can check the eligibility for leave being applied. Can anyone help me on this issue?

    When I tried to read the file using `CAT -vt <filename>`, I could see that the file contains special characters such as ^M and ^I. This may be because of the file transfer mode(but I transferred in ASCII mode, still the special characters where appearing).
    I opened a VI editor and pasted the same script. Save the file, tried to run the script, It was working fine.
    I still didn't get how the special characters appeared. I used notepad++ as my editor.

  • Authentication Issues while calling from OSB to REST

    I am routing from a proxy Service in OSB to a REST ful Web Services.I need to apply security settings while calling REST ful services so i created groups which has users who can only call the Web Services.I did all the security settings in the weblogic Server console.
    The authentication works fine but the problem is that when i doesnot give any username or password it should give me a "Authentication required" error.But instead it calls the web services .I need not want that to happen.
    Anyone pls help me in this issue

    My proxy service uses a http protocol and gets the query string and routes it to the business service which is a REST ful based web services.My need is to apply security settings betwwen business service and service component(REST ful based web services).
    I created the security settings in weblogic server console using the following steps
    1.I created an user in the user and groups option in the security realm tab with Default Authenticator as provider selected
    2.I created a Stand-Alone Web Application Scoped Role in the application scope in the security tab with XACML RoleMapper as the provider selected in the war(REST ful web services) file deployed in the console.
    3.I added the user created in the security realm tab in this Stand-Alone Web Application Scoped Role created.
    I then tested the business service(which connects to the REST ful web service component) with username and password in the transport option in testing console as the one created in the server console.
    The business service gives the response only when the username and password matches to the one created or when username/password is weblogic/welcome1(this is the username and password given while creating the OSB domain).
    It should throw me an Authentication failed error when the username is wrong and that works except for the condition that the username and password is empty.
    How to make the service to throw an error when the username and password is empty like the same as when the username is mismatched.
    Help me out in this issue.

  • CNTL_ERROR while calling a function module from Java webdynpro

    I am calling a RFC function module from javawebdynpro app
    which inturn calls a function module performing BDC on CAPP transaction. When I run this from SE37 of the same system or a different system everything works fine. But when called from Java webdynpro app, it raises a CNTL_ERROR exception and creates a short dump.
    Any help on this is highly appreciated

    Good catch, BI Learner. This was exactly it: when assigning the values from SOURCEFIELDS directly to the import/export parameters, you have to make sure that the types are EXACTLY the same, otherwise it will not work (the routine stops with an error when calling the FM, but there is no dump).
    Therefore, to solve my problem, I created the declarations precisely as expected by the FM and assigned the values to these fields:
    DATA:
          SOURCEVAL TYPE  /BIC/OIINVQTY,
          SOURCEUOM TYPE  /BIC/OIUSUOM,
          USITM TYPE  /BIC/OIUSITM,
          TARGETUOM TYPE  /BIC/OIUSUOM,
          CONVERTED_COST TYPE  /BIC/OIINVQTY.
    DATA PRODUCTION_UOM TYPE /BIC/OIUSUOM.
    " get the Production UOM
        SELECT SINGLE I~/BIC/USPRDUOM
          FROM /BIC/PUSITM AS I
          INTO PRODUCTION_UOM
          WHERE I~/BIC/USITM = SOURCE_FIELDS-/BIC/USITM AND I~OBJVERS = 'A'.
        IF ( SY-SUBRC = 4 ). " no records found
          "RAISE PARTNO_NOT_FOUND.
          RAISE EXCEPTION TYPE CX_RSROUT_SKIP_RECORD.
        ENDIF.
    " load the parameters
        SOURCEVAL = SOURCE_FIELDS-/BIC/USFRZMFC.
        SOURCEUOM = SOURCE_FIELDS-BASE_UOM.
        USITM = SOURCE_FIELDS-/BIC/USITM.
    " then you can call the FM
        CALL FUNCTION 'Z_CA_CONVERT_US_COST'
          EXPORTING
            PSOURCEVAL                = SOURCEVAL
            PSOURCEUOM                = SOURCEUOM
            PUSITM                    = USITM
            PTARGETUOM                = PRODUCTION_UOM
          IMPORTING
            PTARGETVAL                = CONVERTED_COST
          EXCEPTIONS
            CONVERSION_NOT_MAINTAINED = 1
            PARTNO_NOT_FOUND          = 2
            OTHERS                    = 3.
    " ... [do the rest]
    Thanks for your help,
    Dennis

  • Invalid column type error while calling db function.

    We are getting an exception while calling the database function which returns a Varray of objects. We are using jpub to generate the wrapper method, ran sqlj to generate the JDBC code. The environment is weblogic 5.1 EJB container with ORacle 8.1.6.0.0 database. The JDBC driver is 8.1.7 thin, sqlj version is 8.1.7. I am giving below the exception.
    When the sqlj option profile=false is not set, the error is Classcast exception. Appraently the weblogic connection object can not be used to do oracle specific calls. If somebody has done similar things(creating a bean which calls the stored function with weblogic which returns the oracle object types) or know what the issue is, please let me know.
    Thanks,
    Vijay.
    stackTrace:
    java.sql.SQLException: Invalid column type
    at java.lang.Throwable.fillInStackTrace(Native Method)
    at java.lang.Throwable.fillInStackTrace(Compiled Code)
    at java.lang.Throwable.<init>(Compiled Code)
    at java.lang.Exception.<init>(Compiled Code)
    at java.sql.SQLException.<init>(SQLException.java:43)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:273)
    at oracle.jdbc.driver.OracleStatement.get_internal_type(OracleStatement.java:4560)
    at oracle.jdbc.driver.OracleCallableStatement.registerOutParameter(OracleCallableStatement.java:225)
    at oracle.jdbc.driver.OracleCallableStatement.registerOutParameter(OracleCallableStatement.java:350)
    at weblogic.jdbcbase.pool.Statement.registerOutParameter(Statement.java:438)
    at sqlj.runtime.profile.ref.RTStatementJDBCCallable.registerOutParameter(RTStatementJDBCCallable.java:135)
    at sqlj.runtime.profile.ref.ParamRegProfile$ParamRegCachedStatement.registerParameters(Compiled Code)
    at sqlj.runtime.profile.ref.ParamRegProfile$ParamRegCachedStatement.getStatement(ParamRegProfile.java:101)
    at sqlj.runtime.profile.ref.CachedStatementProfileWrapper.getStatement(CachedStatementProfileWrapper.java:134)
    at sqlj.runtime.ExecutionContext$StatementStack.setStatement(ExecutionContext.java:995)
    at sqlj.runtime.ExecutionContext.registerStatement(ExecutionContext.java:523)
    at com.xpede.calculator.processor.jdbc.NewPrdGroupPkg.maincalculator(NewPrdGroupPkg.java:341)
    ----------------------

    Weblogic essentially wrappers the Oracle JDBC driver - as you can see from the stack trace, it does not just wrapper the connection object, but also the statement object.
    The SQLJ runtime does not recognize the JDBC layer anymore as an Oracle JDBC driver.
    What is happening at runtime may be the following:
    (1) The invalid column type likely results from SQLJ attempting to register the type as Types.OTHER (code 1111). This typecode is not supported by Oracle JDBC.
    (2) The class cast exception when using Oracle objects may result from a getObject() call which returns the value in default format (such as oracle.sql.ARRAY) rather than the JPublisher-generated wrapper object.
    Are you using JDK 1.2 / runtime12.zip?
    In that case you can try the standard (java.sql.)SQLData interface (in JPub: -usertypes=jdbc). However, this interface will not support wrappers for VARRAYs.

  • JDBC issue while calling queries in oracle- urgent

    Hi !
    Theres a peculiar problem being faced while calling queries(SQL statements having join of more than 2 tables) in oracle database. We are using JDBC thin driver.
    We are calling SQL statements from stateless session EJBs deployed in weblogic app server and using connection pool facility to connect to oracle database.
    Now, the issue is that select queries having more then 2 tables run fine & give proper result in java but when we see trace in oracle by setting sql_trace to true.. we see some column rowid added as first column selected in such queries and oracle shows such queries to be failed.
    Can anyone tell why & how & who adds this rowid ?
    Has anyone faces such a problem ?
    regards'

    Am I right in you saying that the data is returned to the app server, but the database is saying it's not???
    Veeeeeerrrry strange.
    ...I mean, if I understand you right, then I have to ask if you're sure that's what's actually happening.
    Can anyone tell why & how & who adds this rowid?...and that you're sure you're not adding this yourself in the join?
    ...since (you imply) you're not using entities, just sql queries against the datasource connection, did you try running that query direct against the database?
    ...and... oh never mind.
    hth
    /k1

  • Call native function fflush & strprn from java

    Hi,
    I need to call a native function fflush and stdprn from java for printing a file.
    How can i call this function?
    Can any one help me with sample code.
    Thanks,
    rpalanivelu

    Thanks your reply,
    Actually my problem is need to take printout using dot matrix printer(text printer) with different font size.
    So, i am using native method which is available in c.
    in c program i am using fflush,stdprn and fprintf.
    Here i've attached my sample program also.
    #include <jni.h>
    #include "NativePrint.h"
    #include <stdio.h>
    #include <string.h>
    #include <stdlib.h>
    #define MAXLINE_LEN 100
    JNIEXPORT jint JNICALL
    Java_NativePrint_dotMatrixPrint(JNIEnv* env, jobject obj )
    FILE *fp;
    char filename[20];
    char line[100]; /* A line read from the file */
    int lineNumber = 0;
    /* Print control codes */
    char boldOn = 14;
    char boldOff = 20;
    char contentlenOn = 15;
    char contentlenOff = 18;
    printf("Printing from C3");
    strcpy( filename , "sayHello.c" );
    /* Open the file in read mode */
    fp = fopen( filename , "r" );
    /* Error in opening file, then exit */
    if ( fp == NULL )
    printf( "\nERROR: %s cannot be opened\n" , filename );
    exit( 1 );
    while ( fgets( line , 100 , fp ) != NULL )
    lineNumber++; /* Line we are about to process next */
    printf("%s",line);
    /* If this is the first line */
    if ( lineNumber == 1 )
    /* then print it in bold */
    //fprintf( stdprn , "%c" , boldOn );
    fprintf( stdprn , "%c" , contentlenOn );
    fprintf( stdprn , line );
    fprintf( stdprn , "%c" , contentlenOff);
    //fprintf( stdprn , "%c" , boldOff );
    else
    /* else print it in normal mode */
    fprintf( stdprn , line );
    fflush(stdprn);
    return 0;

  • INTERNAL_SERVER_ERROR    while Calling SCMS_HTTP_CREATE Function Module

    Dear All,
    We want to attach document (PDF, DOCX, TXT etc.) in DMS using WD application.
    We converted data xstring to binary format. Now when we call Function Module SCMS_HTTP_CREATE, it gives SY-SUBRC = 5. INTERNAL_SERVER_ERROR.
    Code:
    *"*"Local Interface:
    *"  IMPORTING
    *"     VALUE(IV_ARCHIV_ID) TYPE  TOAOM-ARCHIV_ID
    *"     VALUE(IV_AR_OBJECT) TYPE  TOAOM-AR_OBJECT
    *"     VALUE(IV_OBJECT_ID) TYPE  SAPB-SAPOBJID
    *"     VALUE(IV_SAP_OBJECT) TYPE  TOAOM-SAP_OBJECT
    *"     VALUE(IV_LENGTH) TYPE  I
    *"     VALUE(IV_MIMETYPE) TYPE  STRING
    *"     VALUE(IT_DATA) TYPE  ZTAB
    *"  EXPORTING
    *"     VALUE(EV_FLAG) TYPE  CHAR1
    *"     VALUE(EV_DOC_ID) TYPE  SAEARDOID
    DATA : LV_ARC_DOC TYPE SYSUUID-C,
            LV_MIMETYPE TYPE W3CONTTYPE,
            LV_ARCDOC TYPE TOAV0-ARC_DOC_ID.
    CALL FUNCTION 'SYSTEM_UUID_C_CREATE'
      IMPORTING
        UUID          = LV_ARC_DOC.
    CALL FUNCTION 'SCMS_FE_GROUP_OPEN'.
    LV_MIMETYPE = IV_MIMETYPE.
    CALL FUNCTION 'SCMS_HTTP_CREATE'
       EXPORTING
        MANDT                       = SY-MANDT
         CREP_ID                     = IV_ARCHIV_ID
        DOC_ID                      = LV_ARC_DOC
        COMP_ID                     = 'data'
        MIMETYPE                    = LV_MIMETYPE
         LENGTH                      = IV_LENGTH
    *   SIGNATURE                   = 'X'
    *   DOC_PROT                    = 'rcud'
    *   TEXT_MODE                   = ' '
    *   ACCESSMODE                  = 'c'
    *   SECURITY                    = ' '
    *   OVERWRITE                   = '-'
    * IMPORTING
    *   DOC_ID_OUT                  =
       TABLES
         DATA                        = IT_DATA
      EXCEPTIONS
        BAD_REQUEST                 = 1
        UNAUTHORIZED                = 2
        FORBIDDEN                   = 3
        CONFLICT                    = 4
        INTERNAL_SERVER_ERROR       = 5
        ERROR_HTTP                  = 6
        ERROR_URL                   = 7
        ERROR_SIGNATURE             = 8
        ERROR_PARAMETER             = 9
        OTHERS                      = 10
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL FUNCTION 'SCMS_FE_GROUP_CLOSE'
    LV_ARCDOC = LV_ARC_DOC.
    CALL FUNCTION 'ARCHIV_CONNECTION_INSERT'
       EXPORTING
        ARCHIV_ID                    = IV_ARCHIV_ID
         ARC_DOC_ID                  = LV_ARCDOC
    *   AR_DATE                     = ' '
         AR_OBJECT                   = IV_AR_OBJECT
    *   DEL_DATE                    = ' '
    *   MANDANT                     = ' '
         OBJECT_ID                   = IV_OBJECT_ID
         SAP_OBJECT                  = IV_SAP_OBJECT
    *   DOC_TYPE                    = ' '
    *   BARCODE                     = ' '
      EXCEPTIONS
        ERROR_CONNECTIONTABLE       = 1
        OTHERS                      = 2
    IF SY-SUBRC <> 0.
    ** MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    While Calling FM 'SCMS_HTTP_CREATE' is Raise Exception 5 INTERNAL_SERVER_ERROR.
    Thanks
    Regards
    Rohit      

    Hi,
    Content-Type: application/xml
    ...check for the content type of the message that is sent ot the WS.....with the above mentioned content-type going to the WS currently...WS is not able to parse the req and hence the error....in other words wrong format being being passed.
    Regards,
    ABhishek.

  • Dot source/calling a function with switch from the cmd line

    Hi
    This is driving me crazy and I know its something really obvious.
    If I have an example script like so, called myexample.ps1
    [CmdletBinding()]
    param
    [Parameter(Mandatory=$false, HelpMessage="My Switch")]
    [switch] $Myswitch,
    [Parameter(Mandatory=$false, HelpMessage="Email Address")]
    [string] $email
    Function Main
    [CmdletBinding()]
    param
    [switch] $Myswitch,
    [string] $email
    if ($Myswitch)
    Write-Host "Switch Enabled"
    Write-Host "Email is $email"
    else
    Write-Host "Switch Disabled"
    Write-Host "Email is $email"
    Main -email $email #This is the line that I think is at fault
    I have two issues
    1) How do I correctly write the code so that the script can be called with either or both parameters. The switch ($Myswitch) is the one that is really causing me issues.
    2) Is invoking it the easiest method/best/most common method of calling it via a batch file
    Here's my understanding
    a) I could dot source it (. .\myexample.ps1) to load the functions into the current session, then call the function
    Main -email hello.com -Myswitch
    or
    Main -email hello.com
    b) or I could Invoke it, which I think is my preference as my final goal here is for it to be called via a batch file in a scheduled task
    & 'C:\Users\myusername\Desktop\MyExample.ps1' -email hello -myswitch
    or
    & 'C:\Users\myusername\Desktop\MyExample.ps1' -email hello
    Any push in the right direction will be appreciated :)

    Why the function?  Just call the file.  We don't "Invoke" scripts. Just call the script..
    # MyExample.ps1
    [CmdletBinding()]
    param(
    [Parameter(Mandatory=$false, HelpMessage="My Switch")]
    [switch] $Myswitch,
    [Parameter(Mandatory=$false, HelpMessage="Email Address")]
    [string] $email
    if ($Myswitch){
    Write-Host "Switch Enabled"
    Write-Host "Email is $email"
    }else{
    Write-Host "Switch Disabled"
    Write-Host "Email is $email"
    Now jsut call it like a normal script:
    .\MyExample.ps1 -email someemail -MySwitch
    It is as simple as that.
    If it has to be a function as in a library then you must either dot source or create a module.
    ¯\_(ツ)_/¯

  • Error in PeopleTools 8.48 while calling CI based Web Services from BPEL

    Hi All,
    I am working with a CI based web serives and using the PeopleSoft generated wsdl file while calling from a BPEL process. When I am using the same component in PeopleTools 8.47, it's working fine. But the same is NOT working when I'm using PeopleTools 8.48 using the same BPEL server and program.
    Here is the error message :-
    exception on JaxRpc invoke: HTTP transport error: javax.xml.soap.SOAPException: java.security.PrivilegedActionException: javax.xml.soap.SOAPException: Message send failed: oracle_endpoint: oracle_endpoint.
    Please help if you know the answer.

    Hi,
    You need to download all the associated xml schemas from PeopleSoft portal and store them in the path where you are creating BPEL process, it's different from what we used to do in PeopleTools 8.47 ( there was only one wsdl file), whereas in PeopleTools 8.48 you need to copy all associated xml schemas.
    But I m not able to find out why the native JAVA error is thrown, do I need to provide some patches?

Maybe you are looking for