How to use Sequence in condition??? @_@

Could anyone please help me?
I'm writting a small SQL script, and some statements are as following:
select errcat_id, error_type from v_error_cat;
update t_error set error_type = (select error_type from v_error_cat where ERRCAT_ID = &&ERRCAT_ID)***
where ERROR_ID = err_seq.CURRVAL;
The errcat_id(in v_error_cat) and err_id(in t_error) are all created by sequence.
It seems that every time I run the script, it keeps saying:
Error at line 1(the position with stars):
ORA-03113: end-of-file on communication channel.
And then I'm told that I can't connect to Oracle till I restart again.
Is there anything wrong with sequence, or I miss something???
Thanks in advance.
null

Yes, when your sql is not right, you get end of communication message.
try to run each sql statements sererately and just with one condition at a time.
then you know where the problem is.
Good Luck!
null

Similar Messages

  • How to use outer join condition in my below query.

    Hi All,
    How to use outer join condition in my below query.
    In the table  APPS_JP.GEDIS_OFFER_HEADER goh I have more records
    in the table APPS_JP.GEDIS_ORDER_BUILDS gob I have less number of records.
    I want all the records from APPS_JP.GEDIS_OFFER_HEADER goh
    including other conditions.
    I have tried goh.OFFER_NO=gob.OFFER_NO(+) but same result.
    [code]SELECT   GOH.ORIG_SYSTEM,
               gsp.USER_NAME,
               goh.ORDER_NO,
               goh.OMEGA_ORDER_NUMBER,
               goh.ORDER_TYPE,
               gc.CUSTOMER_ID,
               gc.OMEGA_CUSTOMER_NUMBER,
               CASE WHEN gc.PRIVATE = 'N' THEN gc.CUSTOMER_NAME ELSE '' END
                  AS COMPANY_NAME,
               goh.ORDER_STATUS,
               goh.TOTAL_SELLING_PRICE,
               goh.TOTAL_MARGIN,
                  ga1.ADDRESS1
               || ','
               || ga1.ADDRESS2
               || ','
               || ga1.ADDRESS3
               || ','
               || ga1.POSTAL_CODE
               || ','
               || ga1.CITY
                  AS SHIPPING_ADDRESS,
                  ga2.ADDRESS1
               || ','
               || ga2.ADDRESS2
               || ','
               || ga2.ADDRESS3
               || ','
               || ga2.POSTAL_CODE
               || ','
               || ga2.CITY
                  AS BILLING_ADDRESS,
               ga.ADDRESS_ID,
               gol.DESCRIPTION,
               APPS_JP.TZ.to_local_date (goh.OFFER_DATE, goh.OFFER_DATE_UTC)
                  AS OFFER_DATE,
               gc.LEVEL_8,
               goh.NO_OF_BUILDS,
               gob.SFDC_ID,
               goh.PURCHASE_ORDER_NO AS PO,
               gc1.CUSTOMER_NAME AS END_USAGE,
               gol.LOB,
               goh.TOTAL_MARGIN_PCT,
               goh.TOTAL_DISCOUNT,
               goh.TOTAL_DISCOUNT_PCT
        FROM   APPS_JP.GEDIS_OFFER_HEADER goh,
               APPS_JP.GEDIS_ORDER_BUILDS gob,
               APPS_JP.GEDIS_ORDER_LINES gol,
               APPS_JP.GEDIS_OFFER_RELATED_CUSTOMER gorc,
               APPS_JP.GEDIS_OFFER_RELATED_CUSTOMER ship,
               APPS_JP.GEDIS_OFFER_RELATED_CUSTOMER bill,
               APPS_JP.GEDIS_CUSTOMER gc,
               APPS_JP.GEDIS_CUSTOMER gc1,
               APPS_JP.GEDIS_CONTACT gct,
               APPS_JP.GEDIS_ADDRESS ga,
               APPS_JP.GEDIS_ADDRESS_NORM ga1,
               APPS_JP.GEDIS_ADDRESS_NORM ga2,
               (SELECT   DISTINCT SALESPERSON_ID, USER_NAME
                  FROM   APPS_JP.GEDIS_SALESPERSON
                 WHERE   SALESPERSON_ID IN
                               (SELECT   TO_NUMBER (COLUMN_VALUE) AS SALESPERSON_ID
                                  FROM   TABLE (APPS_GLOBAL.SplitString ('337309'))))
               gsp
       WHERE       goh.ORDER_NO <> 0
               AND goh.OFFER_NO <> 0
               AND goh.OFFER_NO=gol.OFFER_NO
               AND gol.BUILD_NO = 1
               AND gol.LINE_NO = 1
               AND goh.OFFER_NO=gob.OFFER_NO
               AND gob.BUILD_NO = 1
               AND goh.OFFER_NO = gorc.OFFER_NO
               AND gct.CONTACT_ID = gorc.CONTACT_ID
               AND ga.CUSTOMER_ID = gc.CUSTOMER_ID
               AND ga.PRIMARY = 'Y'
               AND goh.LEAD_SALESPERSON=gsp.SALESPERSON_ID
               AND goh.OFFER_NO = ship.OFFER_NO
               AND ship.RELATION_TYPE = 'SHIP'
               AND ga1.ADDRESS_ID = ship.ADDRESS_ID
               AND ga1.CUSTOMER_ID = gc1.CUSTOMER_ID
               AND goh.OFFER_NO = bill.OFFER_NO
               AND bill.RELATION_TYPE = 'BILL'
               AND ga2.ADDRESS_ID = bill.ADDRESS_ID
               AND goh.OFFER_DATE BETWEEN APPS_JP.TZ.LOCAL_TO_DB_DATE (
                                             SYSDATE - 30
                                      AND  APPS_JP.TZ.LOCAL_TO_DB_DATE (SYSDATE)
               AND gorc.RELATION_TYPE = 'BASE'
               AND gorc.CUSTOMER_ID = gc.CUSTOMER_ID
               AND goh.SALES_CHANNEL = gc.SALES_CHANNEL
               AND gc.SALES_CHANNEL = 'SMB'
               AND goh.LEAD_SALESPERSON IN (goh.CREATED_BY, goh.LEAD_SALESPERSON)
    ORDER BY   goh.OFFER_NO;[/code]
    Please help me how to use this outer join condition.
    Thanks in advance.

    Hi,
    If you want all the rows from goh, then you don't want any conditions like  goh.OFFER_NO <> 0.
    Make all the joins to goh outer joins, and make all conditions that apply to any tables joined to goh (or to tables joined to them) part of the join condition, like this:
    FROM             APPS_JP.GEDIS_OFFER_HEADER     goh
    LEFT OUTER JOIN  APPS_JP.GEDIS_ORDER_BUILDS     gob  ON   gob.OFFER_NO = goh.OFFER_NO
                                                         AND  gob.BUILD_NO = 1
    LEFT OUTER JOIN  APPS_JP.GEDIS_ORDER_LINES      gol  ON   gol.OFFER_NO = goh.OFFER_NO
                                                         AND  gol.BUILD_NO = 1
                                                         AND  gol.LINE_NO  = 1
    LEFT OUTER JOIN  APPS_JP.GEDIS_OFFER_RELATED_CUSTOMER
                                                    gorc ...
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all the tables involved, and the results you want from that data.
    Simplify the problem as much as possible.  For example, do you really need all those tables to show what the problem is?  Of course, you need them in tyour real query, but if you understand a solution that only involves 4 or 5 tables, you'll know how to apply it to any number of tables.
    Explain, using specific examples, how you get those results from that data.Always say what version of Oracle you're using (e.g. 11.2.0.2.0).
    See the forum FAQ https://forums.oracle.com/message/9362002#9362002

  • How to use a purchase condition in the sales order

    Hello,
    Customer would like to have a purchase "day-price" appearing in the pricing of the sales order. 
    I would suggest to write abap code (reading the correct PU condition record) in a condition base value routine that would be added in the customizing pricing procedure at SD side.
    Is there any "more standard" solution for this ? 
    Thanks,

    Hello,
    Here is the case in more detail :
    This question concerns a product that is just purchased, stored, and sold.  The purchase-price is based on a "day-price" that is maintained in a purchase condition record on a daily basis.  The sales-price should be that daily price with a markup in %. 
    So, in the sales order, this purchase condition record should be picked up with the material and the pricing date as key.  From that base price, a markup can be calculated in sales pricing. 
    I would suggest to use the field "condition base value" in the setup of the sales pricing procedure (Ref to IMG sales and distribution, pricing control, define and assign pricing procedures).  In that field a new routine could be entered that (with a select or function or Bapi) picks up the purchase condition record-value. 
    I would like to know if this would be a "correct" way of solving this requirement,  if there is no "more standard" solution,  if anyone has experience with a similar requirement and how you solved it ?
    Thanks,

  • How to use Sequence in Forms

    Hi,
    I have an Empno Column, At the time of Opening a Form The Empno Will be displayed by using Sequence.
    If the User doesn't save the Form Then the Empno Generated number will be changed.
    How to write the code to get sequence numbers at Empno columns by using Sequence?
    Thanks & Regards,
    Hari Babu

    Ok, I understand now your question. Since the oracle sequence is commited in a separate transaction, it is not possible to get the no-gap sequence, considering your example. In the other hand, if you don't commit immediately, than two concurrently opened forms could use the same sequence number, so you'll get the duplicate key!
    If you're sure that this couldn't happen, you can manage your own sequencing, storing them in another table. Let's say you reached seq 999: entering the form, you'll read from your sequence table 1000, increment to 1001, and assign it to empno, but without commiting. Next time, you'll get the same number, until you commit form, and at the same time, change in seq table. So another will get 1001.
    Downside of this approach are, as mentioned before, concurrent sessions, which will get the same sequence.

  • How to Use Sequence created in Oracle Database in SQL Ldr Control file

    Hi,
    I created a sequence in oracle database. How will use the sequence in SQL loader Control file.
    Thanks in advance

    Hi,
    You might get a good response to your post in the forum dedicated to data movement , including SQL*Loader . You can find it here Export/Import/SQL Loader & External Tables
    Regards,

  • How to use sequence in MS sql server?

    In Oracle DB we use sequence like that:
    SequenceImpl s = new SequenceImpl("customer_seq", getDBTransaction());
    Integer next = (Integer)s.getData();
    setId(new Number(next.intValue()));
    But there is no sequence in sql server ,how can I do?
    Thank you~~

    MS SQLServer have a IDENTITY column property and UNIQUEIDENTIFIER data type that is somewhat similar to Oracle's sequence. I don't know whether your table contain either of these, or you just want to set sequential number to a column.
    Below is some info about IDENTITY and UNIQUEIDENTIFIER you may already know since they are in SQLServer Book.
    IDENTITY property: You can define IDENTITY property on a numeric column. You can set the seed and increment on this column property very much like Oracle's sequence. The only thing I think it does not have is the "nextval". You can use IDENT_CURRENT function or @@IDENTITY after an INSERT or SELECT INTO to get the last value generated. Of course you can use this value and add the increment to get the next
    value but it not the same as seqname.nextval which keep incrementing each time you call it. Getting the current identity value and adding the increment your self will not work for multiple sessions with pending
    insert. Another thing about column with IDENTITY property is that you cannot insert value into this column (i.e, omit it in your insert statement values) unless IDENTITY_INSERT is on, but only one table in a
    session can have IDENTITY_INSERT to be turned on.
    If you don't need to know the next seq value, then IDENTITY work similar to Oracle sequence. Execute select after postchanges or commit will have system generated values. If you need to get next value before insert, Sung suggest using SEQ_TABLE and managing the next value (write a database function to mimic Oracle'
    s nextval).
    UNIQUEIDENTIFIER datatype: UNIQUEIDENTIFIER is a 16-byte hexadecimal number indicating a globally unique identifier (GUID). The GUID is useful when a row must be unique among many other rows. You could use NEWID() to create a value of type uniqueidentifier or calling some API function that returns a GUID. The advantage of using uniqueidentifier is that the values generated by NEWID function or application GUID are guaranteed to be unique throughout the world. The disadvantage of using uniqueidetifier is that it is long and obscure, random, difficult for user to remember or type correctly. It is 16 byte, which is large compare to other datatype such as 4-byte integer.
    Thanks,
    Yvonne

  • MAX(SummaryNum) +1 bad idea, but how to use sequence part composite column

    Hi,
    My relational mode is as follows
    Policy (policynum PK) has 1:M with Summary (policynum FK, SummaryNum part of PK, other columns part of PK)
    Basically for each policy users can enter notes with SummaryNum 1, 2, 3, 4.... These numbers are shown to the user for tracking purpose. I need to make sure summary notes for EACH policy start with 1 (cannot really use sequence in the table in the strictest sense) and are incremented by 1. The current Oracle form basically creates the next highest possible value of SummaryNum by adding one to the currently available highest value. In brief, it is like a sequence number for summaries of a particular policy in the summary table.
    PRE-INSERT
    SELECT MAX(SummaryNum ) + 1
    FROM Summary
    I am trying to replicate this in ADF BC (using 11g) and know that not using sequencing and adding one to get the next number is a very bad idea due to concurrency challenges (transactional ACID properties). The reasons are as follows.
    •     Using MAX(policy_memo_seq_num) + 1 is not scalable,
    •     It will lead to duplicates in a multi-user environment, whether ADF BC, Oracle Forms, or any other technology
    I also know how to use create a sequence in db, a related trigger, and then set the attribute in EO properties as DBSequence. My challenge is that since SummaryNum is not a primary key, and instead is part of a composite key in my case, how do I make sure that summary notes for EACH policy start with 1 in the Summary Table.
    I appears that i cannot really use sequence in the table in the strictest sense as this will mean that for policies the summaryNum will start from the next available sequence number, but what i really want is to have it start by one for all policies.*
    I would appreciate any help.
    Thanks,

    Not sure if there is a better way, but here is one way. Let's say your table was like this:
        SQL> desc versioned_item
         Name         Null?    Type
         ID           NOT NULL NUMBER
         VERSION      NOT NULL NUMBER
         DESCRIPTION           VARCHAR2(20)and lets say your data looked like this:
        SQL> select * from versioned_item order by id, version
                ID    VERSION DESCRIPTION
              1001          1 Item 1001
              1001          2 Item 1001
              1001          3 Item 1001
              1002          1 Item 1002
              1002          2 Item 1002
              1003          1 Item 1003To select only the rows for the max-version-id, you could do this:
        select id, version,description
        from versioned_item
        where (id,version) in (select id,max(version) from versioned_item group by id)
        order by id
                ID    VERSION DESCRIPTION
              1001          3 Item 1001
              1002          2 Item 1002
              1003          1 Item 1003To capture this as a view object, you'd only just need to paste in the WHERE clause above into the Where clause box of the view object. No need to use expert-mode since you're not changing the select list or from clause.

  • How to Use Sequence in Oracle Views

    Hi ,
    I have created a view which gives the information about the access rights which a Resource has got. for ex -
    Res1 - GYM access - member
    Res1 - Swimingpool Access - member
    I need to identify a Primary Key for this data set. So i thought that i'll use a Sequence to generate an extra column in this view.
    But when i'm using the Sequence i'm getting the following error - "ORA-02287".

    you can use sequence within view it doesnot returned error;
    create sequence t1_seq MAXVALUE 150
    START WITH 39 INCREMENT BY 1;
    SQL> insert into t1_view values(t1_seq.nextval,'dd');
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> select * from t1;
    ID NA
    10 aa
    20 bb
    30 cc
    40 dd
    4 rows selected.
    SQL> insert into t1_view values(t1_seq.nextval,'ee');
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> select * from t1;
    ID NA
    10 aa
    20 bb
    30 cc
    40 dd
    41 ee
    5 rows selected.

  • UIX- How to use sequence in JDev 10.1.2

    Hi,
    I have a UIX Page displaying Employees view in a readonly Table format.
    Here I hide the employeeId field by setting the rendered property to false.
    I create another UIX Page for create/modify employee by dragging and dropping EmployeesView in InputForm Mode.
    Here I don't want the user to enter the EmployeeId Field, instead I have a sequence made in the backend which will input value when the before insert row trigger fires.
    When I try to set the rendered property for the item in the input form to false I get an error saying the user has to enter value.
    How to overcome this? Please help!

    If you use ADF BC, you can override the method create(AttributeList) in the Entity Object implementation class (EmployeesImpl.java).
    Use: Menu --> Tools --> Override Methods --> create
    In the overridden create method you can assign the next value from a DB sequence (e.g. EMP_SEQ) to the ID attribute:
    protected void create(AttributeList nameValuePair) {
    // Super
    super.create(nameValuePair);
    // Id
    SequenceImpl s = new SequenceImpl("EMP_SEQ", getDBTransaction());
    setEmployeeId(s.getSequenceNumber());
    }

  • Help! how to use sequence in in Oracle

    i have a table name account
    and i want the id column used the sequence XJ.ID
    so how to modfiy the .jdo file?
    here is the .jdo file
    <?xml version="1.0" encoding="UTF-8"?>
    <jdo>
    <package name="test">
    <class name="Account" objectid-class="AccountId">
    <extension vendor-name="kodo" key="class-column" value="none"/>
    <extension vendor-name="kodo" key="lock-column" value="none"/>
    <extension vendor-name="kodo" key="table" value="XJ.ACCOUNT"/>
    <field name="accountDetails">
    <collection element-type="AccountDetail"/>
    <extension vendor-name="kodo" key="inverse"
    value="account"/>
    <extension vendor-name="kodo" key="inverse-owner"
    value="account"/>
    </field>
    <field name="accountNo">
    <extension vendor-name="kodo" key="data-column"
    value="ACCOUNT_NO"/>
    </field>
    <field name="balance">
    <extension vendor-name="kodo" key="data-column"
    value="BALANCE"/>
    </field>
    <field name="createDate">
    <extension vendor-name="kodo" key="data-column"
    value="CREATE_DATE"/>
    </field>
    <field name="id" primary-key="true">
    <extension vendor-name="kodo" key="data-column"
    value="ID"/>
    </field>
    <field name="modifyDate">
    <extension vendor-name="kodo" key="data-column"
    value="MODIFY_DATE"/>
    </field>
    <field name="name">
    <extension vendor-name="kodo" key="data-column"
    value="NAME"/>
    </field>
    </class>
    thanks.

    With Kodo 2.5, you cannot use a database sequence when using application
    identity.
    Instead, you should use datastore identity, and use the
    sequence-factory-class metadata extension or the
    com.solarmetric.kodo.impl.jdbc.SequenceFactoryClass configuration property.
    See the following URLs for details:
    http://docs.solarmetric.com/ref_guide_meta_class.html#meta-class-sequence
    http://docs.solarmetric.com/ref_guide_conf_kodo.html#com.solarmetric.kodo.impl.jdbc.SequenceFactoryClass
    -Patrick
    jian xu wrote:
    i have a table name account
    and i want the id column used the sequence XJ.ID
    so how to modfiy the .jdo file?
    here is the .jdo file
    <?xml version="1.0" encoding="UTF-8"?>
    <jdo>
    <package name="test">
    <class name="Account" objectid-class="AccountId">
    <extension vendor-name="kodo" key="class-column" value="none"/>
    <extension vendor-name="kodo" key="lock-column" value="none"/>
    <extension vendor-name="kodo" key="table" value="XJ.ACCOUNT"/>
    <field name="accountDetails">
    <collection element-type="AccountDetail"/>
    <extension vendor-name="kodo" key="inverse"
    value="account"/>
    <extension vendor-name="kodo" key="inverse-owner"
    value="account"/>
    </field>
    <field name="accountNo">
    <extension vendor-name="kodo" key="data-column"
    value="ACCOUNT_NO"/>
    </field>
    <field name="balance">
    <extension vendor-name="kodo" key="data-column"
    value="BALANCE"/>
    </field>
    <field name="createDate">
    <extension vendor-name="kodo" key="data-column"
    value="CREATE_DATE"/>
    </field>
    <field name="id" primary-key="true">
    <extension vendor-name="kodo" key="data-column"
    value="ID"/>
    </field>
    <field name="modifyDate">
    <extension vendor-name="kodo" key="data-column"
    value="MODIFY_DATE"/>
    </field>
    <field name="name">
    <extension vendor-name="kodo" key="data-column"
    value="NAME"/>
    </field>
    </class>
    thanks.

  • How to use sequence in client web proxy.

    Hi,
    I have created a sequence in database.
    And I am using that in EntityImpl as:
    SequenceImpl sequence=new SequenceImpl("Sequence_name",getDBTransaction);
    setAttribute(sequence.getSequenceNumber)
    I will automatically set the attribute with the sequence val.
    But I want to get the sequence value in client web proxy generated through WSDL.
    There I write the same code and imported the files.
    But it is giving me error that:
    java.lang.nullPointException.
    How to access the sequence in client web proxy generated through WSDL.

    Hi,
    expose a method on the ViewObject and make it available to the service interface. In Web Services it does not make sense to create dependencies between a client and the implementation detail of the service.
    Frank

  • How to use text in condition master data?

    I want to copy text automaticlly from condition master data to sales order, but it seems impossible.
    How can I reach my purpose?
    In addition, I found it seems impossible to copy text from delivery note to Billing.
    Why and how to realize?

    hi,
    Can u tell me why do u want to copy text , means , do you want to print somewhere ?
    I have one alternate method , just try it,
    Use the Customer master - General data - Control data - Group key  --- where u can freely define any object ,say ABC , the same can be verified in all stages like sales order , delivery and billing as customer is flowing . Based on this object maintain your text in SO10 and call the same through the function ' READ_TEXT ' wherever you want.
    saravanan

  • How to Use Sequence Object Inside User-defined Function In SQL Server

    I'm trying to call sequence object inside SQL Server user-defined function. I used 
    Next Value for dbo.mySequence  to call the next value for my sequence created. But I'm getting an error like below.
    "NEXT VALUE FOR function is not allowed in check constraints, default objects, computed columns, views, user-defined functions, user-defined aggregates, user-defined table types, sub-queries, common table expressions, or derived tables."
    Is there any standard way to call sequence inside a function?
    I would really appreciate your response.
    Thanks!

    The NEXT
    VALUE FOR function cannot be used for User Defined function. It's one of the limitation.
    https://msdn.microsoft.com/en-us/library/ff878370.aspx
    What are you trying to do? Can you give us an example and required output?
    --Prashanth

  • How to use multiple search conditions in the where clause

    Hi,
    Below is my query
    /****** Script for SelectTopNRows command from SSMS  ******/
    SELECT distinct 
    ctacct,sum(GLMN02)
      FROM [ODS].[Staging].[tODS_INF_GLPCT]
      inner join 
      [ODS].[Staging].[tODS_INF_GLPGL] ON tODS_INF_GLPCT.CTPAGE = tODS_INF_GLPGL.GLPAGE
      where 
      CTACCT like '[0-9][0-9][0-9]-[0-9][0-9][0-9]-63020-4110%'
    This one gives me the exact result i want, now if i add one more to my where clause like this
    /****** Script for SelectTopNRows command from SSMS  ******/
    SELECT distinct 
    ctacct,sum(GLMN02)
    --,ctdesc,CTPAGE
    --SUM(GLMN02)
      FROM [ODS].[Staging].[tODS_INF_GLPCT]
      inner join 
      [ODS].[Staging].[tODS_INF_GLPGL] ON tODS_INF_GLPCT.CTPAGE = tODS_INF_GLPGL.GLPAGE
      where 
      CTACCT like'[0-9][0-9][0-9]-[0-9][0-9][0-9]-63020-4110%' or
      CTACCT like '[0-9][0-9][0-9]-[0-9][0-9][0-9]-63020-4115%'
    This query doesnt give me the exact values instead it gives me all the weird values.Can someone please help me with how to work on this where clause?
    Thanks

    Hi Patrick,
    This is what i ve tried earlier and it isnt working .If i use the first query
    /****** Script for SelectTopNRows command from SSMS  ******/
    SELECT distinct 
    ctdesc,SUM(GLMN02)
    --,ctdesc,CTPAGE
    --SUM(GLMN02)
      FROM [ODS].[Staging].[tODS_INF_GLPCT]
      inner join 
      [ODS].[Staging].[tODS_INF_GLPGL] ON tODS_INF_GLPCT.CTPAGE = tODS_INF_GLPGL.GLPAGE
      where 
     CTAcct LIKE '[0-9][0-9][0-9]-[0-9][0-9][0-9]-63020-4110%'
       --OR
       --CTAcct LIKE '[0-9][0-9][0-9]-[0-9][0-9][0-9]-63020-4115%'
      and GLYEAR = 2014
      and CTDESC = 'Sales'
      group by ctdesc
    The result set is 
    Sales                        
    -182273.96
    And if i use the second query
    SELECT distinct 
    ctdesc,SUM(GLMN02)
    --,ctdesc,CTPAGE
    --SUM(GLMN02)
      FROM [ODS].[Staging].[tODS_INF_GLPCT]
      inner join 
      [ODS].[Staging].[tODS_INF_GLPGL] ON tODS_INF_GLPCT.CTPAGE = tODS_INF_GLPGL.GLPAGE
      where 
     CTAcct LIKE '[0-9][0-9][0-9]-[0-9][0-9][0-9]-63020-4110%'
     OR
       CTAcct LIKE '[0-9][0-9][0-9]-[0-9][0-9][0-9]-63020-4115%'
      and GLYEAR = 2014
      and CTDESC = 'Sales'
      group by ctdesc
    The result set i get is 
    Sales                        
    -1455441.08
    And i verified that  CTAcct LIKE '[0-9][0-9][0-9]-[0-9][0-9][0-9]-63020-4115%'
    this second line of where clause has not desc as Sales.
    I am not sure whats causing the difference in the values.
    Can you please help me with this?
    Thanks

  • How to use sequence in BPEL transformation

    Hi All,
    I want to use some kind of random unique number in my xsl mapping. I Thought to use a sequence which I generated in database, but in xsl mapping I didn't get a way to use database functions. Can anyone suggest something.
    Thanks in Advance.

    Hi Roshni,
    You seems to use an external parameter inside the XSLT. you can you it as <param> defined in xslt. and call that external parameter with the same name inside the xslt to use.
    suppose you need a count variable inside xslt which comes from external service as DB using Adapter to fetch the value. Now inside xslt:
    and then define
    +<xsl:param name="Count"/>+
    and assign value to your
    +<xsl:variable name="CountDetails" select="integer($Count)"/>+
    before xslt call the variable which needs to be populated and assign it to param defined in xslt
    i.e.
    +<assign name="Assign_XSLParams">
    <copy>
    <from expression="'Count'"/>
    <to variable="SMS_int"
    query="/ns3:parameters/ns3:item/ns3:name"/>
    </copy>
    </assign>+
    Hope this helps !!
    Reg,
    MS

Maybe you are looking for