Read only query help

Hello,
I have read-only access to a database and I'm trying to perform a count on a decoded statement.
I cannot update, merge, create views, or delete at all.
example:
vdh.vin as VIN,
mcs.vehicle.veh_manuf_year@OCP5 as YEAR,
mcs.veh_make.veh_make_desc@OCP5 as MAKE,
vcbc.veh_model.veh_model_desc@OCP5 as MODEL,
vdh.created_timestamp as "TIMESTAMP",
max(to_char(decode(c.COMMAND_ID,'LT_FT_TR_PR',TRIM (TO_CHAR
(c.command_result, 'XXXXXXXXXXXXXXX')), ' '))) LF_TIRE_PRESSURE,
max(to_char(decode(c.COMMAND_ID,'RT_FT_TR_PR',TRIM (TO_CHAR
(c.command_result, 'XXXXXXXXXXXXXXX')), ' '))) RF_TIRE_PRESSURE,
max(to_char(decode(c.COMMAND_ID,'LT_RR_TR_PR',TRIM (TO_CHAR
(c.command_result, 'XXXXXXXXXXXXXXX')), ' '))) LR_TIRE_PRESSURE,
max(to_char(decode(c.COMMAND_ID,'RT_RR_TR_PR',TRIM (TO_CHAR
(c.command_result, 'XXXXXXXXXXXXXXX')), ' '))) RR_TIRE_PRESSURE,
max(to_char(decode(c.COMMAND_ID,'HIGH__PRESSURE_LIMIT',TRIM (TO_CHAR
(c.command_result, 'XXXXXXXXXXXXXXX')), ' '))) HI_LIMIT,
max(to_char(decode(c.COMMAND_ID,'LOW__PRESSURE_LIMIT',TRIM (TO_CHAR
(c.command_result, 'XXXXXXXXXXXXXXX')), ' '))) LO_LIMIT,
c.STATUS as STATUS,
dh.DTC_CODE as DTC_CODE,
dh.EXPLANATION_TEXT as DTC_EXPLANATION
from vdu.c2pt_data_history c, veh_diag_history vdh,
vdu.connected_veh_param cvp,
module_history mh, dtc_history dh,
mcs.vehicle@OCP5, mcs.veh_make@OCP5, vcbc.veh_model@OCP5,
vcbc.veh_manufacturer@OCP5
where ((c.VEH_DIAG_HISTORY_SAK = vdh.VEH_DIAG_HISTORY_SAK)
and (vdh.CASE_SAK = cvp.CASE_SAK)
and (dh.MODULE_HISTORY_SAK = mh.MODULE_HISTORY_SAK)
and (vdh.VEH_DIAG_HISTORY_SAK = mh.MODULE_HISTORY_SAK)
and (cvp.VEHICLE_SAK = vehicle.vehicle_sak@OCP5)
and (veh_make.veh_manuf@OCP5 = veh_model.veh_manuf@OCP5)
AND (veh_make.veh_make@OCP5 = veh_model.veh_make@OCP5)
AND (veh_manufacturer.veh_manuf@OCP5 = veh_model.veh_manuf@OCP5)
AND (veh_model.veh_manuf@OCP5 = vehicle.veh_manuf@OCP5)
AND (veh_model.veh_make@OCP5 = vehicle.veh_make@OCP5)
AND (veh_model.veh_model@OCP5 = vehicle.veh_model@OCP5)
AND (veh_model.veh_manuf_year@OCP5 = vehicle.veh_manuf_year@OCP5))
and c.CREATED_TIMESTAMP >= to_date ('10/20/2007 12:00:00 AM','MM/DD/YYYY
HH:MI:SS AM')
and c.CREATED_TIMESTAMP < to_date ('10/21/2007 12:00:00 AM','MM/DD/YYYY
HH:MI:SS AM')
group by vdh.vin, mcs.vehicle.veh_manuf_year@OCP5,
mcs.veh_make.veh_make_desc@OCP5,
vcbc.veh_model.veh_model_desc@OCP5, vdh.created_timestamp, c.STATUS,
dh.DTC_CODE,
dh.EXPLANATION_TEXT
order by vdh.created_timestamp
unfortunately it returns no data. I think there is a disconnect between table:dh and table:c
but my main problem is how do I add another column called count which counts from 0 through 4 what the return is on:
max(to_char(decode(c.COMMAND_ID,'LT_FT_TR_PR',TRIM (TO_CHAR
(c.command_result, 'XXXXXXXXXXXXXXX')), ' '))) LF_TIRE_PRESSURE,
max(to_char(decode(c.COMMAND_ID,'RT_FT_TR_PR',TRIM (TO_CHAR
(c.command_result, 'XXXXXXXXXXXXXXX')), ' '))) RF_TIRE_PRESSURE,
max(to_char(decode(c.COMMAND_ID,'LT_RR_TR_PR',TRIM (TO_CHAR
(c.command_result, 'XXXXXXXXXXXXXXX')), ' '))) LR_TIRE_PRESSURE,
max(to_char(decode(c.COMMAND_ID,'RT_RR_TR_PR',TRIM (TO_CHAR
(c.command_result, 'XXXXXXXXXXXXXXX')), ' '))) RR_TIRE_PRESSURE
all I need to know is whether or not 1 through 4 are null or not, if not, then set the value to 1 and then if null then the value is zero and cound 1 through 4 in the column called count_pressure.
the values may be anything from 1.23232 to 100000.00323.
I hope this makes sense.

Not sure if I understand your requirements but perhaps;
SQL> with t as (
   select 5 c1,5 c2,5 c3,5 c4 from dual union all
   select 5, 5, 5, null from dual union all
   select null, null, null, null from dual union all
   select null, null, 5, 5 from dual)
select
   nvl2(c1,1,0) +
   nvl2(c2,1,0) +
   nvl2(c3,1,0) +
   nvl2(c4,1,0) tot
from t
       TOT
         4
         3
         0
         2

Similar Messages

  • "read only" query

    Hi folks
    Trying to solve a problem with my cousin's eMac (which I am not particularly familiar with). I suggested he try starting up in Singe User Mode and running the repair command (sbin/fsck -f) but when he attempted this, he told me that his machine told him that it was "read only"
    I therefore wondered if this was something specifically related to the eMac, or whether it's due to his particular set-up of the machine and whether there is something which needs adjusting to allow him to run this single user command
    FYI as much as I've encouraged him to upgrade to OS X 10.4 , coming from the "if it ain't broke, don't fix it" school of thought, he's been afraid to do so and is therefore still running OS X 10.3.9 on his eMac
    As always my utmost thanks in advance in the hope that you might be able to shed some light on my query
    Warm regards
    Bernard

    Not sure if I understand your requirements but perhaps;
    SQL> with t as (
       select 5 c1,5 c2,5 c3,5 c4 from dual union all
       select 5, 5, 5, null from dual union all
       select null, null, null, null from dual union all
       select null, null, 5, 5 from dual)
    select
       nvl2(c1,1,0) +
       nvl2(c2,1,0) +
       nvl2(c3,1,0) +
       nvl2(c4,1,0) tot
    from t
           TOT
             4
             3
             0
             2

  • External Hard drive is suddenly Read only.  Help!

    I reformatted my I mac due to it being extremely slow. After reformat, the toshiba external hard drive that I have been using for months before with no problem, is now a read only. I have over 1TB of space available and I need to use it. Does anyone know what happened and how to fix it. I cant lose my information.

    In the Finder, press the key combination shift-command-C, or select
    Go ▹ Computer
    from the menu bar. A window will open showing all mounted volumes. Select the one in question and open the Info window. What is shown as the Format in the General section?

  • OracleCommand.Transaction property is read only Pls Help me

    I Am Using oracle 9 .2.
    Imports Oracle.DataAccess.Client
    Imports Oracle.DataAccess.Types
    Dim lCmdSql, lCmdErr As New OracleCommand
    Dim lTrans, lTransErr As OracleTransaction
    lCmdSql.Connection = conGlobal
    'lCmdSql = conGlobal.CreateCommand()
    lCmdSql.CommandTimeout = 500000
    lTrans = conGlobal.BeginTransaction(IsolationLevel.ReadCommitted)
    'Error Come Here
    Transaction property is read only
    lCmdSql.Transaction = lTrans'''''''''''

    Hi,
    How many machines are effected by this problem?
    I've seen someone suggested you disable add-ins, does this work? To eliminate the influence by add-ins, we can also start Outlook in Safe Mode to test:
    Press Win + R, type "outlook.exe /safe" in the blank box, press Enter.
    If the issue persists, please switch the account to work in Online Mode:
    Go to Account Settings -> Double click on the account -> Uncheck "Use Cached Exchange Mode" -> Next -> Finish.
    You will need to restart Outlook to work in Online Mode.
    Now please check if this issue persists when you select the contact in Step 6. I suggest you do this so since in Cached Mode Outlook uses the Offline Address Book, and in Online Mode Outlook uses Global Address List directly. If it works fine in Online Mode,
    probably the OAB is corrupted and I suggest you go to C:\Users\username\AppData\Local\Microsoft\Outlook, find the Offline Address Books folder and delete it. Outlook will generate a new one when it starts next time in Cached Mode, let's see if it fixes the
    issue.
    Regards,
    Melon Chen
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • Pages: this location is read-only, ? Help

    This occurred after having a new OS X installed. I wish to be able to simply save documents & create folders as I'm doing so.

    I also have this problem and have read/write permissions on the folders it occurs in. It is only since I have upgraded to Maverick that this problem occurs, so it is probably not Pages problem.
    For example, sometimes, when I try to save a copy or a PDF in Pages, it tells me that the volume I am trying to save to will not accept a file name of more than 32 characters. Even when I change to less than 32 characters or remove any symbols from the filename, it will not allow it. The work around is to save to desktop and then move the file but is a little annoying.
    This problem occurs also when trying to save attachments from Email, so is unlikely to be a Pages problem but seems like a set of Maverick' bugs. Any inspiration if the two things might be connected?

  • Read Only Mode Help Please Guys!

    Friends, but I did attach database,I am using the following code when correcting:
    1)
    ALTER DATABASE test SET Read_write;
        GO
    ALTER DATABASE test SET SINGLE_USER;
        GO
        DBCC CHECKDB (test REPAIR_ALLOW_DATA_LOSS) WITH NO_INFOMSGS;
        GO
    2)
    USE master;
    GO
    ALTER DATABASE test
    SET SINGLE_USER
    WITH ROLLBACK IMMEDIATE;
    GO
    ALTER DATABASE test
    SET READ_write;
    GO
    ALTER DATABASE test
    SET MULTI_USER;
    GO
    Error message:
    Msg 5120, Level 16, State 101, Line 1
    Unable to open the physical file "C:\edit.mdf". Operating system error 5: "5(Access is denied.)".
    Msg 5120, Level 16, State 101, Line 1
    Unable to open the physical file "C:\edit.LDF". Operating system error 5: "5(Access is denied.)".
    Msg 945, Level 14, State 2, Line 1
    Database 'edit' cannot be opened due to inaccessible files or insufficient memory or disk space. See the SQL Server errorlog for details.
    Msg 5069, Level 16, State 1, Line 1
    ALTER DATABASE statement failed.
    Msg 5011, Level 14, State 5, Line 1
    User does not have permission to alter database 'edit', the database does not exist, or the database is not in a state that allows access checks.
    Msg 5069, Level 16, State 1, Line 1
    ALTER DATABASE statement failed.
    Msg 102, Level 15, State 1, Line 1
    Incorrect syntax near 'edit'.
    Msg 319, Level 15, State 1, Line 1
    Incorrect syntax near the keyword 'with'. If this statement is a common table expression, an xmlnamespaces clause or a change tracking context clause, the previous statement must be terminated with a semicolon.

    Hi,
    As Tom pointed out, could you please clarify the ‘edit’ and ‘test’ database?
    Which account you used for SQL Server service?
    It seems a permission issue. The account should have the permission on the location which you placed the mdf file and ldf file in. And have the mdf and ldf file in the right location.
    Thanks.
    Tracy Cai
    TechNet Community Support

  • Read-Only text area

    Hi,
    I'm using a text area to display a longer read-only text. It should display only 5 lines and, if the text is longer, it should be scrollable. Works fine as long as I set the attribute Editable to true. But if I set it to No (because it should be read-only), I get the following problems:
    - It does not show only the 5 lines anymore, but the complete text without scrollbars.
    - It shrinks the size of the text area, so that it fits the text inside. You can see that looking at the borders. But I wanted to have the borders at the original size independent of the text.
    Does anyone knows, how to solve that?
    Thanks&Regards
    Matthias

    to the best of my knowledge, if you make it read-only you cannot have the scroll bar enabled. and whatever you explained is the expected behaviour!!
    But, i have a workaround under three conditions:
    1. if you need the scroll bar
    2. if you want the size of it as in the initial state - without disturbing the existing size and format of page
    3. you wish to retain the value
    keep the value of the text area in a temporary object and pass it to the reference attribute on submit of page. (here we are just retaining the value and not making it read-only)
    this helps in keeping the format of page undisturbed!!
    HTH
    Sharma

  • Mail attachments won't save - saying folders are Read Only

    Every time I try save an attachement, mail pops up saying this location is read-only,
    Any help?

    I still can't fix this issue.
    This is what happens when I try to create a new folder in the target folder that I want to save my attachments too. The target folder has Read & Write access for everyone.
    I've tried:
    Accessing Repair Utilities and typed in resetpassword
    Resetting the permissions on my computer
    Relaunch Finder
    But so far nothing works and I still get the Read Only error message when trying to create a new folder to save my attachments.
    UPDATE:
    I've used these steps by Linc Davis, who is like a savior for everything Mac!
    The thread to this problem can be found here - https://discussions.apple.com/thread/4925516?start=0&tstart=0
    Now my email is back to normal!
    Message was edited by: jajashahmohen

  • Headquarter Error : Property 'DocEntry' of 'Document' is read only

    Hi All,
    I had followed "How to Build & Run a B12B1 Scenario" Documentation and until I created a biz package and activated successfully. But when I try to create a PO in the subsidiary system, It sends ok, but I get the following error in admin console > monitoring > error inbox under the headquarter :
    com.sap.b1i.xcellerator.XcelleratorException: XCE001 Nested exception: com.sap.b1i.bizprocessor.BizProcException: BPE001 Nested exception: com.sap.b1i.xcellerator.XcelleratorException: XCE001 Nested exception: com.sap.b1i.xcellerator.XcelleratorException: XCE001 Nested exception: java.lang.RuntimeException: Invoke of: GetBusinessObjectFromXML Source: Description: CServiceData::VerifyPropertyWrite failed; Property 'DocEntry' of 'Document' is read only
    Your help is appreciated.
    Hany

    Hi Hany,
    the error message tells you that the field DocEntry is a read-only property. That means this field must not occur in the receiver payload. The fields DocEntry, DocNum etc. will be created automatically by the receiving system.
    Please have a look at the SDK Help (DI Reference) according to your current version. There you will see which fields are read-only.
    Kind regards,
    Marcus

  • Caching read-only data in a weblogic cluster: Need Help

    Hello,
    I'm working on the development of a web site that will be based on a weblogic cluster spread across several weblogic instances running on several unix boxes.
    To avoid frequent hits to the database, I would like hold a huge amount of data in the application's in-memory cache. The idea is to query the database at startup and store the results in memory for the life of the JVM.
    I have three questions around this:
    1. Is it advisable to store this data in the form of read-only entity beans?
    2. If not, what other options do I have?
    3. In some rare cases, a back-end script might change (and commit) data contained in one or two of these 64000 records. What is the best way of propagating these data changes across the cluster?
    Any help in this regard would be greatly appreciated.
    Regards,
    Dipak Jha

    Could somebody please guide me on this?
    Dipak Jha

  • I have an external hard drive, from Iomega. However, I cannot copy or save any file to it. On my PC it says that is possible to read and write in it, but in my Mac, it says I can only read. can somebody help me?

    I have an external hard drive, from Iomega. that I can open and see my files. However, I cannot copy or save any file to it. On my PC I have it says that is possible to read and write in it, but in my Mac, it says I can only read. can somebody help me?
    Also, Im a photographer, so I like to name a lot of files at the same time (used to do in on PC and it was very usefull.) cannot find out how to do it on my Mac. Really appretiate if some one can give me a solution! Thanx

    Your drive is formatted with the NTFS file system.  OS X can read but not write to the NTFS file system.  There are third party drivers available that claim to add the ability to OS X to write to an NTFS partition.  I have not tried them and don't know if they work.
    The only file system that OS X and Windows can both write to natively is the FAT32 file system.

  • Authorization in BEx Query Designer: "read only" for definitions of variables

    Hello,
    I`m developing a concept of authorizations for key user who should be able to maintain certain
    objects in the query designer. For other objects they should have access “read only”.
    The users have authorizations  to  design new queries.  They should be able to use existing variables
    (SAP Business Content ( 0*) and customer variables (z*). On this point, I have a problem: in the selection window of the query designer there are only buttons to create, to delete and to edit a variable.
    The user must have authorizations for changing, although he just wants to look for the definition
    of a variable (if he wants to see their basic or global settings before using the variable).
    I can´t find a possibility to switch from “edit” to “read only”.
    The users should only see and apply variables from others (SAP, collegues), but he mustn´t be able to
    change them.
    The user needs the following authorization objects:  S_RS_COMP , activity =02 (change), also
    authorization object S_RS_COMP1. If I give the users only activity 03 (display),
    the user get the message: “display not allowed”.
    Is there any possibility to give a key user the authorization to display all variables with
    their definitions?
    Best regards
    Ricarda Seyb

    Hi raghukan,
    This is may be due to the authorization but still you can check the consistency check for these queries using RSRV.
    Regards,
    Amit

  • Urgent :need help to setup Master to snapshot(read only) environement

    Hi,
    I need your help urgently. I don't know much about master to Snapshot configuration. I need to do prototype of master to snapshot(read only) as soon as possible. I need replication setup/configuration scripts.
    DB1 is master database (8i) and DB1 is Snapshot site db.
    both dbs are identical except they have different Global_name.
    I want to replicate table from DB1---> DB2 unidirectional.
    Global name for DB1 is DB1.world and for DB2 is DB2.world
    TNS names are DB1 and DB2 respectively and TNSNAMES.ORA file is same on both server.
    Schema owner of Mster site (who owns the tables that I want to replicate) is user 'SYNAPSE'. On DB2 I have also same schema with same tables. Lets say table called 'TEST' that I want to replicate from DB1 to DB2.
    for simplicity I want to have only one account(user) on both site who can do administration and take care of all other task including replication.
    I need scripts to do setup for the replication environment described above.
    In short please provide me script to replicate DB1 to DB2 (Master to snapshot).
    I appreciate your help very much.
    You can reach me at [email protected] as well.
    Thank you.
    Pravin

    Finally I figured out how to setup/configure master to Snapshot environment but I have to say that Oracle documents are very confusing.
    The problems I ran into are:
    User Repadamin can't create MV in schema owner other than repadmin. Work arround I used is let that schemema owner allow to create MV.
    Other proble ran in is Constraint(FK) violation when trying to do using refresh group. To resolve this problem either disable constraints on snapshot site or create constraints usinf deferred option.
    Pravin

  • Querying up AR Customer OA page in read-only mode for a Single Customer

    We are building a Custom Form in which associated Customer <defined in AR> would be queried up.
    Now we want to give an option to the User to view the complete details of the Customer. We would be giving a menu option in Tools 'View Customer' thru which he would see the Full Customer Details. <AR Customer OA page>
    We have two requirements
    1> The Full Customer Details should show up in Standard OA Customer Page the moment page comes up. The user should not be required to query the details.
    2> It should be read-only and user should not be able to update any field.
    How can we achieve this requirement? I did some RnD but did not see any place in EBS where we display the Customer Page in read-only mode and that too quried up for one particular customer.
    Thanks
    Arun

    Hi Arun,
    Please let me know if find any solution for this. We have a similar scenario in which we need to call the customer Page with all the inforamtion populated, related to one customer.
    Thanks in advance,
    Mannuru

  • HELP- "IPOD Cant Be Synced.  The Disk is locked"  Cant remove Read only

    I cannot remove read only from the IPod Control folder. It won't let me. I cant load music to my ipod, which I previously have with same computer, itunes, everything. I have the most updated itunes, software, etc.
    Can anyone help me? I have no clue what to do. I tried to right click on the ipod disk and run an error check. that didnt work. I'm clueless. Help!

    Hello Mark,
    And welcome to Apple Discussions!
    I don't really have any suggestions for you, but I can point you to an older thread where you might find help. Check out this old post from another forum member who managed to address this issue him/herself.
    http://discussions.apple.com/thread.jspa?threadID=1651418
    B-rock

Maybe you are looking for