Alias of a table is not recognized in the nested select statement

Hi,
I have to migrate a query in DB2 to Oracle. The query in DB2 uses Fetch First Row, this is being replaced by Rownum as follow.
DB2 Query
SELECT S.ID AS ID, (SELECT VALUE_N FROM ARCHIVE.PACKAGE_PARAMETERS WHERE PACKAGE_ID = S.ID AND ROWNUM < 2) AS HUB_UNIT_ID FROM ARCHIVE.SHIPMENTS S WHERE S.ARCHIVE_ID < 900
This is working fine
Oracle Query
SELECT S.ID AS ID, ( SELECT VALUE_N FROM (SELECT VALUE_N FROM ARCHIVE.PACKAGE_PARAMETERS WHERE PACKAGE_ID = S.ID ) tempTable where ROWNUM < 2) AS HUB_UNIT_ID FROM ARCHIVE.SHIPMENTS S WHERE S.ARCHIVE_ID < 900
This is throwing error
Error: ORA-00904: "S"."ID": invalid identifier
Table Script
CREATE TABLE "ARCHIVE"."PACKAGE_PARAMETERS" (
"ID" NUMBER(19,0) NOT NULL ,
"PACKAGE_ID" NUMBER(19,0) ,
"DESCRIPTION" VARCHAR(128) ,
"VALUE_N" VARCHAR(128) ,
"NOTES" VARCHAR(512) )
CREATE TABLE "ARCHIVE"."SHIPMENTS" (
"ID" NUMBER(19,0) NOT NULL ,
"CREATED" DATE DEFAULT SYSDATE NOT NULL ,
"CI_INSURANCE_CHARGE" FLOAT DEFAULT 0 NOT NULL ,
"ARCHIVE_ID" NUMBER(19,0) ,
Please suggest me some alternative.
Let me know if you need more information.
Regards,
Anil Sinha

SELECT S.ID AS ID, ( SELECT VALUE_N FROM (SELECT VALUE_N FROM >>ARCHIVE.PACKAGE_PARAMETERS WHERE PACKAGE_ID = S.ID ) >>tempTable where ROWNUM < 2) AS HUB_UNIT_ID FROM >>ARCHIVE.SHIPMENTS S WHERE S.ARCHIVE_ID < 900
This is throwing error
Error: ORA-00904: "S"."ID": invalid identifierBecause S.ID is out of scope of correlated subquery. See:
http://download-uk.oracle.com/docs/cd/B10501_01/server.920/a96540/queries8.htm#2054088
Has to be formally:
SELECT S.ID AS ID,
(SELECT VALUE_N FROM ARCHIVE.PACKAGE_PARAMETERS WHERE PACKAGE_ID = S.ID AND ROWNUM < 2) AS HUB_UNIT_ID
FROM ARCHIVE.SHIPMENTS S WHERE S.ARCHIVE_ID < 900
But to be honest it's doubtful logic to use arbitrary row from multi-row subquery as the source for column value...
Rgds.

Similar Messages

  • The VersionEntity table does not exist in the LiveCycle database. Please bootstrap LiveCycle db

    I am using Livecycle 8.2 running on JBOSS. I get this error in server log
    2013-07-25 13:48:33,809 ERROR [com.adobe.idp.config.AdobePreferenceFactory] UserM:GENERIC_ERROR: [Thread Hashcode: 5001776] Problem with system root| [com.adobe.idp.storeprovider.jdbc.DBStoreFactory] errorCode:12293 errorCodeHEX:0x3005 message:The VersionEntity table does not exist in the LiveCycle database. Please bootstrap LiveCycle database.
    2013-07-25 13:48:33,809 INFO  [STDOUT] java.lang.RuntimeException: The VersionEntity table does not exist in the LiveCycle database. Please bootstrap LiveCycle database.null
    Also not able to login using Administrator password. Assuming above error is the cause. Please any help is appreciated. Thnks.

    Is this observed on a running server or have you made any changes to LC server or database after which this error is seen?
    --Santosh

  • SE14 Status-UPGRADE-Table does not exist in the database

    Folks,
    I have created a ztable with SPRAS and few Char fields and generated a table maintenance generator.In the Dev it is working fine but when I moved the TR to Q TR ended up with errrors "Generation of Programs and Screens".When I check in Q in SE11 I am able to see the table but with an error message "Table doesn't exist in the database".
    SE14 Status for this table is getting shown as UPGRADE in Q.
    Can anyone here throw some light on what exactly this status UPGRADE means and how it gets set in SE14.
    In DEV,I had checked the DATABASE OBJECT>>CHECK>DISPLAY and RUNTIME OBJECT>>CHECK>>DISPLAY and it is showing Database object is consistent but where as the same in Q is showing "Table is not created in the Database".
    K.Kiran.

    Hi.
    Is Q system is newly copied? Also please check the transport order of the table creation request. Also check whether pwd of the DB user is locked?
    Regards,
    Vimal

  • Intermittent : The term 'get-date' is not recognized as the name of a cmdlet, function, script file, or operable program.

    I have developed a batch harness whereby all scheduled tasks (W2012) invoke a common powershell script that acts as a wrapper to all our housekeeping jobs.
    The first step in the wrapper is to create a Transcript file using following code
    if ($Host.name -ne "Windows PowerShell ISE Host") # Transcript does not work within ISE
    $timestamp = (get-date -format "yyyy-MM-dd-HH-mm-ss.fff")
    $path = "c:\corp\$timestamp" + "_$pid.txt"
    Start-Transcript -path $path -append
    As expected the folder contains files with timestamp & pid in name
    08/08/2013  11:00 AM            14,388 2013-08-08-11-00-01.158_1620.txt
    08/08/2013  11:00 AM            12,506 2013-08-08-11-00-01.485_936.txt
    08/08/2013  11:00 AM            12,994 2013-08-08-11-00-01.735_9328.txt
    08/08/2013  11:00 AM            12,024 2013-08-08-11-00-01.766_8624.txt
    08/08/2013  11:00 AM            13,902 2013-08-08-11-00-01.860_1756.txt
    08/08/2013  11:01 AM            15,142 2013-08-08-11-01-31.392_10120.txt
    08/08/2013  05:00 AM            14,982 _1692.txt
    However note the last file, it has a zero length date time value in the name
    The error recorded by PowerShell is
    get-date : The term 'get-date' is not recognized as the name of a cmdlet, function, script file, or operable program.
    Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
    At C:\Corp\Powershell\DMPRun-ScheduledTask.ps1:171 char:18
    +    $timestamp = (get-date -format "yyyy-MM-dd-HH-mm-ss.fff")
    +                  ~~~~~~~~
        + CategoryInfo          : ObjectNotFound: (get-date:String) [], CommandNotFoundException
        + FullyQualifiedErrorId : CommandNotFoundException
    IE get-date has failed and returned a zero length field as the timestamp
    Can anyone think of a good reason why get-date would fail intermittently?
    Do I have to code defensively for base Powershell functions?

    I implemented David's suggestion and now I intermittently get
    import-module : Access to the path 'PowerShell_CommandAnalysis_Lock' is denied.
    At D:\temp\loop_jc2_2013_11_25_08_55_02.ps1:15 char:1
    + import-module Microsoft.Powershell.Utility
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [Import-Module], UnauthorizedA
       ccessException
        + FullyQualifiedErrorId : System.UnauthorizedAccessException,Microsoft.Pow
       erShell.Commands.ImportModuleCommand
    I added a trap chain (My Powershell skills do not yet include recursive trap coding, any suggestions welcome)
    trap {
        trap {
            "Trap1"
            "Exception: " + $_
            "Error: " + $Error[0]
            "Message: " + $_.Exception.Message
            "InnerException: " + $_.Exception.InnerException
            "StackTrace: " + $_.Exception.StackTrace
            "FailedItem: " + $_.Exception.ItemName
            import-module Microsoft.Powershell.Management
            import-module Microsoft.Powershell.Security
            import-module Microsoft.Powershell.Utility
        "Trap2"
        "Exception: " + $_
        "Error: " + $Error[0]
        "Message: " + $_.Exception.Message
        "InnerException: " + $_.Exception.InnerException
        "StackTrace: " + $_.Exception.StackTrace
        "FailedItem: " + $_.Exception.ItemName
        import-module Microsoft.Powershell.Management
        import-module Microsoft.Powershell.Security
        import-module Microsoft.Powershell.Utility
    import-module Microsoft.Powershell.Management
    import-module Microsoft.Powershell.Security
    import-module Microsoft.Powershell.Utility
    trap {
        "Trap3"
        "Exception: " + $_
        "Error: " + $Error[0]
        "Message: " + $_.Exception.Message
        "InnerException: " + $_.Exception.InnerException
        "StackTrace: " + $_.Exception.StackTrace
        "FailedItem: " + $_.Exception.ItemName
        exit 1
    get-date
    Now I intermittently get ..
    Trap2
    Exception: Access to the path 'PowerShell_CommandAnalysis_Lock' is denied.
    Error: Access to the path 'PowerShell_CommandAnalysis_Lock' is denied.
    Message: Access to the path 'PowerShell_CommandAnalysis_Lock' is denied.
    InnerException:
    StackTrace:    at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
       at System.Threading.Mutex.MutexTryCodeHelper.MutexTryCode(Object userData)
       at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
       at System.Threading.Mutex.CreateMutexWithGuaranteedCleanup(Boolean initiallyOwned, String name, Boolean& createdNew, SECURITY_ATTRIBUTES secAttrs)
       at System.Threading.Mutex..ctor(Boolean initiallyOwned, String name, Boolean& createdNew, MutexSecurity mutexSecurity)
       at System.Threading.Mutex..ctor(Boolean initiallyOwned, String name, Boolean& createdNew)
       at System.Management.Automation.AnalysisCache.CacheExportedCommands(PSModuleInfo module, Boolean force, ExecutionContext context)
       at Microsoft.PowerShell.Commands.ModuleCmdletBase.LoadUsingModulePath(PSModuleInfo parentModule, Boolean found, IEnumerable`1 modulePath, String name, SessionState ss, ImportModuleOptions options, ManifestProcessingFlags manifestProcessingFlags,
    PSModuleInfo& module)
       at Microsoft.PowerShell.Commands.ImportModuleCommand.ImportModule_LocallyViaName(ImportModuleOptions importModuleOptions, String name)
       at Microsoft.PowerShell.Commands.ImportModuleCommand.ProcessRecord()
       at System.Management.Automation.CommandProcessor.ProcessRecord()
    FailedItem:
    import-module : Access to the path 'PowerShell_CommandAnalysis_Lock' is denied.
    At D:\temp\loop_jc2_2013_11_25_09_19_52.ps1:26 char:1
    + import-module Microsoft.Powershell.Security
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [Import-Module], UnauthorizedA
       ccessException
        + FullyQualifiedErrorId : System.UnauthorizedAccessException,Microsoft.Pow
       erShell.Commands.ImportModuleCommand

  • My ipad is not being seen by itunes in Windows 7. I uninstalled then reinstalled itunes it started working for a while then it stopped. I get a message stating that the device is not recognized or the device is defective replace device. Anyone have a fix.

    My ipad is not being seen by itunes in Windows 7. I uninstalled then reinstalled itunes it started working for a while then it stopped. I get a message stating that the device is not recognized or the device is defective replace device. Anyone have a fix.

    At present I have no power to the Gen 7, so need to get some power to it I think.  I pressed the buttons as you suggested, but nothing is showing up at this point.  Thank you for your response as the more I can rule out before  I take it back the better I think.

  • I need help! when I am importing my NEF files from my D3300 camera into lightroom 5 and try to use the "copy as DNG" button I always get an error message saying that "saying the file is not recognized by the raw format support"

    I need help! when I am importing my NEF Raw files from my D3300 camera into lightroom 5 and try to use the "copy as DNG" button I always get an error message saying that "saying the file is not recognized by the raw format support". The whole purpose of that button is so that the file can be recognized... How can I make the "copy as DNG" button work as it is supposed too?? Thank you

    Thank you for responding. So I essentially will never be able to use that button in lightroom 5? do I need to get LR 6? Will there ever be an update for LR 5 that will enable me to use it?
    Does DNG Converter work within LR or do I have to upload pictures to my computer and then make a second copy in DNG format. and then go into LR and use them?
    Thank you @dj_paige

  • My ipod video is not recognized by the computer what should i do/

    my ipod video is not recognized by the computer what should i do?

    What have you tried so far in terms of troubleshooting this issue?  Are you plugging the iPod into a high powered USB 2.0 port on the back of your PC? Have you tried a different USB cable?
    What happens if you try to reset the device with it still connected to the PC?
    How to reset iPod
    Has this iPod ever worked on this PC or is this the first time you have time you have tried connecting it?
    Have you carefully worked through each and every single suggestion in this Apple support document?
    iPod not recognized in 'My Computer' and in iTunes for Windows
    B-rock

  • My email gets bounced into an eternal loop in the outbox and says that my iCloud and me account are not recognized by the server? I've tried setting up another account and it says that I already have them set up, and it is stil only sending 1 or 2 message

    My messages get lost in an eternal loop in my out box and it says that my iCloud me accounts are not recognized by the server. I can send 1 or 2 out of 10.
    We tried adding a new account and that didn't work. We then deleted the account and started again. Still didn't work. Extremely frustrated!

    There also seems to be something wrong with the time!!! My posting says 5:30ish but it was 8:30ish?

  • After upgrade IPHONE 4 to IOS 7 , it work 2days, and now it is off, not recognized on the pc and no battery logo when connecting to the sector

    After upgrade IPHONE 4 to IOS 7 , it work 2days, and now it is off, not recognized on the pc and no battery logo when connecting to the sector

    I'm happy to say that I solved the problem, and for the community (for the "next generation" that will search a solution for this problem) - I will publish the solution for this problem : I defined as new iphone, and then the restore showed up!
    All wishes everyone...

  • New-MaiboxRestoreRequest is not recognized as the name of a cmdlet, function, script ?

    I have restored successfully an exchange 2013 mailbox database from backup to the recovery database, but when i try to recover a user's mailbox I receive the following error
    New-MaiboxRestoreRequest -SourceDatabase RDB1 -SourceStoreMailbox "testuser" -TargetMailbox [email protected]
    The term 'New-MaiboxRestoreRequest' is not recognized as the name of a cmdlet, function,
    script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
     I already have the "mailbox import export" management role assigned to the logged in administrator.
    Anand_N

    silly me i spelt the command wrong
    Anand_N

  • Calendar Server Error: At least one sharee was not recognized by the server. New invitations have not been sent.

    I deployed a Mountain Lion Server with the calendar service active. Every time a user tries to share a calendar they have created under thier account to an external person using thier email address, the server gives the following error: "At least one sharee was not recognized by the server. New invitations have not been sent."
    Invites to share a calendar to OD accounts on the server seem to work fine.
    I have a calendar specific email address for external invites set up. The server seems to send individual event invites to external email addresses just fine, so I am thinking the email is working. Email is not served on the Mountain Lion Server. The account is through Google Apps using IMAP and SMTP.
    What's even stranger, is that there doesn't seem to be any message in the Calendar error logs.
    I've tried creating a new test account and no luck.
    I don't know what else to try.
    Thanks in advance for any help!

    another 3rd party sofwtare that allows you opent he backup and grab info
    http://www.processtext.com/abcblackberry.html
    trial for 30 days, good program for that 30 days, I hear they arent a pleasant company to purchase from though

  • I have an Iphone 5S and used to sync it to my computer in the past without any problem, but now I can't and appears the message "usb device not recognized", and the cable is good and so the USB port. Do you have any idea what's the problem?

    I have an Iphone 5S and used to sync it to my computer in the past without any problem, but now I can't, and appears the message "usb device not recognized", and the cable is good and so the USB port. Do you have any idea what's the problem?

    Try leaving it plugged in and then restart the computer.
    If you are on Windows this link may help but it is a bit old.
    http://www.technologynext.org/error-usb-device-not-recognized-how-to-fix/

  • Hard drive and dvd are not recognized in the setup menu, what could be wrong?

    The hard drive and dvd drive are not recognized on the setup menu for my Pavilion a4316f desktop computer.  Could it be a failure of the controller?  Can a PCI controller be used to replace the mother board controller?
    This question was solved.
    View Solution.

    The Recovery process would erase you hard drive, and attempt to install a fresh OS. Decidely a bad choice if you wanted to save your data files. The Recovery sets are "tattoo" with the BIOS hardwafre configuration. It will not, IMHO, recognize the PCI Sata card.
    You mentioned the Recovery program on the hard drive actually requested the installer of the controller (PCI card). Try running from that.
    I am a volunteer. I am not an HP employee.
    To say THANK YOU, press the "thumbs up symbol" to render a KUDO. Please click Accept as Solution, if your problem is solved. You can render both Solution and KUDO.
    The Law of Effect states that positive reinforcement increases the probability of a behavior being repeated. (B.F.Skinner). You toss me KUDO and/or Solution, and I perform better.
    (2) HP DV7t i7 3160QM 2.3Ghz 8GB
    HP m9200t E8400,Win7 Pro 32 bit. 4GB RAM, ASUS 550Ti 2GB, Rosewill 630W. 1T HD SATA 3Gb/s
    Custom Asus P8P67, I7-2600k, 16GB RAM, WIN7 Pro 64bit, EVGA GTX660 2GB, 750W OCZ, 1T HD SATA 6Gb/s
    Custom Asus P8Z77, I7-3770k, 16GB RAM, WIN7 Pro 64bit, EVGA GTX670 2GB, 750W OCZ, 1T HD SATA 6Gb/s
    Both Customs use Rosewill Blackhawk case.
    Printer -- HP OfficeJet Pro 8600 Plus

  • When I try to send an email with photo attachment to a contact a screen appears stating "the sender name is not recognized by the server " what do I need to change so this will not happen in the future. I am a novice!!!!!

    When I try to send an email with photo attachment on my iPad a screen appears which states " the sender is not recognized by the server" . What do I have to change so I can always send emails fr om my iPad with or without attachments. I am a novice!!!!!!

    If you purchased about 2 years ago new I am sure it is a Intel iMac. To find out what type of iMac you have just click on the Apple menu item in the finder and select about this Mac. I would check the ISP mail site and get the correct outgoing mail server info.   

  • The "J2EE process table" node not visible  in the SAP MMC

    For Netweaver 7.0 - The "J2EE process table" node not visible  in the SAP MMC.
    Details for below
    SAP Systems Manager
    SAP AG
    Version: 7100.109.15.8983
    Window Xp
    Any suggestions would be apperecited.
    Thanks
    Srini

    It's hard to say without seeing the code for TreeTable. But they probably have something like an addNode mothod for the TreeTableNode which will take care of all the updates for you. If you want to do it youself, you will probably have to get the data Model (tree.getModel()???)behind the TreeTable and use one of the fire... methods on it like fireRowChanged(???) or fireTableChanged(???). I would suspect Sun would do it this way.

Maybe you are looking for

  • After upgrading to mountain lion aperture 3.3 no longer recognizes DNG files.  Is this going to get fixed?

    After upgrading to aperture 3.3 on mountain lion aperture no longer recognizes DNG files.  I have many DNG files already in my library.  Aperture shows the thumbnail and will briefly flash what I think is the preview of the file but quickly changes t

  • What happened to the type tool in Photoshop CS5?

    In previous versions of Photoshop, when the type tool hovered over text I could edit, it switched to just the up and down type cursor tool...and when it was over a region where I could click to create a new text layer, the cursor would show up with a

  • Tcode for Purchase order Changes

    Hello Expert I Know there is one Tcode from which we could find changes happen in Purchase order at item level . Can any one let me know on the same which Tcode. I know the regular option by selecting the line item Environment->Item changes thanks Ab

  • Question for Acrobat SDK products

    Hi, I need to develop a VB.NET program to convert PDF to word or excel (or edit PDF contents to new PDF) . Please advise that what's Acrobat SDK products should I Purchasing and how the pricing, thanks.

  • DRM removal

    With iTunes Plus gone, what are my options to remove DRM from older downloads? I have a large enough number that burning to discs then ripping them again is not practical.