Data of column datatype CLOB is moved to other columns of the same table

Hi all,
I have an issue with the tables having a CLOB datatype field.
When executing a simple query on a table with a column of type CLOB it returns error [POL-2403] value too large for column.
SQL> desc od_stock_nbcst_notes;
Name Null? Type
OD_STOCKID N NUMBER
NBC_SERVICETYPE N VARCHAR(40)
LANGUAGECODE N VARCHAR(8)
AU_USERIDINS Y NUMBER
INSERTDATE Y DATE
AU_USERIDUPD Y NUMBER
MODIFYDATE Y DATE
VERSION Y SMALLINT(4)
DBUSERINS Y VARCHAR(120)
DBUSERUPD Y VARCHAR(120)
TEXT Y CLOB(2000000000)
NBC_PROVIDERCODE N VARCHAR(40)
SQL> select * from od_stock_nbcst_notes;
[POL-2403] value too large for column
Checking deeply, some of the rows have got the data of the CLOB column moved in another column of the table.
When doing select length(nbc_providercode) the length is bigger than the datatype of the field (varchar(40)).
When doing substr(nbc_providercode,1,40) to see the content of the field, a portion of the Clob data is retrieved.
SQL> select max(length(nbc_providercode)) from od_stock_nbcst_notes;
MAX(LENGTH(NBC_PROVIDERCODE))
162
Choosing one random record, this is the stored information.
SQL> select length(nbc_providerCode), text from od_stock_nbcst_notes where length(nbc_providerCode)=52;
LENGTH(NBC_PROVIDERCODE) | TEXT
-------------------------+-----------
52 | poucos me
SQL> select nbc_providerCode from od_stock_nbcst_notes where length(nbc_providerCode)=52;
[POL-2403] value too large for column
SQL> select substr(nbc_providercode,1,40) from od_stock_nbcst_notes where length(nbc_providercode)=52 ;
SUBSTR(NBC_PROVIDERCODE
Aproveite e deixe o seu carro no parque
The content of the field is part of the content of the field text (datatype CLOB, containts an XML)!!!
The right content of the field must be 'MTS' (retrieved from Central DB).
The CLOB is being inserted into the Central DB, not into the Client ODB. Data is synchronized from CDB to ODB and the data is reaching the client in a wrong way.
The issue can be recreated all the time in the same DB, but between different users the "corrupted" records are different.
Any idea?

939569 wrote:
Hello,
I am using Oracle 11.2, I would like to use SQL to update one column based on values of other rows at the same table. Here are the details:
create table TB_test (myId number(4), crtTs date, updTs date);
insert into tb_test(1, to_date('20110101', 'yyyymmdd'), null);
insert into tb_test(1, to_date('20110201', 'yyyymmdd'), null);
insert into tb_test(1, to_date('20110301', 'yyyymmdd'), null);
insert into tb_test(2, to_date('20110901', 'yyyymmdd'), null);
insert into tb_test(2, to_date('20110902', 'yyyymmdd'), null);
After running the SQL, I would like have the following result:
1, 20110101, 20110201
1, 20110201, 20110301
1, 20110301, null
2, 20110901, 20110902
2, 20110902, null
Thanks for your suggestion.How do I ask a question on the forums?
SQL and PL/SQL FAQ

Similar Messages

  • If I set up icloud will my data from my device download onto other device on the same account via icloud?

    I Don't want my data from my phone to backup on my other devices on the same account via icloud. will this happen if I set up icloud?

    Then on the device you don't want the information uncheck the iCloud items in the list.

  • How to write a case statement for the totals column of two different years (2013 and 2014) of the same month so that I can get a +/- column

    Please Help!!!
    How to write a case statement for the totals column of two different years (2013 and 2014) of the same month so that I can get a +/- column.
                                      January 2014         January
    2013                            +/-
                    Region   Entry   Exit  Total    Entry   Exit   Total   (Total of Jan2014-Total of Jan2013)
                    A               2         3      
    40        5       7        30                    40-30= 10

    What is a table structure? Sorry cannot test it right now..
    SELECT <columns>,(SELECT Total FROM tbl WHERE Y=2014)-(SELECT Total FROM tbl WHERE Y=2013)
    FROM tbl
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Nsert/Update and Add Column at the same Table and at the "same" Time

    Hello,
    I want Insert/Update and Add Column at the same Table and at the "same" Time but in different sessions.
    Example:
    At first the "insert/update" statement:
    Insert into TestTable (Testid,Value) values (1,5105);
    After that the "add" statement:
    Alter table TestTable add TestColumn number;
    - sadly now I get the message: ORA-00054: resource busy and acquire with NOWAIT specified
    "insert/update" statement:
    Insert into TestTable (Testid,Value) values (2,1135);
    After that the execute commit.
    I don't know when the first session set the commit statement so I want that the DB the "Alter Table..." statement execute if it's possible.
    If it's possible I want to save a repeat loop with the "Alter Table..." statemtent.
    Thanks for ideas

    Well I want to walk in the rain without and umbrella and still stay dry, but it ain't gonna happen.
    You can't run a DDL statement against a table with transactions pending. Session 2 has to wait until session commits or rollbacks (or until the session is killed). That's just the way it is.
    This makes sense if you think about it. The data dictionary has to be consistent across all sessions. If session 2 was allowed to change the table structure whilst session 1 has a pending transaction then the database is in an inconsistent state. This is easier to see if you consider the reverse situation - the ALTER TABLE statement run by session 2 does a DROP COLUMN TESTID rather than adding a column: now what should happen to session 1's INSERT statement? You have retrospectively invalidated a statement that was perfectly legal when it was executed.
    If it's possible I want to save a repeat loop with the "Alter Table..." statemtent.Fnord.
    Cheers, APC

  • Import data from few tables and export into the same tables on different db

    I want to import data from few tables and export into the same tables on different database. But on the target database, additional columns have been added
    to the same tables. how can i do the import?
    Its urgent can anyone please help me do this?
    Thanks.

    Hello Junior DBA,
    maybe try it with the "copy command".
    http://download.oracle.com/docs/cd/B14117_01/server.101/b12170/apb.htm
    Have a look at the section "Understanding COPY Command Syntax".
    Here is an example of a COPY command that copies only two columns from the source table, and copies only those rows in which the value of DEPARTMENT_ID is 30:Regards
    Stefan

  • How to populate data in the same table based on different links/buttons

    Hi
    I'm using jdeveloper 11.1.4. I have a use case in which i need to populate data in the same table based on click of different links.
    Can anyone please suggest how can this be achieved.
    Thanks

    I have a use case in which i need to populate data in the same table based on click of different linksDo you mean that you need to edit existing rows ?
    What format do you have the date in - table / form ?

  • For existing data in BI, client need to take a call to park the same from s

    hi,
    friends,
    For existing data in BI, client need to take a call to park the same from safety point view by copying the existing ODS  
    is it possible?if it is possible give me details.
    thanks&regurds
    sivaji

    hi,
    well when you copy an ODS only the structure is copied. to load the data you might need to create transformation and DTp to load data in the new ODS.
    You need to load data manually. Copying the ODS will only copy the structure.
    Regds,
    Shashank

  • Load Data from a table on one server's database, to the same table structure in multiple server databases

    Hi,
    I have a situation where i have to load data from one server/database table to multiple servers/databases.
    Example:
    I need to load data from dbo.TABLE_A  (on Server: Server_A & Database: Database_A)  to the same table on the list of server databases like
    Server: Server_B , Database: Database_B
    Server: Server_C , Database: Database_C
    Server: Server_D , Database: Database_D
    Server: Server_E , Database: Database_E
    Server: Server_F , Database: Database_F
    Server: Server_G , Database: Database_G
    Server: Server_H , Database: Database_H
    so on and so forth on 250 such server database combinations.
    The table structure is the same on all the servers.
    If i make the source or destination dynamic, it throws an error while mapping ?
    I cannot get Linked server permissions and SQL Server Config thing doesn't work as well.
    Please suggest on how to load data from one source to multiple server/databases.
    Thank you.

    I just need to transfer one table's data. its like i have to use a query to pick data for
    the most recent data. So i use something like, select A, B, C, D from dbo.table where ETL_TIMESTAMP > (the max(etltimestamp) in the destination on different server). There are no foreign key relationships and the data should not be truncated. it just had
    to append the new records.

  • Could u plz help me to find simple example for how to save data file in a spread sheet or any other way in the real time controller for Sbrio 9642 using memory or usb flash memory

    Could u plz help me to find simple example for how to save data file in a spread sheet or any other way in the real time controller for Sbrio 9642 using memory or usb flash memory

    Here are a few Links to a helpful Knowledge Base article and a White Paper that should help you out: http://digital.ni.com/public.nsf/allkb/BBCAD1AB08F1B6BB8625741F0082C2AF and http://www.ni.com/white-paper/10435/en/ . The methods for File IO in Real Time are the same for all of the Real Time Targets. The White Paper has best practices for the File IO and goes over how to do it. 
    Alex D
    Applications Engineer
    National Instruments

  • How to update a table (CUSTOMER) on a Report Server with the data from the same table (CUSTOMER) from another server Transaction server?

    I had an interview question that is:
    How to update a table (Customer) on a server ex: Report Server with the data from the same table (Customer) From another server ex: Transaction server?
    Set up steps so inset, update or delete operation takes place across the servers.
    It would be great if someone please enlighten me in details about this process in MS SQL Server 2008 R2.
    Also please describe would it be different for SQL Server 2012?
    If so, then what are the steps?

    I had an interview question that is:
    How to update a table (Customer) on a server ex: Report Server with the data from the same table (Customer) from another server ex: Transaction server?
    Set up steps so that inset, update or delete operation gets done correctly across servers.
    I was not sure about the answer, it would be great if someone please put some light on this and explain in details about this process in MS SQL Server 2008 R2.
    Also it would be very helpful if you please describe would it be different for SQL Server 2012? If so, then what are the steps?

  • Historical and transaction data in the same tables creates perf problems

    Our Oracle based application is slow partly due to the fact that historical data are kept in the same table as transactional data. For example records about deceased patients, patients treated 5 years ago...etc, are kept in the one and only one patient table, which is needed to run the daily process of the hospital. So gradually all our major tables PATIENTS, CHARTS, NAMES, APPOINTMENTS have grown very large and since most of our SQL join all these tables at the same time, then all screens and reports run very slowly. I have introduced the idea that we should split all these tables in two: historical PATIENTS data, and CURRENT PATIENTS data...the same with all the others. A nice system would first search in the smaller transactional tables, which would run faster being smaller, and if no data found, then fallback to the historical tables. But this would require programming. From what I have read mateialized view could solve part of our problem. We could have views containing for example only one year worth of the data, and I guess any changes could be later replicated in the base table. What I dont know is what to do if we cannot find the patient in the matealized views ? Do I need to fallback to another SQL which will search in the initial base tables ? Anyway we can implement this without programming ? Tx.

    Appointment table: 207,470
    Visit table: 5,890,920
    Patient table: 2,993,129
    Chart table: 2,864,069
    Patient names table: 3,938,118
    SELECT
        APPOI_OR_VISIT,
        VISIT_SEQ,
        PAT_SEQ,
        INST_CODE,
        INST_CODE_DISPL,
        INST_DESC,
        CLINIC_CODE,
        CLINIC_CODE_DISPL,
        CLINIC_DESC,
        SPEC_CODE,
        SPEC_CODE_DISPL,
        SPEC_DESC,
        VISIT_DATE,
        VISIT_TIME,
        VISIT_TIME_ARRIVAL,
        APPTYPE_CODE,
        SESSION_DOM_MODE,
        PRESTYPE_CODE,
        PRESTYPE_DOM_TYPE,
        DIA_CODE,
        VISIT_TIME_START_RESP,
        VISIT_TIME_DISCHARGE,
        APPOI_NB_DURATION,
        VISIT_TX_REASON,
        VISIT_TX_COMMENT,
        EXTDOC_CODE,
        VISIT_PN_REFPHYS_NAME,
        PATYPE_CODE,
        PAYRESP_CODE,
        VISIT_IND_GROUP,
        VISIT_PCODE,
        VISIT_IND_COMPLETE,
        VISIT_IND_ADMISSION,
        VISIT_IND_CONFIDENTIALITY,
        VISIT_DATE_ACCIDENT,
        APPOI_SEQ,
        BILLING_CODE,
        VISIT_TX_DIAGNOSIS,
        CST_CODE_1,
        CST_CODE_2,
        CST_CODE_3,
        APPOI_DH_CRE,
        APPOI_CODE_CRE_USER,
        APPOI_DH_MOD,
        APPOI_CODE_MOD_USER,
        VISIT_CODE_CRE_USER,
        VISIT_DH_CRE,
        VISIT_UPDATED_COUNT,
        VISIT_CODE_MOD_USER,
        VISIT_DH_MOD,
        APPOI_PAYRESP_CODE,
        APPOI_DT_ACCIDENT,
        PATIENT_LAST_NAME,
        PATIENT_FIRST_NAME,
        PATIENT_CONFIDENTIALITY,
        PATIENT_CHART_EXT,
        TO_NUMBER(SUBSTR(PATIENT_CHART_EXT, 1, INSTR(PATIENT_CHART_EXT, '|')-1)) AS PATIENT_CHART_NO,
        PAT_IND_SPECIAL_RISK
    FROM
        SELECT
            'VISIT'              AS APPOI_OR_VISIT,
            VISIT.VISIT_SEQ,
            VISIT.PAT_SEQ,
            INSTITUTION.INST_CODE,
            INSTITUTION.INST_CODE_DISPL,
            INSTITUTION.INST_DESC,
            CLINIC.CLINIC_CODE,
            CLINIC.CLINIC_CODE_DISPL,
            CLINIC.CLINIC_DESC,
            SPECIALTY.SPEC_CODE,
            SPECIALTY.SPEC_CODE_DISPL,
            SPECIALTY.SPEC_DESC,
            VISIT.VISIT_DATE,
            VISIT.VISIT_TIME,
            VISIT.VISIT_TIME_ARRIVAL,
            VISIT.APPTYPE_CODE,
            VISIT.SESSION_DOM_MODE,
            VISIT.PRESTYPE_CODE,
            VISIT.PRESTYPE_DOM_TYPE,
            VISIT.DIA_CODE,
            VISIT.VISIT_TIME_START_RESP,
            VISIT.VISIT_TIME_DISCHARGE,
            VISIT.APPOI_NB_DURATION,
            VISIT.VISIT_TX_REASON,
            VISIT.VISIT_TX_COMMENT,
            VISIT.EXTDOC_CODE,
            VISIT.VISIT_PN_REFPHYS_NAME,
            VISIT.PATYPE_CODE,
            VISIT.PAYRESP_CODE,
            VISIT.VISIT_IND_GROUP,
            VISIT.VISIT_PCODE,
            VISIT.VISIT_IND_COMPLETE,
            VISIT.VISIT_IND_ADMISSION,
            VISIT.VISIT_IND_CONFIDENTIALITY,
            VISIT.VISIT_DATE_ACCIDENT,
            VISIT.APPOI_SEQ,
            VISIT.BILLING_CODE,
            VISIT.VISIT_TX_DIAGNOSIS,
            VISIT.CST_CODE_1,
            VISIT.CST_CODE_2,
            VISIT.CST_CODE_3,
            VISIT.APPOI_DH_CRE,
            VISIT.APPOI_CODE_CRE_USER,
            VISIT.APPOI_DH_MOD,
            VISIT.APPOI_CODE_MOD_USER,
            VISIT.VISIT_CODE_CRE_USER,
            VISIT.VISIT_DH_CRE,
            VISIT.VISIT_UPDATED_COUNT,
            VISIT.VISIT_CODE_MOD_USER,
            VISIT.VISIT_DH_MOD,
            NULL AS APPOI_PAYRESP_CODE,
            TO_DATE(NULL) AS APPOI_DT_ACCIDENT,
            NAME.NAM_PN_NAM AS PATIENT_LAST_NAME,
            NAME.NAM_PN_FNAM AS PATIENT_FIRST_NAME,
            CONFIDENTIALITY.CONF_DESC AS PATIENT_CONFIDENTIALITY,
            PI_SECURITY.F_GET_CHART_NUMBER_SCAN_CODE(VISIT.PAT_SEQ, 103 /*:pChartInstitutionID*/, 0) AS PATIENT_CHART_EXT,
            PATIENT.PAT_IND_SPECIAL_RISK
        FROM
                   AS_T_VISITS        VISIT,
                   CT_R_INSTITUTIONS  INSTITUTION,
                   AS_T_CLINICS       CLINIC,
                   CT_R_SPECIALITIES  SPECIALTY,
                   PI_T_NAMES         NAME,
                   PI_T_PATIENTS      PATIENT,
                   PI_R_CONF_LEVELS   CONFIDENTIALITY
        WHERE
            VISIT_DATE >= TO_DATE('2004-04-01', 'YYYY-MM-DD') /*:P_VISIT_DATE_FROM*/ AND
            VISIT_DATE <= TO_DATE('2004-04-02', 'YYYY-MM-DD') /*::P_VISIT_DATE_TO*/ AND
            CLINIC.CLINIC_CODE = VISIT.CLINIC_CODE AND
            SPECIALTY.SPEC_CODE = CLINIC.SPEC_CODE AND
            INSTITUTION.INST_CODE(+) = VISIT.INST_CODE AND
            NAME.PAT_SEQ = VISIT.PAT_SEQ AND
            NAME.NAMTYP_CODE = 1 AND
            PATIENT.PAT_SEQ = VISIT.PAT_SEQ AND
            CONFIDENTIALITY.CONF_CODE (+) = PATIENT.CONF_CODE
        UNION
        SELECT
            'APPOI'                                                                                                                                                                                                        AS APPOI_OR_VISIT,
            0                                                                                                                                                                                                                            AS VISIT_SEQ,
            NVL(APPOINTMENT_GROUP.PAT_SEQ, APPOINTMENT.PAT_SEQ) AS PAT_SEQ,
            INSTITUTION.INST_CODE,
            INSTITUTION.INST_CODE_DISPL,
            INSTITUTION.INST_DESC,
            CLINIC.CLINIC_CODE,
            CLINIC.CLINIC_CODE_DISPL,
            CLINIC.CLINIC_DESC,
            SPECIALTY.SPEC_CODE,
            SPECIALTY.SPEC_CODE_DISPL,
            SPECIALTY.SPEC_DESC,
            APPOINTMENT.SESSION_DATE                                                                                                                                                                AS VISIT_DATE,
            APPOINTMENT.APPOI_TIME                                                                                                                                                                     AS VISIT_TIME,
            ''                                                                                                                                                                                                                  AS VISIT_TIME_ARRIVAL,
            APPOINTMENT.APPTYPE_CODE,
            APPOINTMENT.SESSION_DOM_MODE,
            0                                                                                                                                                                                                                            AS PRESTYPE_CODE,
            ''                                                                                                                                                                                                                  AS PRESTYPE_DOM_TYPE,
            0                                                                                                                                                                                                                            AS DIA_CODE,
            ''                                                                                                                                                                                                                  AS VISIT_TIME_START_RESP,
            ''                                                                                                                                                                                                                  AS VISIT_TIME_DISCHARGE,
            APPOINTMENT.APPOI_NB_DURATION,
            APPOINTMENT.APPOI_TX_REASON                                                                                                                                                           AS VISIT_TX_REASON,
            APPOINTMENT.APPOI_TX_COMMENT                                                                                                                                                      AS VISIT_TX_COMMENT,
            APPOINTMENT.EXTDOC_CODE,
            APPOINTMENT.APPOI_PN_REFPHYS_NAME                                                                                                                                            AS VISIT_PN_REFPHYS_NAME,
            APPOINTMENT_TYPE.PATYPE_CODE  AS PATYPE_CODE,
            0                                                                                                                                                                                                                            AS PAYRESP_CODE,
            DECODE(APPOINTMENT_GROUP.PAT_SEQ,NULL,0,1)                                                                                                                   AS VISIT_IND_GROUP,
            ''                                                                                                                                                                                                                  AS VISIT_PCODE,
            0                                                                                                                                                                                                                            AS VISIT_IND_COMPLETE,
            0                                                                                                                                                                                                                            AS VISIT_IND_ADMISSION,
            APPOINTMENT.APPOI_IND_CONFIDENTIALITY                                                                                                                                  AS VISIT_IND_CONFIDENTIALITY,
            TO_DATE(NULL)                                                                                                                                                                                          AS VISIT_DATE_ACCIDENT,
            APPOINTMENT.APPOI_SEQ,
            0                                                                                                                                                                                                                            AS BILLING_CODE,
            ''                                                                                                                                                                                                                  AS VISIT_TX_DIAGNOSIS,
            0                                                                                                                                                                                                                            AS CST_CODE_1,
            0                                                                                                                                                                                                                            AS CST_CODE_2,
            0                                                                                                                                                                                                                            AS CST_CODE_3,
            APPOINTMENT.APPOI_DH_CRE                                                                                                                                                                AS APPOI_DH_CRE,
            APPOINTMENT.APPOI_CODE_CRE_USER                                                                                                                                                 AS APPOI_CODE_CRE_USER,
            APPOINTMENT.APPOI_DH_MOD                                                                                                                                                                AS APPOI_DH_MOD,
            APPOINTMENT.APPOI_CODE_MOD_USER                                                                                                                                                 AS APPOI_CODE_MOD_USER,
            ''                                                                                                                                                                                                                  AS VISIT_CODE_CRE_USER,
            SYSDATE                                                                                                                                                                                                             AS VISIT_DH_CRE,
            0                                                                                                                                                                                                                            AS VISIT_UPDATED_COUNT,
            ''                                                                                                                                                                                                                  AS VISIT_CODE_MOD_USER,
            SYSDATE                                                                                                                                                                                                             AS VISIT_DH_MOD,
            PAYRESP_CODE                                                                             AS APPOI_PAYRESP_CODE,
            APPOI_DT_ACCIDENT,
            NAME.NAM_PN_NAM AS PATIENT_LAST_NAME,
            NAME.NAM_PN_FNAM AS PATIENT_FIRST_NAME,
            CONFIDENTIALITY.CONF_DESC AS PATIENT_CONFIDENTIALITY,
                                        PI_SECURITY.F_GET_CHART_NUMBER_SCAN_CODE(APPOINTMENT.PAT_SEQ, 103 /*:pChartInstitutionID*/, 0) AS PATIENT_CHART_EXT,
            PATIENT.PAT_IND_SPECIAL_RISK
        FROM
                   AS_T_APPOINTMENTS       APPOINTMENT,
                   AS_R_APPOINTMENT_TYPES  APPOINTMENT_TYPE,
                   AS_T_CLINICS            CLINIC,
                   CT_R_SPECIALITIES       SPECIALTY,
                   CT_R_INSTITUTIONS       INSTITUTION,
                   AS_T_APPOINTMENT_GROUPS APPOINTMENT_GROUP,
                   PI_T_PATIENTS           PATIENT,
                   PI_R_CONF_LEVELS        CONFIDENTIALITY,
                   PI_T_NAMES              NAME,
                   AS_T_APPOINTMENT_SEQ_MAPPING  SEQMAP
        WHERE
            SESSION_DATE >= TO_DATE('2004-04-01', 'YYYY-MM-DD') /*:P_VISIT_DATE_FROM*/ AND
            SESSION_DATE <= TO_DATE('2004-04-02', 'YYYY-MM-DD') /*::P_VISIT_DATE_TO*/ AND
            APPOINTMENT.APPOI_DOM_TYPE IN('A','AR') AND
            CLINIC.CLINIC_CODE = APPOINTMENT.CLINIC_CODE AND
            SPECIALTY.SPEC_CODE = CLINIC.SPEC_CODE AND
            INSTITUTION.INST_CODE(+) = APPOINTMENT.INST_CODE AND
            APPOINTMENT_GROUP.APPOI_SEQ (+) = APPOINTMENT.APPOI_SEQ AND
            APPOINTMENT_TYPE.APPTYPE_CODE (+) = APPOINTMENT.APPTYPE_CODE AND
            NAME.PAT_SEQ = NVL(APPOINTMENT.PAT_SEQ, APPOINTMENT_GROUP.PAT_SEQ) AND
            NAME.NAMTYP_CODE = 1 AND
            PATIENT.PAT_SEQ = NVL(APPOINTMENT.PAT_SEQ, APPOINTMENT_GROUP.PAT_SEQ) AND
            CONFIDENTIALITY.CONF_CODE (+) = PATIENT.CONF_CODE AND
            SEQMAP.APPOI_SEQ (+) = APPOINTMENT.APPOI_SEQ AND
            SEQMAP.APPOI_SEQ IS NULL
    ORDER BY
         VISIT_DATE, VISIT_TIME, PATIENT_CHART_NO

  • How to sum different column in the same table

    Hi everyone
    I would like to know how can I make the sum of different column in the same table using apex
    exple:
    TR_PROJ_BIL_TRIM.ENTPIDFISC as ENTPIDFISC,
        TR_PROJ_BIL_TRIM.EXEANNEE as EXEANNEE,
        TR_PROJ_BIL_TRIM.PROJBILTRIMT1PREV as PROJBILTRIMT1PREV,
        TR_PROJ_BIL_TRIM.PROJBILTRIMT2PREV as PROJBILTRIMT2PREV,
        trunc( TR_PROJ_BIL_TRIM.PROJBILTRIMT1PREV)+(TR_PROJ_BIL_TRIM.PROJBILTRIMT2PREV)
    from TR_PROJ_BIL_TRIM TR_PROJ_BIL_TRIM
    group by TR_PROJ_BIL_TRIM.ENTPIDFISC,TR_PROJ_BIL_TRIM.EXEANNEE
    but while trying to run this script i get this error message:"ORA-00979: not a GROUP BY expression"
    thanks for reading me and I hope to hear from you soon

    Hi,
    Your question do not have anything do with APEX.
    It is pure SQL question and you will get better answer this kind questions from SQL and PL/SQL forum
    You need have GROUP BY when you use aggregate functions like SUM.
    I assume you like just add two columns.
    Try
    SELECT ENTPIDFISC
        ,EXEANNEE
        ,PROJBILTRIMT1PREV
        ,PROJBILTRIMT2PREV
        ,trunc(PROJBILTRIMT1PREV) + (PROJBILTRIMT2PREV)
    FROM TR_PROJ_BIL_TRIM
    Regards,
    Jari

  • How to add column to report from the same table? Gives error now

    Steps to reproduce:
    Build a report on a table with easy report, select all columns
    Add column to the table
    Edit report and add column (one has to click Show Related Tables Only: No to view the same table!)
    Report will give error as it will be build as
    SELECT ... FROM table1, table1

    AH HAAA!!!!
    And I was afraid to convert from the "SQL (Structured Query)" to "SQL". Probably because I blew up my other reports...
    Thanks!

  • Using ITunes Tutorials will not play.  Using windows XP.  All software up to date.  I know others have had the same issue, however I have not seen a solution.  I appreciate any advice.

    iTunes Tutorials iwll not play.   Using windows XP.  All software up to date.  I know others have had the same issue, however I have not seen a solution.  I appreciate any advice.

    I have traced the problem to a corrupted profile.  When I captured the images in question, I also used Color Cherckr to create a profile for processing.  When I apply that profile to the adjustments I make, I can no longer "Edit In".  If I use another profile, even one that I created using Color Checkr at a different point in time, I don't have the issue.  Something seems to have corrupted the new profile.  I will re-create the profile and see if the issue is resolved.

  • Retrieve data from the same table

    i have a table with following fields
    emp_no,name,salary,department,dept_prev,prev_emp_no.
    now i want retrieve emp_no,name,salary,department, from the data base for a perticular employeee number along with dept_prev
    but dept_prev is the prev_emp_no dept_prev
    now iam doing two query like this
    first query to retreive name,salary,department
    select name,salary,department from employee where emp_no = 10
    second to retrieve the dept_prev from the same table but this
    dept_prev must be based on prev_emp_no
    select dept_prev from employee where emp_no in(select prev_emp_no from employee where emp_no =10)
    can any one suggest to combine these two queries in a single sql statements, because all the fieldds are from the same table.
    Thanks

    Would this one solve it?
    SELECT emp.NAME, emp.salary, emp.department,
           prev_emp.dept_prev
      FROM employee emp,
           employee prev_emp
    WHERE emp.emp_no      = 10
       AND prev_emp.emp_no = emp.prev_emp_no;
    not tested
    C.

Maybe you are looking for

  • Content Player is not working

    Hi All,

  • Three way matches

    I need to check configuration setting to check if three way matches have been activated for 1) Vendor Order, Good Receipt and Payment to Vendor 2) Customer Order, Customer Invoice and Customer Payment How do I do check this, what is the path.

  • How to make grid without text etc., expand upon load of app?

    hello, i did this, JPanel panInner = new JPanel(); panInner.setLayout(new GridLayout(5, 5, 10, 10)); then after that, i add 25 labels on each without any text.., the grid looks very small and will enlarge upon entering text.., i don't want that to ha

  • Monitoring incoming SOAP messages

    Dear all, I configured a SOAP scenario and provided the customer the URL, but the messages did not arrived our PI System. After an analysis I think I configured the CC wrong. I set the adapter engine to Central AE instead of our AAE that is also used

  • Place is not working.

    For some reason my CS2 is not letting me place images, either through drag and drop or the Place command. I can open images but all I get is a frame. I am not in Outline mode and I'm in Standard Screen Mode. Any ideas?