UpdateXML for non-existing attribute

Hello
bellow are data for a sreange looking (for me) behaviour of updateXML.
Usually (i mean other languages) setting an xml node attribute causes attribute creation if it does not exist.
Here obviously that is not the case.
Q: Why and is it possible to create attribute during node update?
thank you
i
h3. general info
SQL> select * from v$version;
BANNER
Oracle9i Enterprise Edition Release 9.2.0.7.0 - Production
PL/SQL Release 9.2.0.7.0 - Production
CORE 9.2.0.7.0 Production
TNS for 32-bit Windows: Version 9.2.0.7.0 - Production
NLSRTL Version 9.2.0.7.0 - Production
SQL> select dbms_metadata.get_DDL('TABLE', 'X') FROM dual;
DBMS_METADATA.GET_DDL('TABLE',
CREATE TABLE "PCB_1209"."X"
( "NODE" "SYS"."XMLTYPE"
) PCTFREE 10
SQL>
SQL> insert into x values(Xmltype('<TOP><DATAID>111080</DATAID></TOP>'));
SQL> insert into x values(Xmltype('<TOP><DATAID lbl="test">111000</DATAID></TOP>'));
SQL> commit;
Commit complete
h3. correct part
SQL>
SQL> select extract(node, '/').getStringVal() as node
2 from x where extract(node, '//DATAID/text()').getNumberVal() = 111000;
NODE
<TOP>
<DATAID lbl="test">111000</DATAID>
</TOP>
SQL>
SQL> update x set node = updateXML(node,'//DATAID/@lbl','test_new')
2 where extract(node, '//DATAID/text()').getNumberVal() = 111000;
1 row updated
SQL> commit;
Commit complete
SQL>
SQL> select extract(node, '/').getStringVal() as node
2 from x where extract(node, '//DATAID/text()').getNumberVal() = 111000;
NODE
<TOP>
<DATAID lbl="test_new">111000</DATAID>
</TOP>
h3. wrong part
SQL>
SQL> select extract(node, '/').getStringVal() as node
2 from x where extract(node, '//DATAID/text()').getNumberVal() = 111080;
NODE
<TOP>
<DATAID>111080</DATAID>
</TOP>
SQL>
SQL> update x set node = updateXML(node,'//DATAID/@lbl','test_new')
2 where extract(node, '//DATAID/text()').getNumberVal() = 111080;
1 row updated
SQL> commit;
Commit complete
SQL>
SQL> select extract(node, '/').getStringVal() as node
2 from x where extract(node, '//DATAID/text()').getNumberVal() = 111080;
NODE
<TOP>
<DATAID>111080</DATAID>
</TOP>

Unusual, probably. Documented, yes. This is from 10.2 but would still be applicable to you and your situation.
http://download.oracle.com/docs/cd/B19306_01/server.102/b14214/chapter1.htm#FEATURENO05479
The current UpdateXML() function can only manipulate the content of existing nodes within an XML document. It cannot be used to add or remove nodes from a document. The only way to add or remove nodes from a document is to use the methods provided by the DOM API.So you are going to have to insert/create that attribute in the XML before you can update it. I was going to provide a link to some examples but I can't seem to recall where I saw them in the forums. I thought it was on {forum:id=75} but I can't find it now.

Similar Messages

  • WLST crashed on getting non-existing attribute in runtime()

    After downloading the latest WLST package (April 14th, 2005) from the dev2dev site, I'm experiencing WLST crashs after attempting to get an attribute on a non-existing object instead of seeing a normal syntax error message.
    Before updating my jython.jar and wlst.jar for dev2dev:
    wls:/dizzyworld/runtime/ServerRuntime/dizzy1/ApplicationRuntimes/dizzy1_mbeanlis
    ter/ComponentRuntimes/dizzy1_dizzy1_mbeanlister_mbeanlister> get('SessionsOpenTo
    talCount')
    Traceback (innermost last):
    File "<input>", line 1, in ?
    File "<iostream>", line 191, in get
    WLSTException: 'Error occured while performing get : AttributeNotFound Exception
    while doing a getAttribute for attribute SessionsOpenTotalCount. Use dumpStack(
    ) to view the error stack trace'
    After:
    Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x8072644
    Function=[Unknown.]
    Library=D:\bea\jdk142_05\jre\bin\client\jvm.dll
    NOTE: We are unable to locate the function name symbol for the error
    just occurred. Please refer to release documentation for possible
    reason and solutions.
    Current Java thread:
         at java.lang.Throwable.getStackTraceDepth(Native Method)
         at java.lang.Throwable.getOurStackTrace(Throwable.java:588)
         - locked <0x10462cf0> (a java.lang.Throwable)
         at java.lang.Throwable.getStackTrace(Throwable.java:582)
         at weblogic.utils.StackTraceUtils.getThrowableWithCause(StackTraceUtils.java:180)
         at weblogic.rjvm.BasicOutboundRequest.sendReceive(BasicOutboundRequest.java:108)
         at weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:137)
         at weblogic.management.internal.RemoteMBeanServerImpl_814_WLStub.getAttribute(Unknown Source)
         at weblogic.management.scripting.BrowseHandler.handleRuntime(BrowseHandler.java:1596)
         at weblogic.management.scripting.BrowseHandler.regularPush(BrowseHandler.java:981)
         at weblogic.management.scripting.BrowseHandler.splitPush(BrowseHandler.java:139)
         at weblogic.management.scripting.BrowseHandler.cd(BrowseHandler.java:1693)
         at weblogic.management.scripting.BrowseHandler.cd(BrowseHandler.java:1683)
         at weblogic.management.scripting.BrowseHandler.resetCD(BrowseHandler.java:1664)
         at weblogic.management.scripting.BrowseHandler.splitPush(BrowseHandler.java:141)
         at weblogic.management.scripting.BrowseHandler.cd(BrowseHandler.java:1693)
         at weblogic.management.scripting.BrowseHandler.cd(BrowseHandler.java:1683)
         at weblogic.management.scripting.BrowseHandler.resetCD(BrowseHandler.java:1664)
         at weblogic.management.scripting.BrowseHandler.splitPush(BrowseHandler.java:141)
         at weblogic.management.scripting.BrowseHandler.cd(BrowseHandler.java:1693)
         at weblogic.management.scripting.BrowseHandler.cd(BrowseHandler.java:1683)
         at weblogic.management.scripting.EditHandler.get(EditHandler.java:66)
         at weblogic.management.scripting.EditHandler.get(EditHandler.java:57)
         at weblogic.management.scripting.EditHandler.get(EditHandler.java:57)
         at weblogic.management.scripting.EditHandler.get(EditHandler.java:57)
         at weblogic.management.scripting.EditHandler.get(EditHandler.java:57)
    Dynamic libraries:
    0x00400000 - 0x0040B000      D:\bea\jdk142_05\bin\java.exe
    0x77F80000 - 0x77FFD000      C:\WINNT\system32\ntdll.dll
    0x7C2D0000 - 0x7C332000      C:\WINNT\system32\ADVAPI32.dll
    0x7C570000 - 0x7C623000      C:\WINNT\system32\KERNEL32.DLL
    0x77D30000 - 0x77DA1000      C:\WINNT\system32\RPCRT4.DLL
    0x78000000 - 0x78045000      C:\WINNT\system32\MSVCRT.dll
    0x08000000 - 0x08139000      D:\bea\jdk142_05\jre\bin\client\jvm.dll
    0x77E10000 - 0x77E6F000      C:\WINNT\system32\USER32.dll
    0x77F40000 - 0x77F7B000      C:\WINNT\system32\GDI32.dll
    0x77570000 - 0x775A0000      C:\WINNT\system32\WINMM.dll
    0x6BD00000 - 0x6BD0D000      C:\WINNT\system32\SYNCOR11.DLL
    0x10000000 - 0x10007000      D:\bea\jdk142_05\jre\bin\hpi.dll
    0x007C0000 - 0x007CE000      D:\bea\jdk142_05\jre\bin\verify.dll
    0x007D0000 - 0x007E9000      D:\bea\jdk142_05\jre\bin\java.dll
    0x007F0000 - 0x007FD000      D:\bea\jdk142_05\jre\bin\zip.dll
    0x18BE0000 - 0x18BEF000      D:\bea\jdk142_05\jre\bin\net.dll
    0x75030000 - 0x75044000      C:\WINNT\system32\WS2_32.dll
    0x75020000 - 0x75028000      C:\WINNT\system32\WS2HELP.DLL
    0x782C0000 - 0x782CC000      C:\WINNT\System32\rnr20.dll
    0x77980000 - 0x779A4000      C:\WINNT\system32\DNSAPI.DLL
    0x75050000 - 0x75058000      C:\WINNT\system32\WSOCK32.DLL
    0x77340000 - 0x77353000      C:\WINNT\system32\iphlpapi.dll
    0x77520000 - 0x77525000      C:\WINNT\system32\ICMP.DLL
    0x77320000 - 0x77337000      C:\WINNT\system32\MPRAPI.DLL
    0x75150000 - 0x7515F000      C:\WINNT\system32\SAMLIB.DLL
    0x75170000 - 0x751BF000      C:\WINNT\system32\NETAPI32.DLL
    0x7C340000 - 0x7C34F000      C:\WINNT\system32\Secur32.dll
    0x77BF0000 - 0x77C01000      C:\WINNT\system32\NTDSAPI.dll
    0x77950000 - 0x7797A000      C:\WINNT\system32\WLDAP32.DLL
    0x751C0000 - 0x751C6000      C:\WINNT\system32\NETRAP.dll
    0x77A50000 - 0x77B3F000      C:\WINNT\system32\OLE32.DLL
    0x779B0000 - 0x77A4B000      C:\WINNT\system32\OLEAUT32.DLL
    0x773B0000 - 0x773DF000      C:\WINNT\system32\ACTIVEDS.DLL
    0x77380000 - 0x773A3000      C:\WINNT\system32\ADSLDPC.DLL
    0x77830000 - 0x7783E000      C:\WINNT\system32\RTUTILS.DLL
    0x77880000 - 0x7790E000      C:\WINNT\system32\SETUPAPI.DLL
    0x7C0F0000 - 0x7C151000      C:\WINNT\system32\USERENV.DLL
    0x774E0000 - 0x77513000      C:\WINNT\system32\RASAPI32.DLL
    0x774C0000 - 0x774D1000      C:\WINNT\system32\RASMAN.DLL
    0x77530000 - 0x77552000      C:\WINNT\system32\TAPI32.DLL
    0x71710000 - 0x71794000      C:\WINNT\system32\COMCTL32.DLL
    0x70A70000 - 0x70AD6000      C:\WINNT\system32\SHLWAPI.DLL
    0x77360000 - 0x77379000      C:\WINNT\system32\DHCPCSVC.DLL
    0x777E0000 - 0x777E8000      C:\WINNT\System32\winrnr.dll
    0x777F0000 - 0x777F5000      C:\WINNT\system32\rasadhlp.dll
    0x19070000 - 0x19075000      D:\bea\weblogic81\server\bin\stackdump.dll
    0x74FD0000 - 0x74FEE000      C:\WINNT\system32\msafd.dll
    0x75010000 - 0x75017000      C:\WINNT\System32\wshtcpip.dll
    0x77920000 - 0x77943000      C:\WINNT\system32\imagehlp.dll
    0x72A00000 - 0x72A2D000      C:\WINNT\system32\DBGHELP.dll
    0x690A0000 - 0x690AB000      C:\WINNT\system32\PSAPI.DLL
    Heap at VM Abort:
    Heap
    def new generation total 4544K, used 4428K [0x10010000, 0x104f0000, 0x104f0000)
    eden space 4096K, 100% used [0x10010000, 0x10410000, 0x10410000)
    from space 448K, 74% used [0x10410000, 0x10463190, 0x10480000)
    to space 448K, 0% used [0x10480000, 0x10480000, 0x104f0000)
    tenured generation total 60544K, used 60543K [0x104f0000, 0x14010000, 0x14010000)
    the space 60544K, 99% used [0x104f0000, 0x1400ffc0, 0x14010000, 0x14010000)
    compacting perm gen total 8960K, used 8801K [0x14010000, 0x148d0000, 0x18010000)
    the space 8960K, 98% used [0x14010000, 0x148a8630, 0x148a8800, 0x148d0000)
    Local Time = Tue Aug 09 11:22:51 2005
    Elapsed Time = 133
    # HotSpot Virtual Machine Error : EXCEPTION_ACCESS_VIOLATION
    # Error ID : 4F530E43505002EF
    # Please report this error at
    # http://java.sun.com/cgi-bin/bugreport.cgi
    # Java VM: Java HotSpot(TM) Client VM (1.4.2_05-b04 mixed mode)
    Regards,
    Zachary Slaybaugh
    Sr. Application Administrator
    Time Warner Cable, Inc.

    This has been fixed in the latest version of wlst. You can get it from
    https://codesamples.projects.dev2dev.bea.com/servlets/Scarab/id/S13
    Thanks,
    -satya

  • Application hangs for non existing value

    Hi,
    At the DB level I tried to query non existing value from the table, query came out with "no rows selected" . But when I try to do the same from front end, application hangs! I just checked in the statspack report it shows like query is taking more cpu time to execute. what could be the reason for this?
    when I join the v$session,v$sql to get the currently running query on database, it shows the query which try to execute from the application as active.
    why it is hanging in application and why not in DB?
    can any one brief me on this regard? why does application hangs for non exsting value?
    With Regards
    Boo

    Hi,
    At the DB level I tried to query non existing value from the table, query came out with "no rows selected" . But when I try to do the same from front end, application hangs! I just checked in the statspack report it shows like query is taking more cpu time to execute. what could be the reason for this?
    when I join the v$session,v$sql to get the currently running query on database, it shows the query which try to execute from the application as active.
    why it is hanging in application and why not in DB?
    can any one brief me on this regard? why does application hangs for non exsting value?
    With Regards
    Boo

  • CS3 Installer asks for non-existent DVD drive

    I'm running CS3 on Windows XP. I need to reinstall because I somehow lost codecs for Premiere Pro. Whenever I try to reinstall, the CS3 installer puts up an Installer Alert that asks me to insert CS3 Master Collection Disc 1 into drive G:\ to continue installation.
    That sounds pretty simple, but there is no G: drive on my computer. My two DVD drives are D: and E:, and inserting the disc there has no effect. Checking the Windows device manager shows no G: device recognized anywhere on the computer.
    I can only click OK, which returns the same alert, or Cancel to cancel the installation. I cannot, for the life of me, figure out how to get the CS3 installer to ask for installation disks on an existing drive. What's particularly annoying is that the installer is running from a DVD in drive E:, so you'd think it would know to ask for further discs in drive E:. I've tried it as well from drive D:.
    Any ideas for getting the installer to stop asking for discs in a non-existent drive?
    I've toyed with the idea of completely uninstalling CS3, but am afraid that the installer still won't work, in which case I won't be able to get any work done using CS3 at all.
    Thanks for any and all help,
    Mike Boom

    The 404 means you have not followed the Very Important Instructions on the prodesigntools page before clicking the download links.
    The 7 steps are crucial for setting the correct cookies on your hard drive so that the Adobe servers will grant you access to the download files when you click the links.
    So:
    Go back to http://prodesigntools.com/download-adobe-cs4-and-cs3-free-trials-here.html
    Follow the Very Important Instructions (Step 0 to Step 6 = 7 Steps)
    Then click the download links and they will work.

  • More Lion issues - Throwing Console errors for non-existent application

    Again, with the bad side of Lion.
    I was receiving all kinds of console errors in Lion with TweetDeck and Adobe AIR apps so I de-installed these applications and removed them from the system. However, Apple's fantastic Lion Operating System still is complaining about them even though they are not to be found.
    In the console I am getting sandbox errors on locations and files that are non-existent. Below is a snapshot of the error messages, and the directory referred to:  /Users/kkathman/Library/Application Support/Adobe/AIR/ELS/TweetDeckFast....  and the others DON'T EVEN EXIST!!
    How do I keep this from happening?  Why does the OS go after this when it's been removed?????
    8/20/11SaturdayAugust 5:30:14.113 PM    mdworker32    kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch errors as they are logged.
    8/20/11SaturdayAugust 5:31:11.000 PM    kernel    nstat_lookup_entry failed: 2
    8/20/11SaturdayAugust 5:31:44.239 PM    com.apple.SecurityServer    Session 100071 created
    8/20/11SaturdayAugust 5:31:44.254 PM    com.apple.security.XPCKeychainSandboxCheck    Can't get sandbox fs extension for /Users/kkathman/Library/Application Support/Adobe/AIR/ELS/TweetDeckFast.F9107117265DB7542C1A806C8DB837742CE14C21.1/ PrivateEncryptedDatak, status=-1 errno=No such file or directory ext=(null)
    8/20/11SaturdayAugust 5:31:44.254 PM    com.apple.security.XPCKeychainSandboxCheck    Can't get sandbox fs extension for /Users/kkathman/Library/Application Support/Adobe/AIR/ELS/TweetDeckFast.F9107117265DB7542C1A806C8DB837742CE14C21.1/ lck~PrivateEncryptedDatak, status=-1 errno=No such file or directory ext=(null)
    8/20/11SaturdayAugust 5:31:44.254 PM    com.apple.security.XPCKeychainSandboxCheck    Can't get sandbox fs extension for /Users/kkathman/Library/Application Support/Adobe/AIR/ELS/TweetDeckFast.F9107117265DB7542C1A806C8DB837742CE14C21.1/ .fl89CB8354, status=-1 errno=No such file or directory ext=(null)
    8/20/11SaturdayAugust 5:31:44.255 PM    com.apple.security.XPCKeychainSandboxCheck    Can't get sandbox fs extension for /Users/kkathman/Library/Application Support/Adobe/AIR/ELS/com.seesmic.desktop.client.D89F32799270693BEF34AAA36E9B26 32B59240FA.1/PrivateEncryptedDatak, status=-1 errno=No such file or directory ext=(null)
    8/20/11SaturdayAugust 5:31:44.255 PM    com.apple.security.XPCKeychainSandboxCheck    Can't get sandbox fs extension for /Users/kkathman/Library/Application Support/Adobe/AIR/ELS/com.seesmic.desktop.client.D89F32799270693BEF34AAA36E9B26 32B59240FA.1/lck~PrivateEncryptedDatak, status=-1 errno=No such file or directory ext=(null)
    8/20/11SaturdayAugust 5:31:44.255 PM    com.apple.security.XPCKeychainSandboxCheck    Can't get sandbox fs extension for /Users/kkathman/Library/Application Support/Adobe/AIR/ELS/com.seesmic.desktop.client.D89F32799270693BEF34AAA36E9B26 32B59240FA.1/.fl89CB8354, status=-1 errno=No such file or directory ext=(null)
    8/20/11SaturdayAugust 5:31:44.255 PM    com.apple.security.XPCKeychainSandboxCheck    Can't get sandbox fs extension for /Users/kkathman/Library/Application Support/Adobe/AIR/ELS/TweetDeckFast.FFF259DC0CE2657847BBB4AFF0E62062EFC56543.1/ PrivateEncryptedDatak, status=-1 errno=No such file or directory ext=(null)
    8/20/11SaturdayAugust 5:31:44.255 PM    com.apple.security.XPCKeychainSandboxCheck    Can't get sandbox fs extension for /Users/kkathman/Library/Application Support/Adobe/AIR/ELS/TweetDeckFast.FFF259DC0CE2657847BBB4AFF0E62062EFC56543.1/ lck~PrivateEncryptedDatak, status=-1 errno=No such file or directory ext=(null)
    8/20/11SaturdayAugust 5:31:44.255 PM    com.apple.security.XPCKeychainSandboxCheck    Can't get sandbox fs extension for /Users/kkathman/Library/Application Support/Adobe/AIR/ELS/TweetDeckFast.FFF259DC0CE2657847BBB4AFF0E62062EFC56543.1/ .fl89CB8354, status=-1 errno=No such file or directory ext=(null)
    8/20/11SaturdayAugust 5:32:01.234 PM    Preview    snapshot of document took: 0.00030899 secs, calling unblockUserInteraction
    8/20/11SaturdayAugust 5:32:01.318 PM    Preview    writing of document took: 0.083616 secs, success = YES
    8/20/11SaturdayAugust 5:32:42.333 PM    rpcsvchost    sandbox_init: com.apple.msrpc.netlogon.sb succeeded
    8/20/11SaturdayAugust 5:32:42.483 PM    sandboxd    ([66316]) smbd(66316) deny job-creation
    8/20/11SaturdayAugust 5:32:42.583 PM    rpcsvchost    sandbox_init: com.apple.msrpc.srvsvc.sb succeeded
    8/20/11SaturdayAugust 5:32:42.609 PM    smbd    anonymous connected to path /var/rpc/ncacn_np
    8/20/11SaturdayAugust 5:32:53.587 PM    sandboxd    ([66320]) rpcsvchost(66320) deny mach-lookup com.apple.distributed_notifications@1v3
    8/20/11SaturdayAugust 5:34:53.329 PM    smbd    anonymous connected to path /var/rpc/ncacn_np
    8/20/11SaturdayAugust 5:39:32.429 PM    mdworker32    kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch errors as they are logged.

    Don't know how you de-installed but you didn't fully uninstall them. If you did not have an uninstaller supplied with the applications, then here's what you need to consider in order to fully uninstall:
    Uninstalling Software: The Basics
    Most OS X applications are completely self-contained "packages" that can be uninstalled by simply dragging the application to the Trash.  Applications may create preference files that are stored in the /Home/Library/Preferences/ folder.  Although they do nothing once you delete the associated application, they do take up some disk space.  If you want you can look for them in the above location and delete them, too.
    Some applications may install an uninstaller program that can be used to remove the application.  In some cases the uninstaller may be part of the application's installer, and is invoked by clicking on a Customize button that will appear during the install process.
    Some applications may install components in the /Home/Library/Applications Support/ folder.  You can also check there to see if the application has created a folder.  You can also delete the folder that's in the Applications Support folder.  Again, they don't do anything but take up disk space once the application is trashed.
    Some applications may install a startupitem or a Log In item.  Startupitems are usually installed in the /Library/StartupItems/ folder and less often in the /Home/Library/StartupItems/ folder.  Log In Items are set in the Accounts preferences.  Open System Preferences, click on the Accounts icon, then click on the LogIn Items tab.  Locate the item in the list for the application you want to remove and click on the "-" button to delete it from the list.
    Some software use startup daemons or agents that are a new feature of the OS.  Look for them in /Library/LaunchAgents/ and /Library/LaunchDaemons/ or in /Home/Library/LaunchAgents/.
    If an application installs any other files the best way to track them down is to do a Finder search using the application name or the developer name as the search term.  Unfortunately Spotlight will not look in certain folders by default.  You can modify Spotlight's behavior or use a third-party search utility, Easy Find, instead.  Download Easy Find at VersionTracker or MacUpdate.
    Some applications install a receipt in the /Library/Receipts/ folder.  Usually with the same name as the program or the developer.  The item generally has a ".pkg" extension.  Be sure you also delete this item as some programs use it to determine if it's already installed.
    There are many utilities that can uninstall applications.  Here is a selection:
    AppZapper
    Automaton
    Hazel
    CleanApp
    Yank
    SuperPop
    Uninstaller
    Spring Cleaning
    Look for them at VersionTracker or MacUpdate.
    For more information visit The XLab FAQs and read the FAQ on removing software.

  • Each Airport device asking for non-existant password

    My network consists of 2 AEBS and 2 AEs. There is no network password at the moment.
    I just opened up Airport Utility to check a setting and when I double clicked on my main AEBS it asked for a password. I checked every device. They are all asking for a password which doesn't exist, before allowing me to even see the configurations. This happened before with an AE that I was trying to reset, the only way around it was to hook the AE to my mac with ethernet. I really don't want to have to do that every time I want to make a change to my network. Anyone know what's going on here? The same thing happens if I click on Manual Setup or Continue.

    I live on a dirt road with very few neighbors. I would notice if someone parked on the road
    in front of my house. Plus, why would anyone want to change the settings on my airport?
    Also, the passwords it was asking for were not the passwords I had assigned to those airport devices and saved in my keychain. They were some kind of default factory setting passwords.
    Anyway, none of my airport devices is asking me for a password now in order to see their configuration. And I have changed security over to WPA2.
    Message was edited by: pputnam

  • Inserting the default value for non existing date

    hello,
    i am designing a matrix report for payslip for month wise in oracle 6i report builder.
    in that i want to display per day working hours of the month.
    i m using following query for achieving my goal :
    select a.paycode,b.empname,c.departmentname,to_char(a.dateoffice,'DD') dateoffice,a.shiftattended,round(decode(a.hw,0,a.mannual_hours,a.hw),0) hw,
    a.ISMANNUAL,A.STATUS
    from tbltimeregister1 a,
         tblemployee  b,
          tbldepartment c
    where a.paycode=b.paycode and
    (a.hw >0 or a.mannual_hours is not null ) and
    a.departmentcode='D05' AND
    a.departmentcode=c.departmentcode and
    a.dateoffice between to_date('01/12/2012','dd/mm/yyyy') and to_date('31/12/2012','dd/mm/yyyy')
    ORDER BY A.PAYCODE,A.DATEOFFICEit is displaying the hours for the date in b/w date ranges exist in master table.
    my problem is that if any date of a month is not in master data ,it should display the given date in DD format with 0 hours , A(absent) status, and null shift by default.
    pl tell me how to modify my query for getting my desirable result.
    Thanking You
    Regards
    Vishal Agrawal

    965354 wrote:
    hello,
    select a.paycode,b.empname,c.departmentname,to_char(a.dateoffice,'DD') dateoffice,a.shiftattended,round(decode(a.hw,0,a.mannual_hours,a.hw),0) hw,
    a.ISMANNUAL,A.STATUS
    from tbltimeregister1 a,
    tblemployee  b,
          tbldepartment c
    where a.paycode=b.paycode and
    (a.hw >0 or a.mannual_hours is not null ) and
    a.departmentcode='D05' AND
    a.departmentcode=c.departmentcode and
    a.dateoffice between to_date('01/12/2012','dd/mm/yyyy') and to_date('31/12/2012','dd/mm/yyyy')
    ORDER BY A.PAYCODE,A.DATEOFFICEit is displaying the hours for the date in b/w date ranges exist in master table.
    my problem is that if any date of a month is not in master data ,it should display the given date in DD format with 0 hours , A(absent) status, and null shift by default.
    pl tell me how to modify my query for getting my desirable result.Your problem isn't exactly clear to me. How do you pass the dates to be compared to the DateOffice column? It will be better to ensure the Master table contain data for each date (with some default values) and you will not have to tweak your sql.
    Below is a possible solution:
    select *
      from
    select a.paycode,b.empname,c.departmentname,to_char(a.dateoffice,'DD') dateoffice,a.shiftattended,round(decode(a.hw,0,a.mannual_hours,a.hw),0) hw,
    a.ISMANNUAL,A.STATUS
    from tbltimeregister1 a,
         tblemployee  b,
          tbldepartment c
    where a.paycode=b.paycode and
    (a.hw >0 or a.mannual_hours is not null ) and
    a.departmentcode='D05' AND
    a.departmentcode=c.departmentcode and
    a.dateoffice between to_date('01/12/2012','dd/mm/yyyy') and to_date('31/12/2012','dd/mm/yyyy')
    union
    select a.paycode,b.empname,c.departmentname,to_char(&date_variable,'DD') dateoffice,null,round(decode(a.hw,0,a.mannual_hours,a.hw),0) hw,
    a.ISMANNUAL,'A'
    from tbltimeregister1 a,
         tblemployee  b,
          tbldepartment c
    where a.paycode=b.paycode and
    (a.hw >0 or a.mannual_hours is not null ) and
    a.departmentcode='D05' AND
    a.departmentcode=c.departmentcode and
    ORDER BY A.PAYCODE,A.DATEOFFICEIf this is not what you are looking for, then
    1. Post a script that helps us to create the Tables required in your query
    2. Some sample data. That includes the data for master table that has missing dates (4-5 rows should suffice)
    3. The expected results from the sample data you posted.
    Please do not forget to mention your version:
    select * from v$version;

  • SQL Challenge - Returning count=0 for non-existing values

    Hello there,
    I have a question about our requirement and an SQL query. I have posted this to some email groups but got no answer yet.
    Here is the test case:
    SQL> conn ...
    Connected.
    -- create the pattern table and populate
    SQL> create table pattern(id number, keydescription varchar2(50));
    Table created.
    SQL> insert into pattern values(1,'hata1');
    1 row created.
    SQL> insert into pattern values(2,'hata2');
    1 row created.
    SQL> insert into pattern values(3,'hata3');
    1 row created.
    SQL> insert into pattern values(4,'hata4');
    1 row created.
    SQL> insert into pattern values(5,'hata5');
    1 row created.
    SQL> select * from pattern;
    ID KEYDESCRIPTION
    1 hata1
    2 hata2
    3 hata3
    4 hata4
    5 hata5
    SQL> commit;
    Commit complete.
    -- create the messagetrack and populate
    SQL> create table messagetrack(pattern_id number, realdate date);
    Table created.
    SQL> insert into messagetrack values(1,to_date('26/08/2007 13:00:00','dd/mm/yyyy hh24:MI:ss'));
    1 row created.
    SQL> insert into messagetrack values(1,to_date('26/08/2007 13:05:00','dd/mm/yyyy hh24:MI:ss'));
    1 row created.
    SQL> insert into messagetrack values(2,to_date('26/08/2007 13:15:00','dd/mm/yyyy hh24:MI:ss'));
    1 row created.
    SQL> insert into messagetrack values(3,to_date('26/08/2007 14:15:00','dd/mm/yyyy hh24:MI:ss'));
    1 row created.
    SQL> insert into messagetrack values(4,to_date('26/08/2007 15:15:00','dd/mm/yyyy hh24:MI:ss'));
    1 row created.
    SQL> insert into messagetrack values(1,to_date('26/08/2007 15:15:00','dd/mm/yyyy hh24:MI:ss'));
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> select * from messagetrack;
    PATTERN_ID REALDATE
    1 26-AUG-07
    1 26-AUG-07
    2 26-AUG-07
    3 26-AUG-07
    4 26-AUG-07
    1 26-AUG-07
    6 rows selected.
    Now, we have this simple query:
    SQL> select p.KeyDescription as rptBase , to_char( mt.realdate,'dd') as P1 , to_char(mt.realdate,'HH24') as P2, count(*) as countX
    2 from messageTrack mt, Pattern p
    3 Where mt.realDate >= to_date('26/08/2007 13:00:00','dd/MM/yyyy hh24:MI:ss')
    4 and mt.realDate <= to_date('27/08/2007 20:00:00','dd/MM/yyyy hh24:MI:ss')
    5 and mt.pattern_id=p.id
    6 group by p.KeyDescription, to_char(mt.realdate,'dd'), to_char( mt.realdate,'HH24')
    7 order by p.KeyDescription, to_char(mt.realdate,'dd'), to_char(mt.realdate,'HH24');
    RPTBASE P1 P2 COUNTX
    hata1 26 13 2
    hata1 26 15 1
    hata2 26 13 1
    hata3 26 14 1
    hata4 26 15 1
    But the result we need should contain the pattern values(hata1, hata2, hata3 and hata4) for each time interval(hour) although there are might be no records of some patterns for some hours.
    The result for our test case should look like this:
    RPTBASE P1 P2 COUNTX
    hata1 26 13 2
    hata1 26 14 0
    hata1 26 15 0
    hata2 26 13 1
    hata2 26 14 0
    hata2 26 15 0
    hata3 26 13 0
    hata3 26 14 1
    hata3 26 15 0
    hata4 26 13 0
    hata4 26 14 0
    hata4 26 15 1
    Our version is 10.2.0.2
    On my discussions some said model clause may be used, but i don't know model clause much and can't imagine how to use.
    You can download the test case code above to reproduce from:
    http://www.bhatipoglu.com/files/query1.txt
    You can see the output above more clearly(monospace font) on:
    http://www.bhatipoglu.com/files/query1_output.txt
    Additionally, I want to state that, in the resulting table, we don't want all the patterns(hata1, hata2, hata3, hata4 and hata5). We just want the ones that exists on messageTrack table(hata1, hata2, hata3 and hata4) as you see on the result.
    Thanks in advance.

    Here is an attempt with the Model Clause:
    Edit: I should mention that I created a view out of your original query.
    SELECT rptbase
          ,day
          ,hour
          ,countx
    FROM demoV
      MODEL
        DIMENSION BY (rptbase, day, hour)
        MEASURES (countx)
          RULES(countx[
                        FOR rptbase IN (SELECT rptbase
                                        FROM demoV)
                        ,FOR day IN   (SELECT day
                                        FROM demoV)
                        ,FOR hour FROM 13 to 15 INCREMENT 1
                        ] =
                        NVL(countx[CV(rptbase),CV(day),CV(hour)],0)
                order by 1,2,3;Which produces the following
    RPTBASE                                    DAY                 HOUR               COUNTX                
    hata1                                              26                     13                     2                     
    hata1                                              26                     14                     0                     
    hata1                                              26                     15                     1                     
    hata2                                              26                     13                     1                     
    hata2                                              26                     14                     0                     
    hata2                                              26                     15                     0                     
    hata3                                              26                     13                     0                     
    hata3                                              26                     14                     1                     
    hata3                                              26                     15                     0                     
    hata4                                              26                     13                     0                     
    hata4                                              26                     14                     0                     
    hata4                                              26                     15                     1               Note my Hata1 26 15 has a countx of 1 (I believe that this is correct and that your sample result is incorrect, if this is not the case, please explain why it should be 0)
    Message was edited by:
    JS1

  • LR 1.3.1 waiting for non-existing xmp and thm files

    I am experiencing a problem where Lightroom 1.3.1 stalls while I am scrolling through larger folders/collections. This happens on some (specific) folders only, but can get to a point where LR becomes unusable.
    Trying to nail that down, I used a file monitor (filemon from sysinternals) and spotted that LR is looking for xmp and thm files that do not exist. The reason this is slow for me probably relates to the fact, that this search happens over my local network (because my original photos are on a different computer). Estimating numbers, LR waits approx 500 ms per photo (looking for .xmp, .XMP, .thm and .THM in that time), but only for some photos in that folder.
    I upgraded from 1.2 to 1.3.1 and am quite certain, that this was smooth with 1.2.
    My catalog definitely doesn't write to xmp automatically. I do in fact not have a single xmp file in any of my directories. In catalog settings I also have the 'Include develop settings in metadata in jpg...' deactivated (what does that btw?).
    Anyone experiencing similar issues? Any ideas what I am doing wrong here? Why is LR looking for those files in the first place?
    Stefan

    I am actually a bit surprised I am the only one hitting that problem.
    Does anyone else have a setup where the original photos are on a networked machine, and the working catalog is on the local machine where Lightroom is running? I assume this is why I am experiencing long delays whereas 'normal' users just don't notice that problem...

  • User names for non-existing guest accounts appearing in WCS reports

    Hi All,
    I currently have a client where we have deployed a guest network using webauth and the lobby ambassador account to provision guest users under WCS 5.2.
    When running client detail reports there are a number of odd behaviours that i don't understand.
    First and most importantly the username section of the report is populated with usernames that have never been provisioned and do not currently exist.
    I made a guess and thought maybe it was recording usernames of people who had attempted to log in via webauth using their normal user accounts as the recorded names were in this format but this did not generate an entry in the report.
    The second issue was that a lot of users had pulled down a few MB (8.5 was the highest at that point) of data while not authenticated. The standard webauth page is used with some minor changes and this is tiny so i can't account for where this data is coming from unless they are pulling down that page repeatedly.
    I am hoping someone will have experienced these 2 situations and can assist.
    Thanks
    Ben

    The username section can get populated from the users that do exist on the controller.
    The second issue doesnt make much sense, you may want to open a TAC SR to investigate this further

  • Passwords for non-existent email addresses?

    Just changed computers and now can't transfer some apps that were bought on a different Apple ID and can't remember the password. Can't get the password resent as they want to send it to an email address that no longer exists? How can I get the password? How can I get those apps onto my computer?

    It all depends on your setup.
    If you use only local mail domains, just make sure you do not have a catchall address (luser_relay) and messages to unknown users will not be accepted by Postfix in the first place.
    If you use virtual mail domain, you will need to change your setup as Apple's default setup will always accept mail for unknown users and then bounce it back to sender. See here for a how to: Making Virtual Mail Users in OS X 10.4/10.5 Server
    HTH,
    Alex

  • Constant dns lookups for non-existent addresses

    Hi. I'm connected to a large network and I've noticed
    that there are constant dns lookups for addresses that
    do not exist.
    When i run tcpdump, almost every second
    I see a few requests to the dns server from my IP. And all
    of them get the response NXDOMAIN.
    Is there a reason this should happen or is there something
    not working properly on my computer?
    Thanks
    Last edited by m00nblade (2010-01-25 21:42:23)

    It all depends on your setup.
    If you use only local mail domains, just make sure you do not have a catchall address (luser_relay) and messages to unknown users will not be accepted by Postfix in the first place.
    If you use virtual mail domain, you will need to change your setup as Apple's default setup will always accept mail for unknown users and then bounce it back to sender. See here for a how to: Making Virtual Mail Users in OS X 10.4/10.5 Server
    HTH,
    Alex

  • X61: Bios looks for non-existing CDROM drive?

    Hi,
    I recently observe a problem with my X61. After the machine is power on, it stops (with a blank screen) for about half a minute before starting to boot Vista. I also notice that if I connect a USB CDROM drive to the machine, then it will not stop during the startup process. I think the problem is that the Bios is looking for a CDROM drive which is not there. Since this problem only happen recently, I suspect that it is due to a recent Bios update. I down-graded the bios from v2.20 to v2.19 but the problem still exists. Could anyone let me know which bios version should I downgrade to? Thanks.
    Best Regards,
    Daniel

    Did you check the boot order in BIOS first? By default , the optical drive should be listed, then the HDD. Sometimes depending on your BIOS seup, you'll see one of of the USB devices listed first. If you power on the unit with a USB CDROM already attached  to the unit while turning it on, it's possible the BIOS will detect it and try booting from it.
    Enter the BIOS at boot by tapping F1
    Then Go to "Startup" , then "Boot"
    Remember that you can also exclude any item you want BIOS boot order (normally by pressing "X") Use F5 and F6 to arrow up and down the Boot order.
    You can also press F9 to try loading the BIOS defaults.
    Let me know if this helps.
    Cheers,
    Mark
     Do NOT PM me with technical issues. Post in the forum for assistance. Thanks

  • AME looking for non-existent disk drives and now disappeared from hard drive.

    AME stopped launching for some reason. now its completely left my system. Reinstall of Premiere Pro CS6 family in Creative Cloud App Manager does not help reinstall AME. How do I get AME back and working?
    Windows 8, fast computer, all the other Creative Cloud apps working perfectly.
    thanks

    Have you verified, that it actualyl exists in your Program Files\Adobe Folder. Did you run the Creative Suite Cleaner Tool? Have you flushed the AME/ PPro prefs?
    Mylenium

  • Thunderbird giving notifications for non-existent new messages

    TB has developed some new relatively new behaviour. I will get pop-up notifications of new emails and the inbox will claim the same number of new emails but there are none. I am running TB on Windows 7 in the correct compatibility mode and I took some action a while ago based on some Google searches that, if I remember correctly now, was meant to "repair" the inbox folder. However, the behaviour persists. Suggestions are welcome.

    right click the folder, select properties and then the repair button. A re-index might make mail visible that is not already. Not a solution, but a diagnostic process.
    Some reasons for mail notifications when there is no new mail in the inbox.
    1. IMAP account any new mail in any account can trigger the notification
    2. A filter deleting new mail as spam or for other reasons. It still arrives.
    3. Defective spam filtering tools in an anti virus/internet security suite.
    Although none of those show unread mail in the inbox that is not visible other than as a number of unread mails.

Maybe you are looking for

  • Copying Titles

    I've selected the font, font size, text color and background color for captions. Is there a way that I can copy these preferences and paste them onto other clips so that all I have to do is change the words in the caption for the new clips? Or do I h

  • Datasocket and Shared Variables

    I am curious if there is any advantage to using Datasocket to read/write shared variables (as opposed to a direct read/write).  I'm specifically talking networked shared variables here. Is there any speed advantage to accessing shared variables thru

  • Working set view object

    Hi all, I tried to set manually a row in a ViewObject as current with following code ctx.getBindingContainer().findIteratorBinding("kksobjectVO").setCurrentRowWithKeyValue("100"); But I get follwing error code oracle.jbo.InvalidOperException: JBO-250

  • Obtaining true size of a JFrame prior to making it visible

    Is there a way to accomplish the following without making the frame visible first? frame.setVisible(true); Rectangle frameSize = frame.getBounds(); frame.setVisible(false); The problem is that if I don't make the frame visible, then I get a height an

  • HT3309 Why do settings & preferences reset on new fast switch user account?

    I've recently added 2 users to my Mac. Everytime one of them signs out or we switch away from her account to some other user's account, all her preferences and settings erase. For example, she adds an application icon to the dock, then it disappears.