Error in dynamic query while sort allowed is true

Dear all
I m entering search creteria dynamically and search result comes in a table.I have set Sort allowed true for all colum in that table.So when I click on any colum for sorting and then search data, an order by clause will be added before dynamic section of the code.
and query becomes as -
SELECT pp.name,
pp.segment1 project_number,
pp.project_status_code,
pps.project_status_name,
pp.carrying_out_organization_id,
hau.name organization,
pp.project_type,
pp.project_id,
pp.start_date,
pp.completion_date
FROM pa_projects pp,
pa_project_statuses pps,
hr_all_organization_units_v hau
WHERE pp.project_status_code = pps.project_status_code AND
pp.carrying_out_organization_id = hau.organization_id AND
pp.template_flag <> 'Y') QRSLT ORDER BY PROJECT_NUMBER asc AND pps.project_status_name ='Active'
as u can see at the last line of code ' ORDER BY PROJECT_NUMBER asc ' is added before qynamic section 'AND pps.project_status_name ='Active' and it makes query invalid.
If u have any suggestions ,Plz let me know.
Thanks
bhupendra

Bhupendra,
As per Oracle SQL Standard "Order by clause" always be the last synatx of Query.
As per OAF Standard , always avoid for dynamic query, instead we can create View Object.
As you are created dynamic query with "order by clause" syntax., The code is also adding where clause after the order by clause. So you are getting the error.
So Delete the "order by clause", it will work fine.
After adding the where clause (i.e. AND pps.project_status_name ='Active' ), You should add the setOrderByClause();
Thanks,
Kumar

Similar Messages

  • Error from bex query while executing in portal

    Dear Experts,
    while executing the query bex analyzer, is working ok but the same query when executing in portal is throwing the following error:
    error message:
    The initial exception that caused the request to fail was:
    Termination message sent
    ABEND RS_EXCEPTION (000): The argument '0,01' cannot be interpreted as a number
      MSGV1: The argument '0,01' cannot be interpreted as a
      MSGV2: number
    Messages
    ABEND: The argument '0,01' cannot be interpreted as a number
    ABEND: An exception with the type CX_SY_CONVERSION_NO_NUMBER occurred, but was neither handled locally, nor declared in a RAISING
    ABEND: Program error in class SAPMSSY1 method : UNCAUGHT_EXCEPTION
    I tried to find from existing blogs but did not get suggestions for similar issue.
    Coud some be kind enought to analyse this error.
    Inputs will highly been appreciated
    Thanks in advance,

    Hi,
    Here I tried retransporting the depended bex queries accross the landscape.
    Now the reports are OK from the Portal.
    Thanks,
    Mannu

  • SAP MII 14.0 SP5 Patch 11 - Error has occurred while processing data stream Dynamic Query role is not assigned to the Data Server

    Hello All,
    We are using a two tier architecture.
    Our Corp server calls the refinery server.
    Our CORP MII server uses user id abc_user to connect to the refinery data server.
    The user id abc_user has the SAP_xMII_Dynamic_Query role.
    The data server also has the checkbox for allow dynamic query enabled.
    But we are still getting the following error
    Error has occurred while processing data stream
    Dynamic Query role is not assigned to the Data Server; Use query template
    Once we add the SAP_xMII_Dynamic_Query role to the data server everything works fine. Is this feature by design ?
    Thanks,
    Kiran

    Thanks Anushree !!
    I thought that just adding the role to the user and enabling the dynamic query checkbox on the data server should work.
    But we even needed to add the role to the data server.
    Thanks,
    Kiran

  • Dynamic query in where clause while looping in an internal table.

    Hi,
    Had a small question : How can i make a dynamic query for the WHERE clause while looping at an internal table.
    i want to implement a dynamic where clause query for the below example.
    it_cfx_col is an internal table and wa_cfx_col is a work area for it_cfx_col
      DATA :
      i_cfx_col TYPE TABLE OF cfx_col,
      wa_cfx_col LIKE LINE OF i_cfx_col.
    DATA : count TYPE i VALUE 0.
    DATA : l_where_clause TYPE string,
             l_where_clause2 TYPE string,
             l_name type string.
    l_name = 'NANDANOM'.
    l_scenario = 'collaboration'.
    LOOP AT it_cfx_col INTO wa_cfx_col
    WHERE CREATED_BY = l_name
    AND SCENARIO = l_scenario.
    count = count + 1.
    some business logic implemented using the work area wa_cfx_col
    endloop.
    Now i want to write a dynamic query for the where clause.
    DATA : count TYPE i VALUE 0.
      DATA : l_where_clause TYPE string,
             l_where_clause2 TYPE string,
             l_name type string.
    l_name = 'NANDANOM'.
    l_scenario = 'collaboration'.
      l_where_clause = 'CREATED_BY = l_name'.
      l_where_clause2 = 'AND SCENARIO = l_scenario'.
    if l_scenario is not initial.
      CONCATENATE  l_where_clause l_where_clause2
      INTO l_where_clause SEPARATED BY space.
    endif.
    LOOP AT i_cfx_col INTO wa_cfx_col
    WHERE (l_where_clause).
    count = count + 1.
    some business logic implemented using the work area wa_cfx_col
    endloop.
    when i compile this i get an error message as { Statement concluding with "...(l_where_clause)" ended unexpectedly}
    Even i changed the initilization of the variable  l_where_clause2 to [ l_where_clause2 = 'AND SCENARIO = l_scenario.'. ]
    added the end of line demarkation ".", but still i got the same error message.
    Is it a limtation in ABAP that i cannot write a dynamic query for the where clause while looping at an internal table?
    Regards,
    om

    Hi savita,
    there in no such 1 limitaion in abap for dynamic query .. i think the  error meassge is only beacuse of your synatx delcartaion.
    >> LOOP AT i_cfx_col INTO wa_cfx_col
       WHERE (l_where_clause).
       count = count + 1.
    some business logic implemented using the work     area    wa_cfx_col
       endloop.
    afted delclarataion also , in the where statement you should specify both the field name and value bname
       LOOP AT i_cfx_col INTO wa_cfx_col
       WHERE l_where_clause = 'CREATED_BY = l_name' .
       count = count + 1.
    hope it helps.
    regads
    priya.

  • Sort problem on dynamic query !!

    Hi,
    I have a dynamic query written in pl/sql, when I check "Sort" for each field in Report Attribute, error message raised up as "ORA-01785: ORDER BY item must be the number of a SELECT-list expression".
    If I do not check Sort, it works fine. In my apps I need all fields sorted by user, how to fix this problem?
    My query as below:
    declare
    query varchar2(2000):='select';
    s_class varchar2(1000);
    cursor c1 is select * from demo_preference;
    begin
    for c1_val in c1 loop
    if c1_val.login is not null then
    query := query ||' ' || 'login' || ',';
    end if;
    if c1_val.id is not null then
    query := query ||' ' || 'id' || ',';
    end if;
    end loop;
    query := SUBSTR(query, 1, length(query)-1);
    s_class := '(NVL(:P2_class, ''%'' || ''null%'') = ''%'' || ''null%'' OR
    EXISTS (SELECT 1 FROM apex_collections WHERE collection_name = ''P2CLASSCOL'' AND c001 = class))';
    query := query ||' ' || 'from ming.reg_report_view1 where'
    || ' ' || s_class;
    return(query);
    end;

    Maybe the internally mapped column used when you clicked on sort is not shown in the report. Try using aliases when you construct the query string, it could help apex internally in identifying a column even if its order changes for a different user. After all the column order in the code is dynamic and I guess even the no of columns displayed might vary both of which could make sorting on a column identified with a number, invalid.
    How about displaying the report query somewhere, so that you know what is the exact query being processed, it might give you better information about the problem.
    If the problem persists, then use a collection that is fetched those record using the same query string and change the report to refer the collection and then set column sorting on. This way apex would get confused on what columns are being sorted and it would just sort on a c001..c050 column as though it was a string(yes problems with number columns sorting when you do this).

  • Error in the Dynamic query in AME

    Hi Experts,
    I am using the below query but i am facing the error "Ensure the query selects exactly 1 column" in AME Approval group under Dynamic query.
    But the query returns only one column when i ran in toad.
    select 'person_id:'||a.person_id  from
    (SELECT to_number(EXTRACT(column_value,'/e/text()')) person_id
    from (select (XXSYK_GET_PERSON_ID(:transactionId)) col1 from dual) x,
    TABLE(XMLSEQUENCE(EXTRACT(XMLTYPE('<ROW><e>'||REPLACE(col1,',','</e><e>')||'</e></ROW>'),'//e')))
    )A
    Thanks,
    Sadeesh

    Thanks !!!!

  • Query a stored procedure that exec's a dynamic query. Error Linked server indicates object has no columns

    I have a stored procedure that dynamically creates a pivot query.  The procedure works and returns the correct data.  Now I have a requirement to show this data in reporting system that can only pull from a table or view.  Since you can not
    create a dynamic query in a view I tried to do a select from using openquery. 
    Example 'Select * from OpenQuery([MyServername], 'Exec Instance.Schema.StoredProcedure')
    I get the error back "the linked server indicates the object has no columns".  I assume this is because of the first select statement that is stuffing the variable with column names. 
    CODE FROM PROCEDURE
    Alter PROCEDURE [dbo].[Procedure1]
    AS
    BEGIN
    SET NOCOUNT ON
    Declare @cols nvarchar(2000),
      @Tcols nvarchar(2000),
      @Sql nvarchar (max)
    select @cols = stuff ((
          Select distinct '], ['+ModelName + '  ' + CombustorName
           from CombustorFuel cf
           join Model m on cf.modelid = m.modelid
           join Combustors cb on cf.CombustorID = cb.CombustorID
           where cf.CombustorID > 0
           for XML Path('')
          ),1,2,'')+']'
    Set @Tcols = replace(@Cols, ']', '] int')
    --Print @Tcols   
    --Print @Cols
    Set @Sql = 'Select GasLiquid, FuelType, '+ @Cols +'
    from
     Select GasLiquid, FuelType, ModelName+ ''  '' +CombustorName ModelCombustor, CombFuelStatus+''- ''+CombFuelNote CombFuelStatusNote
      from Frames f
      join Family fa on f.Frameid = fa.frameid
      join Model m on fa.FamilyID = m.FamilyID
      join CombustorFuel cf on m.Modelid = cf.modelid
      Join Combustors c on cf.CombustorId = c.CombustorID
      join FuelTypes ft on cf.FuelTypeID = ft.FuelTypeID
      where cf.CombustorFuelID > 0
        and CombustorName <> ''''
     ) up
    Pivot
     (max(CombFuelStatusNote) for ModelCombustor in ('+ @Cols +')) as pvt
    order by FuelType'
    exec (@Sql)

    Then again, a good reporting tool should be able to do dynamic pivot on its own, because dynamic pivoting is a presentation feature.
    SSRS Supports dynamic columns: Displaying Dynamic Columns in SSRS Report
    SQL Reporting Services with Dynamic Column Reports
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Database Design
    New Book / Kindle: Beginner Database Design & SQL Programming Using Microsoft SQL Server 2014
    Displaying and reading are two very different things.
    #1) SSRS Needs a fixed field list on the input side to know what what to make available in the designer.
    #2) SSRS cant read "exec (@Sql)" out of a proc, even if there is a fixed number of columns (at
    least it can't use it to auto build the field list from the proc)
    I use dynamic SQL in my report procs on a fairly regular basis and I've found it easiest to simply dump
    the results of my dynamic sql into a temp table at the end of the procs and then select from the temp table.
    Basically, Erland is correct. Stop trying to pivot in the query and let SSRS (or whatever reporting software you're using) handle it with a Martix.
    Jason Long

  • Conditional URL ( CASE )  within a Dynamic Query

    I need extra eyes or help in RE-FORMATTING the following SELECT STMT. My approach was to formulate the following query to get a functioning URL to the page that displayed the corrections made on that record (if it was corrected)...which I did. So now I'm trying to move the CASE portion into a dynamic query report. I'm having difficulties rewriting the CASE into the dynamic query due to placement of single-quotes. Is there an easy way to do this...or do I still need to find the correct placement of quotes? HELP!
    select "ID",
    "EMP_ID",
    "ENTRY_DATE",
    "JOB_TITLE",
    "START_DATE",
    "END_DATE",
    "MODIFIED_DATE",
    "lkup_1"."DESCRIPTION" as "Status",
    CASE
    WHEN rec_status = 'CR' -- corrected record
    THEN '<a href="'
                      || 'f?p=&APP_ID.:90:&SESSION.::&DEBUG.::'
                      || 'P90_RID,P90_TIMESTAMP:'
                      || rid ||',' || TO_CHAR(modified_date,'MM/DD/YYYY')
                      || ">'
    || 'See Update(s)'
    || '</a>'
    || '</a>'
    ELSE NULL
    END LINK,
    "lkup_2"."DESCRIPTION" as "Action",
    "CATEGORY",
    apex_item.checkbox(1,rid) as "Confirm"
    from "JOB_SUMMARIES",
    "LOOKUPS" "lkup_1",
    "LOOKUPS" "lkup_2"
    where "REC_STATUS" <> 'CF'
    and "REC_STATUS" = "lkup_1"."CODE"
    and "ACTION" = "lkup_2"."CODE"(+)
    Here is what I sort of come up with, but I'm getting dizzy looking at it so many times!
    ' CASE '||
    ' WHEN rec_status = ' || '''' || '''CR''' || '''' ||
    ' THEN ' || '''' || '<a href="' || '''' ||
             '            ||' || '''' || 'f?p=&APP_ID.:90:&SESSION.::&DEBUG.::' || '''' ||
             '            ||' || '''' || 'P90_RID,P90_TIMESTAMP:' || '''' ||
             '            ||' || ' id ||' || '''' || ''',''' || '''' || '|| TO_CHAR(modified_date,' || '''' || 'MM/DD/YYYY' || '''' || ')' || '''' ||
             '            ||' || '''' || ">' || '''' ||
    ' ||' || '''' || 'See Update(s)' || '''' ||
    ' ||' || '''' || '</a>' || '''' ||
    ' ||' || '''' || '</a>' || '''' ||
    ' ELSE NULL '||
    ' END LINK, '||
    I'm still getting an error which is:
    1 error has occurred
    * Query cannot be parsed within the Builder. If you believe your query is syntactically correct,
    check the ''generic columns'' checkbox below the region source to proceed without parsing.
    ORA-00905: missing keyword

    I still cannot get the insertion of the CASE to compile...I keep getting MISSING EXPRESSION error.
    1 error has occurred
    * Query cannot be parsed within the Builder. If you believe your query is syntactically correct,
    check the ''generic columns'' checkbox below the region source to proceed without parsing.
    ORA-00936: missing expression
    Here is my dynamic query and I want to place the CASE as indicated. The numerous quotes or the Q syntax is really messing up my attempts to get this page working. I have a dynamic query because I am allowing search parameters. And I thought it would be nice to have a LINK to another page that displayed changed column values if a user CORRECTED one of their records. All changes must be verified and accepted by a REVIEWER.
    declare
    q varchar2(32767); -- query
    w varchar2(4000) ; -- where clause
    we varchar2(1) := 'N'; -- identifies if where clause exists
    begin
    q := 'select "ID", '||
    ' "EMP_ID", '||
    ' "ENTRY_DATE", '||
    ' "JOB_TITLE", '||
    ' "START_DATE", '||
    ' "END_DATE", '||
    ' "lkup_1"."DESCRIPTION" as "Status", '||
    >WANT TO PLACE CASE RIGHT HERE
    ' "lk_up2"."DESCRIPTION" as "Action", '||
    ' "CATEGORY", '||
    ' apex_item.checkbox(1,rid) as "Confirm" '||
    ' from "#OWNER#"."JOB_SUMMARIES", '||
    ' "#OWNER#"."LOOKUPS" "lkup_1", '||
    ' "#OWNER#"."LOOKUPS" "lkup_2" '||
    ' where "REC_STATUS" <> ' || '''' || 'CF' || '''' ||
    ' and "REC_STATUS" = "lkup_1"."CODE" '||
    ' and "ACTION" = "lkup_2"."CODE"(+) ';
    if :P16_EMP_ID != '-1'
    then
    w := ' AND EMP_ID = :P16_EMP_ID ';
    we := 'Y';
    end if;
    if :P16_RECORD_STATUS != '-1'
    then
    w := w || ' AND REC_STATUS = :P16_RECORD_STATUS ';
    we := 'Y';
    end if;
    if :P16_CATEGORY != '-1'
    then
    w := w || ' AND CATEGORY = :P16_CATEGORY ';
    we := 'Y';
    end if;
    if we = 'Y'
    then q := q || w;
    end if;
    return q;
    end;
    Edited by: JSandoval on Aug 10, 2009 3:42 PM

  • Address list error -- 5.7.1 Relaying not allowed

    Hi,
    We have setup the Java Messaging Server to send/recieve mails from a gateway. The inbound mail flow works perfectly but, the outbound mail flow has issues.
    The outbound mails are not hitting the gateway. When checked the log for outbound mail, it displays the address list error - 5.7.1 Relaying not allowed for any domain i.e gmail.com, etc
    version:
    Sun Java(tm) System Messaging Server 6.3-5.02 (built Oct 12 2007; 32bit)
    libimta.so 6.3-5.02 (built 17:15:31, Oct 12 2007; 32bit)
    SunOS P1192FLPLN 5.9 Generic_118558-02 sun4u sparc SUNW,Sun-Fire
    here is the log for reference...
    =========================================================================
    root@P1192FLPLN # /opt/SUNWmsgsr/sbin/imsimta test -rewrite -debug -source_channel=tcp_local [email protected] [email protected]
    Initializing mm_.
    Initializing mm_ submission.
    Checking identifiers.
    *** Debug output from initializing MM for submission:
    17:09:37.43: Debug output enabled, system P1192FLPLN.extmail.xyz.com, process 3fbf.1, message enqueue routines version V6.3 compiled Oct 12 2007 17:15:38
    17:09:37.43: mmc_winit('tcp_local','[email protected]','') called.
    17:09:37.43: Address reversal invoked on [email protected], force reverse URL 1, capture 1
    17:09:37.43: Rewriting:  Mbox = "abhishek.sen", host = "extmail.xyz.com", domain = "$*", literal = "", tag = ""
    17:09:37.43: Rewrite: "$*", position 0, hash table -
    17:09:37.43:   Found: "$A$E$F$U%[email protected]"
    17:09:37.43:   Rewrite failed, not forward.
    17:09:37.43: Rewrite: "$*", position 1, hash table -
    17:09:37.43:   Failed.
    17:09:37.43: Rewrite: "$*", position 0, rewrite database -
    17:09:37.43:   Failed
    17:09:37.43: Rewriting:  Mbox = "abhishek.sen", host = "extmail", domain = "extmail.xyz.com", literal = "", tag = ""
    17:09:37.43: Rewrite: "extmail.xyz.com", position 0, hash table -
    17:09:37.43:   Found: "$U%[email protected]"
    17:09:37.43:   New mailbox: "abhishek.sen".
    17:09:37.43:   New host: "extmail.xyz.com".
    17:09:37.43:   New route: "P1192FLPLN.extmail.xyz.com".
    17:09:37.43:   New channel system: "P1192FLPLN.extmail.xyz.com".
    17:09:37.43: Looking up host "P1192FLPLN.extmail.xyz.com".
    17:09:37.43:   - found on channel l                              
    17:09:37.43: Routelocal flag set; scanning for % and !
    17:09:37.43:   Checking reverse URL cache for: [email protected]
    17:09:37.43:   Applying reverse URL pattern ldap:///$V?$N?sub?$R to: [email protected]
    17:09:37.48:   Resulting URL: ldap:///o%3Dextmail.xyz.com%2Co%3Dext?preferredlanguage,mailmsgmaxblocks,mail,mailalternateaddress,mailequivalentaddress?sub?(|([email protected])([email protected])([email protected]))
    17:09:37.49: mmc_open_url called to open ldap:///o%3Dextmail.xyz.com%2Co%3Dext?preferredlanguage,mailmsgmaxblocks,mail,mailalternateaddress,mailequivalentaddress?sub?(|([email protected])([email protected])([email protected])), flags = 384
    17:09:37.49:   URL with quotes stripped: ldap:///o%3Dextmail.xyz.com%2Co%3Dext?preferredlanguage,mailmsgmaxblocks,mail,mailalternateaddress,mailequivalentaddress?sub?(|([email protected])([email protected])([email protected]))
    17:09:37.49:   LDAP URL identified
    17:09:37.49: URL context #1 will be used
    17:09:37.49:   Performing URL search on: ldap:///o%3Dextmail.xyz.com%2Co%3Dext?preferredlanguage,mailmsgmaxblocks,mail,mailalternateaddress,mailequivalentaddress?sub?(|([email protected])([email protected])([email protected]))
    17:09:37.53: mmc_read_url result: [uid=asen,ou=People,o=extmail.xyz.com,o=ext]
    17:09:37.53:   URL resolution returned: [uid=asen,ou=People,o=extmail.xyz.com,o=ext]
    17:09:37.53: mmc_read_url result: [preferredlanguage] en
    17:09:37.53:   URL resolution returned: [preferredlanguage] en
    17:09:37.53:       Attribute index: 0
    17:09:37.53:       LDAP URL produced preferred language en
    17:09:37.53: mmc_read_url result: [mailmsgmaxblocks] 700
    17:09:37.53:   URL resolution returned: [mailmsgmaxblocks] 700
    17:09:37.53:       Attribute index: 0
    17:09:37.53:       LDAP URL produced blocklimit 700
    17:09:37.53: mmc_read_url result: [mail] [email protected]
    17:09:37.53:   URL resolution returned: [mail] [email protected]
    17:09:37.54:       Attribute index: 0
    17:09:37.54:       LDAP URL produced address [email protected]
    17:09:37.54:   No more results to return
    17:09:37.54:     Override postmaster: [email protected]
    17:09:37.54:     Preferred language en
    17:09:37.54:     Content return block limit now 700
    17:09:37.54:   Mapped return address: [email protected]
    17:09:37.54:   from_access mapping check: ||MAIL|tcp_local|[email protected]|
    17:09:37.54: Queue area size 73232902, temp area size 2067314
    17:09:37.54:   18308225 blocks of effective free queue space available; setting disk limit accordingly.
    17:09:37.54:   1033657 blocks of free temporary space available; setting disk limit accordingly.
    17:09:37.54:       - passed.
    17:09:37.54: Rewriting:  Mbox = "abhishek.sen", host = "extmail.xyz.com", domain = "$*", literal = "", tag = ""
    17:09:37.54: Rewrite: "$*", position 0, hash table -
    17:09:37.54:   Found: "$A$E$F$U%[email protected]"
    17:09:37.54:   Rewrite failed, not forward.
    17:09:37.54: Rewrite: "$*", position 1, hash table -
    17:09:37.54:   Failed.
    17:09:37.54: Rewrite: "$*", position 0, rewrite database -
    17:09:37.54:   Failed
    17:09:37.54: Rewriting:  Mbox = "abhishek.sen", host = "extmail", domain = "extmail.xyz.com", literal = "", tag = ""
    17:09:37.54: Rewrite: "extmail.xyz.com", position 0, hash table -
    17:09:37.54:   Found: "$U%[email protected]"
    17:09:37.54:   New mailbox: "abhishek.sen".
    17:09:37.54:   New host: "extmail.xyz.com".
    17:09:37.54:   New route: "P1192FLPLN.extmail.xyz.com".
    17:09:37.56:   New channel system: "P1192FLPLN.extmail.xyz.com".
    17:09:37.56: Looking up host "P1192FLPLN.extmail.xyz.com".
    17:09:37.56:   - found on channel l                              
    17:09:37.56: Routelocal flag set; scanning for % and !
    *** Debug output from rewriting a forward header address:
    17:09:37.56: Rewriting:  Mbox = "bhanu.prasad", host = "xyz.com", domain = "$*", literal = "", tag = ""
    17:09:37.56: Rewrite: "$*", position 0, hash table -
    17:09:37.56:   Found: "$A$E$F$U%[email protected]"
    17:09:37.57:   Rewrite failed, not envelope.
    17:09:37.57: Rewrite: "$*", position 1, hash table -
    17:09:37.57:   Failed.
    17:09:37.57: Rewrite: "$*", position 0, rewrite database -
    17:09:37.57:   Failed
    17:09:37.57: Rewriting:  Mbox = "bhanu.prasad", host = "relianceada", domain = "xyz.com", literal = "", tag = ""
    17:09:37.57: Rewrite: "xyz.com", position 0, hash table -
    17:09:37.57:   Failed.
    17:09:37.57: Rewrite: "xyz.com", position 0, rewrite database -
    17:09:37.59:   Failed
    17:09:37.59: Rewriting:  Mbox = "bhanu.prasad", host = "relianceada", domain = ".com", literal = "", tag = ""
    17:09:37.59: Rewrite: "*.com", position 0, hash table -
    17:09:37.59:   Failed
    17:09:37.59: Rewrite: ".com", position 0, hash table -
    17:09:37.59:   Found: "$U%$H$D@TCP-DAEMON"
    17:09:37.59:   New mailbox: "bhanu.prasad".
    17:09:37.59:   New host: "xyz.com".
    17:09:37.59:   New route: "TCP-DAEMON".
    17:09:37.59:   New channel system: "TCP-DAEMON".
    17:09:37.59: Looking up host "TCP-DAEMON".
    17:09:37.60:   - found on channel tcp_local                      
    17:09:37.60: Rewriting:  Mbox = "bhanu.prasad", host = "xyz.com", domain = "$*", literal = "", tag = ""
    17:09:37.60: Rewrite: "$*", position 0, hash table -
    17:09:37.60:   Found: "$A$E$F$U%[email protected]"
    17:09:37.60:   Rewrite failed, not envelope.
    17:09:37.60: Rewrite: "$*", position 1, hash table -
    17:09:37.60:   Failed.
    17:09:37.60: Rewrite: "$*", position 0, rewrite database -
    17:09:37.60:   Failed
    17:09:37.61: Rewriting:  Mbox = "bhanu.prasad", host = "relianceada", domain = "xyz.com", literal = "", tag = ""
    17:09:37.61: Rewrite: "xyz.com", position 0, hash table -
    17:09:37.61:   Failed.
    17:09:37.61: Rewrite: "xyz.com", position 0, rewrite database -
    17:09:37.61:   Failed
    17:09:37.61: Rewriting:  Mbox = "bhanu.prasad", host = "relianceada", domain = ".com", literal = "", tag = ""
    17:09:37.61: Rewrite: "*.com", position 0, hash table -
    17:09:37.61:   Failed
    17:09:37.61: Rewrite: ".com", position 0, hash table -
    17:09:37.63:   Found: "$U%$H$D@TCP-DAEMON"
    17:09:37.63:   New mailbox: "bhanu.prasad".
    17:09:37.63:   New host: "xyz.com".
    17:09:37.63:   New route: "TCP-DAEMON".
    17:09:37.63:   New channel system: "TCP-DAEMON".
    17:09:37.63: Looking up host "TCP-DAEMON".
    17:09:37.63:   - found on channel tcp_local                      
    17:09:37.63:   Rewrite rules result: [email protected]
    17:09:37.63:   Checking reverse URL cache for: [email protected]
    17:09:37.63:   Applying reverse URL pattern ldap:///$V?$N?sub?$R to: [email protected]
    17:09:37.65:   URL generation failed, status = 0
    *** Debug output from rewriting a forward envelope address:
    17:09:37.65: Rewriting:  Mbox = "bhanu.prasad", host = "xyz.com", domain = "$*", literal = "", tag = ""
    17:09:37.65: Rewrite: "$*", position 0, hash table -
    17:09:37.65:   Found: "$A$E$F$U%[email protected]"
    17:09:37.65:   Match, pattern = "xyz.com", current = "(*domaincheck*)"
    17:09:37.65:     old state = not checked.
    17:09:37.65:     Domain check on xyz.com.
    17:09:37.66:     Could not add domain result 0 to cache for xyz.com.
    17:09:37.66:     new state = fail pending.
    17:09:37.66:   Rewrite failed due to prechannel mismatch.
    17:09:37.66: Rewrite: "$*", position 1, hash table -
    17:09:37.66:   Failed.
    17:09:37.66: Rewrite: "$*", position 0, rewrite database -
    17:09:37.66:   Failed
    17:09:37.66: Rewriting:  Mbox = "bhanu.prasad", host = "relianceada", domain = "xyz.com", literal = "", tag = ""
    17:09:37.66: Rewrite: "xyz.com", position 0, hash table -
    17:09:37.66:   Failed.
    17:09:37.67: Rewrite: "xyz.com", position 0, rewrite database -
    17:09:37.67:   Failed
    17:09:37.67: Rewriting:  Mbox = "bhanu.prasad", host = "relianceada", domain = ".com", literal = "", tag = ""
    17:09:37.67: Rewrite: "*.com", position 0, hash table -
    17:09:37.67:   Failed
    17:09:37.67: Rewrite: ".com", position 0, hash table -
    17:09:37.67:   Found: "$U%$H$D@TCP-DAEMON"
    17:09:37.67:   New mailbox: "bhanu.prasad".
    17:09:37.67:   New host: "xyz.com".
    17:09:37.67:   New route: "TCP-DAEMON".
    17:09:37.69:   New channel system: "TCP-DAEMON".
    17:09:37.69: Looking up host "TCP-DAEMON".
    17:09:37.69:   - found on channel tcp_local                      
      address channel        = tcp_local                      
      forward channel        = tcp_local                      
      channel description    =
      channel caption        =
      channel user filter    =
      dest channel filter    =
      source channel filter  =
      channel flags #0       = BIDIRECTIONAL SINGLE_SYSTEM IMMNONURGENT NOSERVICEALL  channel flags #1       = SMTP_CRLF MX IDENTNONENUMERIC DEFAULT
      channel flags #2       = COPYSENDPOST COPYWARNPOST POSTHEADONLY HEADERINC NOEXPROUTE
      channel flags #3       = LOGGING NORESTRICTED RETAINSECURITYMULTIPARTS
      channel flags #4       = EIGHTNEGOTIATE HEADERKEEPORDER NOHEADERREAD RULES
      channel flags #5       = TRUNCATESMTPLONGLINES
      channel flags #6       = LOCALUSER REPORTNOTARY
      channel flags #7       = SWITCHCHANNEL REMOTEHOST DATEFOUR DAYOFWEEK
      channel flags #8       = NODEFRAGMENT EXQUOTA REVERSE NOCONVERT_OCTET_STREAM
      channel flags #9       = NOTHURMAN INTERPRETENCODING USEINTERMEDIATE RECEIVEDFROM VALIDATELOCALNONE NOTURN
      defaulthost            = extmail.xyz.com extmail.xyz.com
      linelength             = 998
      addrsperfile           = 99
      channel env addr type  = SOURCEROUTE
      channel hdr addr type  = SOURCEROUTE
      channel official host  = tcp-daemon
      channel queue 0 name   = SMTP_POOL
      channel queue 1 name   = SMTP_POOL
      channel queue 2 name   = SMTP_POOL
      channel queue 3 name   = SMTP_POOL
      channel after params    =
      channel daemon name    = 10.8.51.126
      channel user name      =
      urgentnotices          = 1 2 4 7
      normalnotices          = 1 2 4 7
      nonurgentnotices       = 1 2 4 7
      channel rightslist ids =
      local behavior flags   = %x0
      expandchannel          =
      notificationchannel    =
      dispositionchannel     =
      tlsswitchchannel       =
      backward channel       = tcp_local                      
      unique identifier      = [email protected]
      header forward address = [email protected]  (route (TCP-DAEMON,TCP-DAEMON)) (host xyz.com)
      header reverse address = [email protected]
      envelope forw address  = [email protected]  (route (TCP-DAEMON,TCP-DAEMON)) (host xyz.com)
      envelope rev address   = [email protected]  (route (TCP-DAEMON,TCP-DAEMON)) (host xyz.com)
      name                   =
      mbox                   = bhanu.prasad
    Extracted address action list:
        [email protected]
    Extracted 733 address action list:
        [email protected]
    Address list expansion:
    *** Debug output from alias expansion:
    17:09:37.76: Inner expand, level = 0, mailbox = [email protected]
    17:09:37.76: Rewriting:  Mbox = "bhanu.prasad", host = "xyz.com", domain = "$*", literal = "", tag = ""
    17:09:37.76: Rewrite: "$*", position 0, hash table -
    17:09:37.76:   Found: "$A$E$F$U%[email protected]"
    17:09:37.76:   Match, pattern = "xyz.com", current = "(*domaincheck*)"
    17:09:37.76:     old state = not checked.
    17:09:37.76:     Domain check on xyz.com.
    17:09:37.77:     Could not add domain result 0 to cache for xyz.com.
    17:09:37.77:     new state = fail pending.
    17:09:37.77:   Rewrite failed due to prechannel mismatch.
    17:09:37.77: Rewrite: "$*", position 1, hash table -
    17:09:37.77:   Failed.
    17:09:37.77: Rewrite: "$*", position 0, rewrite database -
    17:09:37.77:   Failed
    17:09:37.77: Rewriting:  Mbox = "bhanu.prasad", host = "relianceada", domain = "xyz.com", literal = "", tag = ""
    17:09:37.77: Rewrite: "xyz.com", position 0, hash table -
    17:09:37.77:   Failed.
    17:09:37.79: Rewrite: "xyz.com", position 0, rewrite database -
    17:09:37.79:   Failed
    17:09:37.79: Rewriting:  Mbox = "bhanu.prasad", host = "relianceada", domain = ".com", literal = "", tag = ""
    17:09:37.79: Rewrite: "*.com", position 0, hash table -
    17:09:37.79:   Failed
    17:09:37.79: Rewrite: ".com", position 0, hash table -
    17:09:37.79:   Found: "$U%$H$D@TCP-DAEMON"
    17:09:37.79:   New mailbox: "bhanu.prasad".
    17:09:37.79:   New host: "xyz.com".
    17:09:37.79:   New route: "TCP-DAEMON".
    17:09:37.80:   New channel system: "TCP-DAEMON".
    17:09:37.80: Looking up host "TCP-DAEMON".
    17:09:37.80:   - found on channel tcp_local                      
    -13 expansion total.
    *** Debug output from submitting an envelope address:
    17:09:37.80: mmc_wadr(0x0017ae68,'[email protected]','[email protected]') called.
    17:09:37.80: Copy estimate before address addition is 1
    17:09:37.80:     Parsing address [email protected]
    17:09:37.80: Rewriting:  Mbox = "bhanu.prasad", host = "xyz.com", domain = "$*", literal = "", tag = ""
    17:09:37.80: Rewrite: "$*", position 0, hash table -
    17:09:37.81:   Found: "$A$E$F$U%[email protected]"
    17:09:37.81:   Match, pattern = "xyz.com", current = "(*domaincheck*)"
    17:09:37.81:     old state = not checked.
    17:09:37.81:     Domain check on xyz.com.
    17:09:37.81:     Could not add domain result 0 to cache for xyz.com.
    17:09:37.81:     new state = fail pending.
    17:09:37.81:   Rewrite failed due to prechannel mismatch.
    17:09:37.81: Rewrite: "$*", position 1, hash table -
    17:09:37.83:   Failed.
    17:09:37.83: Rewrite: "$*", position 0, rewrite database -
    17:09:37.83:   Failed
    17:09:37.83: Rewriting:  Mbox = "bhanu.prasad", host = "relianceada", domain = "
    xyz.com", literal = "", tag = ""
    17:09:37.83: Rewrite: "xyz.com", position 0, hash table -
    17:09:37.83:   Failed.
    17:09:37.83: Rewrite: "xyz.com", position 0, rewrite database -
    17:09:37.83:   Failed
    17:09:37.83: Rewriting:  Mbox = "bhanu.prasad", host = "relianceada", domain = "
    .com", literal = "", tag = ""
    17:09:37.83: Rewrite: "*.com", position 0, hash table -
    17:09:37.84:   Failed
    17:09:37.84: Rewrite: ".com", position 0, hash table -
    17:09:37.84:   Found: "$U%$H$D@TCP-DAEMON"
    17:09:37.84:   New mailbox: "bhanu.prasad".
    17:09:37.84:   New host: "xyz.com".
    17:09:37.84:   New route: "TCP-DAEMON".
    17:09:37.84:   New channel system: "TCP-DAEMON".
    17:09:37.84: Looking up host "TCP-DAEMON".
    17:09:37.84:   - found on channel tcp_local                      
    17:09:37.84:       - adding address [email protected] to headers.
    17:09:37.86:       - orig_send_access mapping check: tcp_local|abhishek.sen@extm
    ail.xyz.com|tcp_local|[email protected]
    17:09:38.16:         - failed.
    17:09:38.16: Good address count 0 defer count 0
    17:09:38.16: Copy estimate after address addition is 1
    17:09:38.16: mmc_waend(0x0017ae68) called.
    17:09:38.16:   Copy estimate is 1
    17:09:38.16:   Queue area size 73232902, temp area size 2067288
    17:09:38.16:   36616451 blocks of effective free queue space available; setting
    disk limit accordingly.
    17:09:38.16:   1033644 blocks of free temporary space available; setting disk li
    mit accordingly.
    Expanded address:
      [email protected]
    Submitted address list:
    Address list error -- 5.7.1 Relaying not allowed: [email protected]
    Submitted notifications list:
    =========================================================================Do we have to make any changes on other config files except the imta.cnf and mappings file for inbound and outbound..
    thanks for any help
    Edited by: prasad0_0 on Jul 8, 2008 4:58 AM

    i have already setup the messaging server 6 months back.. followed the same procedure to route mails to a gateway..
    made changes to the imta.cnf for outbound mail flow to the tcp_local and mappings file to accept inbound mail flow from the gateway. Its working perfectly on the older setup, but this now, have issues with new setup.
    here is the imta.cnf file..
    ! IMTA configuration file
    ! part I : rewrite rules
    ! Domain Rewrite Rules.
    ! Uncomment this line to use domain rewrite rules
    ! from the configuration file instead of the domain database.
    ! Please refer to the iMS documentation for details.
    !<IMTA_TABLE:domains.rules
    ! Rules to select local users
    $* $A$E$F$U%[email protected]
    P1192FLPLN.extmail.xyz.com $U%[email protected]
    extmail.xyz.com $U%[email protected]
    ! ims-ms
    .ims-ms-daemon $U%$H.ims-ms-daemon@ims-ms-daemon
    ! lmtp
    !.lmtp $U%$H@lmtpcs-daemon
    ! lmtpn
    !.lmtpn $U%$H@lmtpcn-daemon
    ! native
    .native-daemon $U%$H.native-daemon@native-daemon
    ! pipe
    .pipe-daemon $U%$H.pipe-daemon@pipe-daemon
    ! tcp_local
    ! Rules for top level internet domains
    <IMTA_TABLE:internet.rules
    ! tcp_intranet
    ! Do mapping lookup for internal IP addresses
    [] $E$R${INTERNAL_IP,$L}$U%[$L]@tcp_intranet-daemon
    .extmail.xyz.com $U%$H.extmail.xyz.com@tcp_intranet-daemon
    * $U%$&0.extmail.xyz.com
    ! reprocess
    reprocess $U%reprocess.P1192FLPLN.extmail.xyz.com@reprocess-daemon
    reprocess.P1192FLPLN.extmail.xyz.com $U%reprocess.P1192FLPLN.extmail.xyz.com@reprocess-daemon
    ! process
    process $U%process.P1192FLPLN.extmail.xyz.com@process-daemon
    process.P1192FLPLN.extmail.xyz.com $U%process.P1192FLPLN.extmail.xyz.com@process-daemon
    ! defragment
    defragment $U%defragment.P1192FLPLN.extmail.xyz.com@defragment-daemon
    defragment.P1192FLPLN.extmail.xyz.com $U%defragment.P1192FLPLN.extmail.xyz.com@defragment-daemon
    ! conversion
    conversion $U%conversion.P1192FLPLN.extmail.xyz.com@conversion-daemon
    conversion.P1192FLPLN.extmail.xyz.com $U%conversion.P1192FLPLN.extmail.xyz.com@conversion-daemon
    ! bitbucket
    bitbucket $U%bitbucket.P1192FLPLN.extmail.xyz.com@bitbucket-daemon
    bitbucket.P1192FLPLN.extmail.xyz.com $U%bitbucket.P1192FLPLN.extmail.xyz.com@bitbucket-daemon
    ! deleted
    deleted-daemon $U%$H@deleted-daemon
    .deleted-daemon $U%$H@deleted-daemon
    ! inactive
    inactive-daemon $U%$H@inactive-daemon
    .inactive-daemon $U%$H@inactive-daemon
    ! hold
    hold-daemon $U%$H@hold-daemon
    .hold-daemon $U%$H@hold-daemon
    ! part II : channel blocks
    defaults notices 1 2 4 7 copywarnpost copysendpost postheadonly noswitchchannel immnonurgent maxjobs 7 logging defaulthost extmail.xyz.com extmail.xyz.com
    ! delivery channel to local /var/mail store
    l subdirs 20 viaaliasrequired maxjobs 7
    P1192FLPLN.extmail.xyz.com
    ! ims-ms
    ims-ms defragment subdirs 20 notices 1 7 14 21 28 backoff "pt5m" "pt10m" "pt30m" "pt1h" "pt2h" "pt4h" maxjobs 2 pool IMS_POOL fileinto $U+$S@$D
    ims-ms-daemon
    ! native
    native defragment subdirs 20 maxjobs 1
    native-daemon
    ! pipe
    pipe single defragment subdirs 20
    pipe-daemon
    ! tcp_local
    tcp_local smtp mx single_sys remotehost inner switchchannel identnonenumeric subdirs 20 maxjobs 7 pool SMTP_POOL maytlsserver maysaslserver saslswitchchannel tcp_auth missingrecipientpolicy 0 loopcheck daemon 10.8.51.126
    tcp-daemon
    ! tcp_intranet
    tcp_intranet smtp mx single_sys subdirs 20 dequeue_removeroute maxjobs 7 pool SMTP_POOL maytlsserver allowswitchchannel saslswitchchannel tcp_auth missingrecipientpolicy 4
    tcp_intranet-daemon
    ! tcp_submit
    tcp_submit submit smtp mx single_sys mustsaslserver maytlsserver missingrecipientpolicy 4
    tcp_submit-daemon
    ! tcp_auth
    tcp_auth smtp mx single_sys mustsaslserver missingrecipientpolicy 4
    tcp_auth-daemon
    ! tcp_tas
    tcp_tas smtp mx single_sys allowswitchchannel mustsaslserver maytlsserver deliveryflags 2
    tcp_tas-daemon
    ! tcp_lmtpss (LMTP server - store)
    !tcp_lmtpss lmtp flagtransfer
    !tcp_lmtpss-daemon
    ! tcp_lmtpcs (LMTP client - store)
    !tcp_lmtpcs defragment lmtp port 225 nomx single_sys subdirs 20 maxjobs 7 pool SMTP_POOL dequeue_removeroute
    !lmtpcs-daemon
    ! reprocess
    reprocess
    reprocess-daemon
    ! process
    process
    process-daemon
    ! defragment
    defragment
    defragment-daemon
    ! conversion
    conversion
    conversion-daemon
    ! bitbucket
    bitbucket
    bitbucket-daemon
    ! deleted
    deleted
    deleted-daemon
    ! inactive
    inactive
    inactive-daemon
    ! hold
    hold
    hold-daemonand mappings file..
    ! MTA mappings file
    !  for access control and other table lookups
    FROM_ACCESS
    ! Entries to block certain submissions normally would be inserted here,
    ! above the ntended-to-be-final entries that while permitting submission,
    ! merely disable any potential "vacation" effect.
    ! The following entries disable Sieve "vacation" action on lists sorts
    ! of addresses, as recommended by the Sieve "vacation" extension draft.
       *|SMTP*|*|*|MAILER-DAEMON@*|*    $!$Y
       *|SMTP*|*|*|LISTSERVE*@|*        $!$Y
       *|SMTP*|*|*|majordomo@*|*        $!$Y
       *|SMTP*|*|*|*-request@*|*        $!$Y
       *|SMTP*|*|*|*-owner@*|*          $!$Y
       *|SMTP*|*|*|owner-*@*|*          $!$Y
    PORT_ACCESS
      *|*|*|*|*  $C$|INTERNAL_IP;$3|$Y$E
      *  $YEXTERNAL
    INTERNAL_IP
      $(10.8.55.49/24)  $Y
      $(10.8.51.125)  $Y
      $(10.8.51.126)  $Y
      127.0.0.1  $Y
      *  $N
    ORIG_SEND_ACCESS
      tcp_local|*|tcp_local|*  $N$D30|Relaying$ not$ allowed
      tcp_*|*|native|*  $N
      tcp_*|*|hold|*  $N
      tcp_*|*|pipe|*  $N
      tcp_*|*|ims-ms|*  $N
    ! Block "external" submissions of explicitly source-routed "internal" addresses
      tcp_local|*|tcp_intranet|@*:*.*   $N$D30|Explicit$ routing$ not$ allowed
      tcp_local|*|tcp_intranet|*$%*@*   $N$D30|Explicit$ routing$ not$ allowed
      tcp_local|*|tcp_intranet|*.*!*@*  $N$D30|Explicit$ routing$ not$ allowed
      tcp_local|*|tcp_intranet|"*@*"@*  $N$D30|Explicit$ routing$ not$ allowed
    SEND_ACCESS
      tcp_*|*|*|*@[127.*]  $X5.1.2|$NBad$ destination$ system
      tcp_*|*|*|*@localhost.*  $X5.1.2|$NBad$ destination$ system
      tcp_*|*|*|*@example.com  $X5.1.2|$NBad$ destination$ system
      tcp_*|*|*|*@example.net  $X5.1.2|$NBad$ destination$ system
      tcp_*|*|*|*@example.org  $X5.1.2|$NBad$ destination$ system
      tcp_*|*|*|*@*.test  $X5.1.2|$NBad$ destination$ system
      tcp_*|*|*|*@*.example  $X5.1.2|$NBad$ destination$ system
      tcp_*|*|*|*@*.invalid  $X5.1.2|$NBad$ destination$ system
      tcp_*|*|*|*@*.localhost  $X5.1.2|$NBad$ destination$ system
    <IMTA_TABLE:mappings.localewe are able to receive mails from the gateway, but when using uwc to send the mail, the mail doesnt hit the gateway. trying a telnet from the messaging server to the gateway, works perfectly.
    thanks in advance.

  • Dynamic Querying in ESB

    Hey,
    I am trying to implement dynamic querying using the query by example concept. My requirement is as follows:
    "Say I have 5 inputs , I need to fetch rows from the database using those 5 inputs as a part of my where clause"
    The user input are optional. Hence using the query by example concept I was able to filter rows.
    But the problem is as follows:
    1) I have a "time from" and "a time to" field as user inputs. I need to filter the fetched rows so that time is in that time range only. I do not know how to implement this also along with the above concept as there is no place for a where clause.
    Any help/suggestions would be appreciated.
    Thanks

    I tried applying the patch, but it gives the following error:
    OPatch detects your platform as 207 while this patch 6133448 supports platforms:
    0 (Generic Platform)
    This patch is not suitable for this operating system.
    Please contact support for the correct patch.
    ERROR: OPatch failed during pre-reqs check.
    OPatch returns with error code = 150
    I downloaded for the OS I am on, but always the generic patch downloads; i guess this generic one should work for all platforms. Opatch version is 1.0.0.0.56.

  • Help! Inaccessible iterator when using dynamic query

    Hi!
    I have a problem retreiving results from a dynamic query into sqlj iterator.
    I consulted the Oracle App Dev Guide and Oracle SQLJ Dev Guide and wrote the following code:
    <PRE>
    package pmServer;
    #sql iterator LocIterator (int id, String name);
    public class pmRISDImpl
    public int GetLocations(...)
    LocIterator locIt;
    String q = "select ID, NAME from PMADM.LOCATIONS";
    #sql
    BEGIN
    open :OUT locIt for :q;
    END;
    </PRE>
    When I try to compile it using tools provided by JDeveloper ver 3.2.2.(Build 915) for JDK 1.2.2 I get error for #sql statement:
    Inaccessible Java type for host item locIt (at position #1): pmServer.LocIterator
    and warning:
    Type pmServer.LocIterator of host item locIt (at position #1) is not permitted in JDBC. This will not be portable.
    Althow the code is identcal to those demonstrated in Oracle document "Oracle8 i
    SQLJ Developers Guide and Reference
    Release 3 (8.1.7)
    July 2000
    Part No. A83723-01" pp 12-67 (PL/SQL in SQLJ for Dynamic SQLDynamicDemo.sqlj). There it looks like
    <PRE>
    private static void dynamicSelectMany(String what_cond)
    throws SQLException {
    System.out.println("dynamic multi-row query on table emp");
    Employees empIter;
    // table/column names cannot be bind args in dynamic PL/SQL, so
    // build up query as Java string
    String query = "select ename, sal from emp " +
    (((what_cond == null) &#0124; &#0124; (what_cond.equals(""))) ? "" :
    (" where " + what_cond)) +
    "order by ename";
    #sql {
    begin
    open :OUT empIter for -- opening ref cursor with dynamic query
    :query;
    -- can have USING clause here if needed
    end;
    while (empIter.next()) {
    System.out.println("Employee " + empIter.ename() +
    " has salary " + empIter.sal() );
    empIter.close();
    </PRE>
    Please guide me what should I do to get it working.
    null

    In the CAST statement the SQLJ runtime must be able to produce an instance of you SQLJ iterator using Java reflection.
    This necessitates that the iterator class must be accessible by public.
    You have two options:
    (1) Declare the iterator public. This requires that you put it in its own file LocIterator.sqlj:
    #sql public iterator LocIterator (int id, String name);
    (2) Declare the iterator as an inner class. In this case you want to make it public static (that is it does not require an instance of the outer class in scope). You might write the following.
    package pmServer;
    public class pmRISDImpl
    #sql public static iterator LocIterator (int id, String name);
    (3) If you are using Oracle 9i you have another option. You can embed dynamic SQL fragments directly in your SQLJ code and do not need to use the CAST:
    public int GetLocations(...)
    LocIterator locIt;
    String q = "PMADM.LOCATIONS";
    #sql locIt = { select ID, NAME from :{q} }; // Note new syntax :{q} for embedding SQL source code
    }

  • Converting rows to columns using dynamic query.

    I am trying to use the below code that I founnd on the web to conver rows to columns. the reason that I want to use dynamic query is that the number of rows are not know and changes.
    declare
        lv_sql varchar2(32767) := null ;
    begin
        lv_sql := 'SELECT Iplineno ';
        for lv_rec in (SELECT distinct vendor from bidtabs  where letting = '10021200' and call ='021')
        loop
            lv_sql :=   lv_sql
                        || CHR(10)
                        || ', MAX( DECODE( vendor, '
                        || chr(39)
                        || lv_rec.vendor
                        || CHR(39)
                        || ', bidprice, NULL ) ) as "'
                        || lv_rec.vendor
                        || '" ' ;
        end loop;
        lv_sql :=   lv_sql
                    || CHR(10)
                    || 'FROM bidtabs  where letting =  ''10021200''  and call =  ''021''  and lineflag = ''L''  '
                    || CHR(10)
                    || 'GROUP BY iplineno ;' ;
    here is the result
    BIDPRICE     CALL     IPLINENO     LETTING     VENDOR
    9,585     021     0010     10021200     C0104        
    1,000     021     0020     10021200     C0104        
    1,000     021     0030     10021200     C0104        
    17     021     0040     10021200     C0104        
    5     021     0050     10021200     C0104        
    11,420     021     0010     10021200     K0054        
    1,100     021     0020     10021200     K0054        
    1,100     021     0030     10021200     K0054        
    5     021     0040     10021200     K0054        
    3     021     0050     10021200     K0054        
    8,010     021     0010     10021200     V070         
    900     021     0020     10021200     V070         
    1,320     021     0030     10021200     V070         
    11     021     0040     10021200     V070         
    3     021     0050     10021200     V070         
    and here is the desired output
    CALL     IPLINENO     LETTING      C0104              K0054              V070         
    021     0010     10021200      9,585                     11,420                                   8,010
    021     0020     10021200      1,000       1,100     900
    021     0030     10021200      1,000     1,100     1,320
    021     0040     10021200       17     5     11
    021     0050     10021200      5     3     3

    Here is the error message I am getting:
    RA-06550: line 22, column 43:
    PLS-00103: Encountered the symbol "end-of-file" 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 execute commit forall merge
    pipe

  • Create table problem using Dynamic Query

    Hi all,
    I want to create a temporary table within a stored procedure so I decided to do it using a dynamic query:
    create or replace procedure p1
    as
    begin
    execute immediate 'CREATE GLOBAL TEMPORARY TABLE tt(id number(2))';
    end;
    / It created successfuly but when I execute that procedure I got:SQL> exec p1;
    BEGIN p1; END;
    ERROR at line 1:
    ORA-01031: insufficient privileges
    ORA-06512: at "SCOTT.P1", line 4
    ORA-06512: at line 1 While I can create that table using the same user without any problem!
    My question is:What privilege should I grant to user(minimum of privileges please! ) to execute that procedure successfuly?
    -Thanks

    Hi,
    To say a little bit more about Nicolas' answer:
    SQL> grant create table to scott;
    This is the right answer, but you might wonder why you have to do so if you usually can create tables with this user..
    11:59:19 TEST.SQL>CREATE USER UTEST
    11:59:28   2  IDENTIFIED BY UTEST;
    User created.
    11:59:35 TEST.SQL>CREATE ROLE RTEST;
    Role created.
    11:59:40 TEST.SQL>GRANT RTEST TO UTEST;
    Grant succeeded.
    11:59:45 TEST.SQL>GRANT CREATE SESSION TO RTEST;
    Grant succeeded.
    11:59:54 TEST.SQL>GRANT CREATE TABLE TO RTEST;
    Grant succeeded.
    12:00:03 TEST.SQL>GRANT UNLIMITED TABLESPACE TO UTEST;
    Grant succeeded.
    12:00:17 TEST.SQL>CREATE PROCEDURE UTEST.CT_TEST
    12:00:32   2  IS
    12:00:33   3  BEGIN
    12:00:35   4  EXECUTE IMMEDIATE 'CREATE TABLE UTEST.TTEST (A NUMBER)';
    12:00:56   5  END;
    12:00:58   6  /
    Procedure created.
    12:00:59 TEST.SQL>EXEC UTEST.CT_TEST;
    BEGIN UTEST.CT_TEST; END;
    ERROR at line 1:
    ORA-01031: insufficient privileges
    ORA-06512: at "UTEST.CT_TEST", line 4
    ORA-06512: at line 1
    12:01:06 TEST.SQL>GRANT CREATE TABLE TO UTEST;
    Grant succeeded.
    12:01:15 TEST.SQL>EXEC UTEST.CT_TEST;
    PL/SQL procedure successfully completed.Don't forget that when you're using PL/SQL, privileges granted via roles are ignored!
    Regards,
    Yoann.

  • Error executing dB Query   help??

    I'm creating a simple content management system with DW &
    CF using an Access DB. I set up the DB in the CF Administrator as
    Access with unicode.
    My DB has several tables...users, usertypes, events,
    eventtypes, reviews.
    I built the usertype admin pages with no problems. Everything
    is working well and my pages are interacting well with the
    usertypes table in the db. I'm currently building the user admin
    pages and now I'm having problems when I try to add records into
    the users table. On my add page I've created a recordset with all
    of my usertypes in it. Also, I'm using the record insertion form
    wizard in DW.
    I'm getting the following error:
    Error Executing Database Query.
    Syntax error in INSERT INTO statement.
    The error occurred in
    C:\CFusionMX7\wwwroot\pentanglecf\admin\users\add.cfm: line 64
    62 : <cfelse>
    63 : NULL
    64 : </cfif>
    65 : )
    66 : </cfquery>
    BTW, I'm using Dan Short's very good DW 8 Dynamic Development
    tutorials on Lynda.Com. Has anyone used this before? Any help is
    greatly appreciated.
    Luis
    Casegama.Com

    Thanks Ken but I think I had posted the incorrect code for a
    few minutes before I made the correction. Below is both the CF code
    and the SQL command (also up above). I'm still having issues and
    any help is greatly appreciated.
    thanks,
    Luis
    Casegama.com
    <cflock scope="Session" type="ReadOnly" timeout="30"
    throwontimeout="no">
    <cfset
    MM_Username=Iif(IsDefined("Session.MM_Username"),"Session.MM_Username",DE(""))>
    <cfset
    MM_UserAuthorization=Iif(IsDefined("Session.MM_UserAuthorization"),"Session.MM_UserAuthor ization",DE(""))>
    </cflock>
    <cfif MM_Username EQ "" OR MM_UserAuthorization EQ "" OR
    ListFind("1,2",MM_UserAuthorization) EQ 0>
    <cfset MM_referer=CGI.SCRIPT_NAME>
    <cfif CGI.QUERY_STRING NEQ "">
    <cfset MM_referer=MM_referer & "?" &
    CGI.QUERY_STRING>
    </cfif>
    <cfset MM_failureURL="login.cfm?accessdenied=" &
    URLEncodedFormat(MM_referer)>
    <cflocation url="#MM_failureURL#" addtoken="no">
    </cfif>
    <cfset CurrentPage=GetFileFromPath(GetTemplatePath())>
    <cfif IsDefined("FORM.MM_InsertRecord") AND
    FORM.MM_InsertRecord EQ "form1">
    <cfquery datasource="#Request.DSN#">
    INSERT INTO Users (Username, Password, FirstName, LastName,
    EmailAddress, Admin, Allowed, UserTypeID)
    VALUES (
    <cfif IsDefined("FORM.Username") AND #FORM.Username# NEQ
    "">
    '#FORM.Username#'
    <cfelse>
    NULL
    </cfif>
    <cfif IsDefined("FORM.Password") AND #FORM.Password# NEQ
    "">
    '#FORM.Password#'
    <cfelse>
    NULL
    </cfif>
    <cfif IsDefined("FORM.FirstName") AND #FORM.FirstName# NEQ
    "">
    '#FORM.FirstName#'
    <cfelse>
    NULL
    </cfif>
    <cfif IsDefined("FORM.LastName") AND #FORM.LastName# NEQ
    "">
    '#FORM.LastName#'
    <cfelse>
    NULL
    </cfif>
    <cfif IsDefined("FORM.EmailAddress") AND
    #FORM.EmailAddress# NEQ "">
    '#FORM.EmailAddress#'
    <cfelse>
    NULL
    </cfif>
    <cfif IsDefined("FORM.Admin")>
    Yes
    <cfelse>
    No
    </cfif>
    <cfif IsDefined("FORM.Allowed")>
    Yes
    <cfelse>
    No
    </cfif>
    <cfif IsDefined("FORM.UserTypeID") AND #FORM.UserTypeID#
    NEQ "">
    #FORM.UserTypeID#
    <cfelse>
    NULL
    </cfif>
    </cfquery>
    <cflocation url="index.cfm">
    </cfif>
    <cfquery name="rsUserTypes" datasource="#Request.DSN#">
    SELECT *
    FROM UserTypes
    ORDER BY UserType ASC
    </cfquery>

  • Enhancing a Dynamic Query Object

    Hi All,
    I've added a new field to the contract header using the EEWB, I then added the field to an append on the dynamic query object BTQSrvCon. The entry in CRMC_REPDY and the BADI implementation of BADI CRM_RF_SEARCH_EEW have been created automatically.
    This is working fine when I use the 'IS' separator on the search screen and enter the field exactly.
    I would like to use the dynamic query separators (contains, starts with etc.) but when I try I get the error message
    Search contains fields where wild card search is not allowed
    Has anyone implemented this functionality?
    Thanks,
    Gregor

    The range operator is in the generated code:
    method IF_EX_CRM_RF_SEARCH_EEW~EXTEND_RF_QUERY.
    INCLUDE crm_object_names_con.
    DATA: lv_fieldname       TYPE name_komp,
           ls_qupart          LIKE LINE  OF ct_quparts,
           ls_qupart_and      LIKE LINE  OF ct_quparts,
           ls_range_value     TYPE crmt_bsp_range.
    READ TABLE it_range_value INDEX 1
       INTO ls_range_value.
    IF sy-subrc <> 0.
       RETURN.
    ENDIF.
    CHECK NOT ls_range_value-low IS INITIAL.
    CALL METHOD cl_crm_report_qupart=>get_qupart_by_token
       EXPORTING
         iv_token  = 'AND'
       IMPORTING
         ev_qupart = ls_qupart_and-querypart.
    lv_fieldname = flt_val.
    CALL METHOD cl_crm_report_qupart=>get_qupart_by_token
       EXPORTING
         iv_entityname = gc_objectname_reporting-ORDERADM_H
         iv_fieldname  = lv_fieldname
         iv_token      = 'RAN'
         it_rangetab   = it_range_value
       IMPORTING
         ev_qupart     = ls_qupart-querypart.
    APPEND ls_qupart     TO ct_quparts.
    APPEND ls_qupart_and TO ct_quparts.
    endmethod.
    I've put a break in the code which is not being triggered so something may be up with the BADI implementation.

Maybe you are looking for