HsqlDB throws exception-- trying to alter the columns from unique- primary

Hi,
I am trying to migrate my old DB Schema to a new DB schema and the underlying database is HsqlDB. One of the tables has two of its columns described as UNIQUE in the older schema, whereas they were made PRIMARY in the new schema. I went through the documentation provided by HSQL (http://www.hsqldb.org/doc/guide/ch09.html) and tried to execute the following query to alter the columns:
stmt.execute("Alter Table user_type_table add primary key (user_type_name,attribute_name)");
Somehow I get the following exception when I tried to do this:
java.sql.SQLException: Wrong data type: KEY in statement [Alter Table user_type_table add primary key]
at org.hsqldb.jdbc.jdbcUtil.sqlException(Unknown Source)
at org.hsqldb.jdbc.jdbcStatement.fetchResult(Unknown Source)
at org.hsqldb.jdbc.jdbcStatement.execute(Unknown Source)
Am i doing something wrong?

Rich,
Whichever column(s) you changed to generate the conflicts will be present in the logs anyway. Since, your prebuilt conflict handler is not set up for those columns, you end up with apply errors. You can remove those columns from being part of conflict detection by calling the DBMS_APPLY_ADM.COMPARE_OLD_VALUES procedure. Hope this helps.

Similar Messages

  • Trying to fetch the data from backend but its throwing an exception

    Trying to fetch the data from backend by clicking on a search button, but its throwing an exception
    ex: Could not create JCOClientConnection for logical System: MIGATEST_MODELDATA_DEST - Model: class org.wb.operations.testflightmodel.FlightModel. Please assure that you have configured the RFC connections and/or logical system name properly for this model!
    can anyone help me how i can proceed further.
    regards,
    Suresh.

    Hello,
    Go to http://<servername>:<port>/webdynpro/welcome and check whether the destination name MIGATEST_MODELDATA_DEST exists there and working fine.
    Ashu

  • SSDT tries to alter timestamp column in TFS build

    We're trying to perform an upgrade test against a copy (backup/restore) of our customer database as target. There are some tables with  timestamp column in the database. The way we do this is by having a database project with a publish profile targeting
    that copy of customer database and then with TFS build server is used to build the database but only to generate a publish script (/p:UpdateDatabase=False) set in the build definition - msbuild argument.
    Example of table definition:
    CREATE TABLE dbo.CodeTable1
    (ID INT IDENTITY(1,1) NOT NULL PRIMARY KEY
    ,Code CHAR(6)
    ,[Timestamp] TIMESTAMP NULL);
    We would like to have the "Code" column to have CHAR(7), so in the project we modify the table definition:
    CREATE TABLE dbo.CodeTable1
    (ID INT IDENTITY(1,1) NOT NULL PRIMARY KEY
    ,Code CHAR(7)
    ,[Timestamp] TIMESTAMP NULL);
    Expecting SSDT build will generate alter script:
    ALTER TABLE dbo.CodeTable1 ALTER COLUMN Code CHAR(7);
    To our surprise the generated script was:
    ALTER TABLE dbo.CodeTable1 ALTER COLUMN Code CHAR(7);
    ALTER TABLE dbo.CodeTable1 ALTER COLUMN [Timestamp] TIMESTAMP NULL;
    Which will cause error when the script is executed: "Cannot alter column 'TIMESTAMP' to be data type timestamp."
    Why is SSDT generating the change script for that timestamp column??
    We then try a local build in VS, the issue is not happening, SSDT correctly generates alter script only for the "Code" column to CHAR(7);
    Both local machine and TFS Build server are having VS 2013 Update 4- SSDT 12.0.50318.0 installed.
    As we tried to troubleshoot further, we found out that it seems it only happens on a restored database from a backup copy of our customer database. It doesn't happen for databases created by SSDT build from scratch or that we manually created. We've tried make
    sure all database properties are the same as the database that correctly built. But still if the target database is the one we restored from a customer's copy, SSDT always tries to alter timestamp column (on server build).
    Anyone have same experience?
    I have posted a bug in ms connect: https://connect.microsoft.com/SQLServer/feedback/details/1266051
    Thanks!

    Thanks Paul!
    However, it doesn't happen when I build the database project locally or if the target database was created by SSDT (or manually for that matter). The issue happens when I change the target database to the one we restored from a backup copy of our customer's
    database and run the build through our TFS build server.
    So I thought there must be something different with the restored database (which causes SSDT to alter timestamp column) as opposed to the one SSDT/manually created (which doesn't alter the timestamp column). Maybe there is difference on database property/settings?
    Whatever it is, I just couldn't find it.
    The only thing we will do now as workaround is to get db schema creation script from that of customer's database and run that script to re-create the database from scratch and use that as target database instead, as luck would have it, the issue would be
    gone.
    Still, why the heck SSDT tries to alter timestamp column in that specific case and not in other case as described above??
    Elvin

  • Exception CX_RS_ERROR occurred when trying to run the DTP from Cube

    Hi everyone,
    I've run the DTP &  loaded the cube using normal transformation routines , it works fine in the Dev Sys but not in quality & production. I've access only to the Dev sys. In Qual & Prod when trying to run the DTP from Cube to open HUB
    we're getting the following error
    Exception CX_RS_ERROR occurred (program: CL_RSTRAN_TRFN================CP, include: CL_RSTRAN_TRFN================CM024*
    My system support package level is SAPKW70106.
    I've found note 920338 but is for SAPKW70107.

    Hi,
    The issue seems to be with the one of the routines in the transformation and similar kind of the issues were solved by retransporting the DTP & the related transformation.
    Kindly reactivate the DTP and transformation in the source and execute a new request to transport the DTP, transformation and related routines to Quality & Production again.
    Hope this helps.
    Rgds,
    Colum

  • My computer crashed and was rebuilt. I tried to sync the music from ipad back to my computer but I keep getting a message that says the content on my ipad will be erased. It also says the ipad was synced to a different library.

    My computer crashed and was rebuilt. I tried to sync the music from my ipad to my computer but get a message that says the content on my ipad will be erased and is synced to a different library. All the music purchased from itunes synced but I need to get the music that was not purchased on itunes. How do I do this?

    You don't.  the ipad is not a backup/storage device.  it simply mirrors the selected content of your computer.  The sync is one way - computer to ipad.  The only exception is itunes purchases.
    Did you fail to maintain a backup copy of your computer?
    If so, not good.
    You may be able to purchase  a third party program, not supported by Apple, to get the other music.

  • How to get the columns from SYS.ALL_COLUMNS and use it in COALESCE() Function.

    Hi,
    I have table called Employe. And the Columns are Emp_ID,EMP_NAME,SRC_SYS_CD,DOB
    I have Query like
    Select
    COALESCE(MAX(CASE WHEN src_sys_cd='1' THEN Emp_id END), MAX(CASE WHEN src_sys_cd='2' THEN Emp_Id END))Emp_Id,
    COALESCE(MAX(CASE WHEN src_sys_cd='1' THEN Emp_name END), MAX(CASE WHEN src_sys_cd='2' THEN Emp_Name END))Emp_name,
    COALESCE(MAX(CASE WHEN src_sys_cd='1' THEN dob END), MAX(CASE WHEN src_sys_cd='2' THEN dob END))dob ,
    from Employe
    group by dob.
    I want to generalize the query like get the columns from SYS.ALL_COLUMNS table for that table name and want to pass it to COALEACE() function. I tried with Cursor. But i didnt get the appropriate results.
    Is there any way to achieve this? Please help me out in this regard.
    Thanks,

    Is this the kinda thing you're after?
    Add a filter to the queries to get just a single table/
    WITH allCols AS (
    SELECT s.name as sName, o.name AS oName, c.name AS cName, column_id,
    CASE WHEN st.name in ('float','bigint','tinyint','int','smallint','bit','datetime','money','date','datetime2','uniqueidentifier','sysname','geography','geometry') THEN st.name
    WHEN st.name in ('numeric','real') THEN st.name + '('+CAST(c.scale AS VARCHAR)+','+CAST(c.precision AS VARCHAR)+')'
    WHEN st.name in ('varbinary','varchar','binary','char','nchar','nvarchar') THEN st.name + '(' + CAST(ABS(c.max_length) AS VARCHAR) + ')'
    ELSE st.name + ' unknown '
    END + ' '+
    CASE WHEN c.is_identity = 1 THEN 'IDENTITY ' ELSE '' END +
    CASE WHEN c.is_nullable = 0 THEN 'NOT ' ELSE '' END + 'NULL' AS bText,
    f.name AS fileGroupName
    FROM sys.columns c
    INNER JOIN sys.objects o
    ON c.object_id = o.object_id
    AND o.type = 'U'
    INNER JOIN sys.systypes st
    ON c.user_type_id = st.xusertype
    INNER JOIN sys.schemas s
    ON o.schema_id = s.schema_id
    INNER JOIN sys.indexes i
    ON o.object_id = i.object_id
    AND i.index_id = (SELECT MIN(index_id) FROM sys.indexes WHERE object_ID = o.object_id)
    INNER JOIN sys.filegroups f
    ON i.data_space_id = f.data_space_id
    ), rCTE AS (
    SELECT sName, oName, cName, column_id, CAST(cName + ' ' + bText AS VARCHAR(MAX)) as bText, CAST(cName AS VARCHAR(MAX)) AS colList, fileGroupName
    FROM allCols
    WHERE column_id = 1
    UNION ALL
    SELECT r.sName, r.oName, r.cName, c.column_id, CAST(r.bText +', ' + c.cName + ' ' +c.bText AS VARCHAR(MAX)), CAST(r.colList+ ', ' +c.cName AS VARCHAR(MAX)), c.fileGroupName
    FROM allCols c
    INNER JOIN rCTE r
    ON c.oName = r.oName
    AND c.column_id - 1 = r.column_id
    ), allIndx AS (
    SELECT 'CREATE '+CASE WHEN is_unique = 1 THEN ' UNIQUE ' ELSE '' END+i.type_desc+' INDEX ['+i.name+'] ON ['+CAST(s.name COLLATE DATABASE_DEFAULT AS NVARCHAR )+'].['+o.name+'] (' as prefix,
    CASE WHEN is_included_column = 0 THEN '['+c.name+'] '+CASE WHEN ic.is_descending_key = 1 THEN 'DESC' ELSE 'ASC' END END As cols,
    CASE WHEN is_included_column = 1 THEN '['+c.name+']'END As incCols,
    ') WITH ('+
    CASE WHEN is_padded = 0 THEN 'PAD_INDEX = OFF,' ELSE 'PAD_INDEX = ON,' END+
    CASE WHEN ignore_dup_key = 0 THEN 'IGNORE_DUP_KEY = OFF,' ELSE 'IGNORE_DUP_KEY = ON,' END+
    CASE WHEN allow_row_locks = 0 THEN 'ALLOW_ROW_LOCKS = OFF,' ELSE 'ALLOW_ROW_LOCKS = ON,' END+
    CASE WHEN allow_page_locks = 0 THEN 'ALLOW_PAGE_LOCKS = OFF' ELSE 'ALLOW_PAGE_LOCKS = ON' END+
    ')' as suffix, index_column_id, key_ordinal, f.name as fileGroupName
    FROM sys.indexes i
    LEFT OUTER JOIN sys.index_columns ic
    ON i.object_id = ic.object_id
    AND i.index_id = ic.index_id
    LEFT OUTER JOIN sys.columns c
    ON ic.object_id = c.object_id
    AND ic.column_id = c.column_id
    INNER JOIN sys.objects o
    ON i.object_id = o.object_id
    AND o.type = 'U'
    AND i.type <> 0
    INNER JOIN sys.schemas s
    ON o.schema_id = s.schema_id
    INNER JOIN sys.filegroups f
    ON i.data_space_id = f.data_space_id
    ), idxrCTE AS (
    SELECT r.prefix, CAST(r.cols AS NVARCHAR(MAX)) AS cols, CAST(r.incCols AS NVARCHAR(MAX)) AS incCols, r.suffix, r.index_column_id, r.key_ordinal, fileGroupName
    FROM allIndx r
    WHERE index_column_id = 1
    UNION ALL
    SELECT o.prefix, COALESCE(r.cols,'') + COALESCE(', '+o.cols,''), COALESCE(r.incCols+', ','') + o.incCols, o.suffix, o.index_column_id, o.key_ordinal, o.fileGroupName
    FROM allIndx o
    INNER JOIN idxrCTE r
    ON o.prefix = r.prefix
    AND o.index_column_id - 1 = r.index_column_id
    SELECT 'CREATE TABLE ['+sName+'].[' + oName + '] ('+bText+') ON [' + fileGroupName +']'
    FROM rCTE r
    WHERE column_id = (SELECT MAX(column_id) FROM rCTE WHERE r.oName = oName)
    UNION ALL
    SELECT prefix + cols + CASE WHEN incCols IS NOT NULL THEN ') INCLUDE ('+incCols ELSE '' END + suffix+' ON [' + fileGroupName +']'
    FROM idxrCTE x
    WHERE index_column_id = (SELECT MAX(index_column_id) FROM idxrCTE WHERE x.prefix = prefix)

  • Hello, I've got a Upgrade-Version of CS5.5 for Windows and changed to a Mac. Now I need the Mac-Version. I tried to install the Download from Adobe. Unfortunatly it didn't accept my password. I guess cause of the Upgrade-Version or the Windows Version I o

    Hello, I've got a Upgrade-Version of CS5.5 for Windows and changed to a Mac. Now I need the Mac-Version. I tried to install the Download from Adobe. Unfortunatly it didn't accept my password. I guess cause of the Upgrade-Version or the Windows Version I own. My System: Mac OS X 10.6.8, 2,8 GHz. Thanks for answers! Greetings, Eva

    Here is a link to the info regarding platform swaps.
    Order product | Platform, language swap
    If you want to try to contact Adobe support to try to get an exception, Start Here  after selecting relevant responses choose "Still need help? Contact us." and the chat contact (or phone) option.

  • SQL Server Import Export Wizard fails while trying to retrieve the data from FastObjects Database

    When trying to import data from FastObjects database to SQL Server 2008 R2 using import/ export wizard we get the following error message :
    "Column information for the source and the destination data could not be retrieved, or the data types of source columns were not mapped correctly to those available on the destination provider."
    Clicked on View button, the source data is retrieved correctly.
    Clicked on Edit Mapping button, the Import Export Wizard failed with the below error message:
    ===================================
    Column information for the source and destination data could not be retrieved.
    "Test" -> [dbo].[Test]:
    - Cannot find column -1.
    (SQL Server Import and Export Wizard)
    ===================================
    Cannot find column -1. (System.Data) 
    at System.Data.DataColumnCollection.get_Item(Int32 index) at System.Data.DataRow.get_Item(Int32 columnIndex) at Microsoft.DataTransformationServices.Controls.ProviderInfos.MetadataLoader.LoadColumnsFromTable(IDbConnection myConnection, String[] strRestrictions)
    at Microsoft.SqlServer.Dts.DtsWizard.OLEDBHelpers.LoadColumnsFromTable(MetadataLoader metadataLoader, IDbConnection myConnection, String[] strRestrictions, DataSourceInfo dsi)at Microsoft.SqlServer.Dts.DtsWizard.TransformInfo.PopulateDbSourceColumnInfoFromDB(IDbConnection
    mySourceConnection) at Microsoft.SqlServer.Dts.DtsWizard.TransformInfo.PopulateDbSourceColumnInfo(IDbConnection mySourceConnection, ColumnInfoCollection& sourceColInfos)

    Hi Chennie,
    Thank you for the post.
    Does the issue persists after you use the "Write a query to specify the data to transfer" option instead of “Copy data from one or more tables or views” option? If so, the issue may occur due to incorrect data type matching between the FastObjects database
    data types and SSIS data types. In this condition, I don’t think it is necessary to upgrade the SQL Server version. Since you can open the Column Mappings dialog box, please try to modify the data type mapping manually.
    In addition, the issue seems to be the same as the issue described in the following blog:
    http://blogs.msdn.com/b/dataaccesstechnologies/archive/2010/09/09/sql-server-import-export-wizard-fails-while-trying-to-retrieve-the-data-from-pervasive-database.aspx 
    Regards,
    Mike Yin
    TechNet Community Support

  • How to remove Sorting of the columns from Advance TAB

    Hello Experts,
    I have a simple question -
    Have a report which produces results from values selected from prompt. The data in report is correct, however the ffirst 2 columns in the Report are being grouped by. So when a user downloads the Report in EXCEL, they see that the fiirst 2 columns are not populated in all the cells of the Excel and they have to populated them manually.
    I have tried to remove the sort order in the Advance SQL tab, but without any luck. I have tried to rearrange the columns of the reports as well, but no luck as well
    Any quick fix for this behaviour ?
    Regards
    Sam

    Your subject shouldn't be that.. ;), if you are looking for repeating values for all the cells for that particular column
    go to first 2 column properties > Column Format .
    In "Value suppression" section, you'll find repeat option radio button. check that and click ok. Now test your report

  • I am trying to put the music from my ipod onto my new computer. After installing itunes and connecting my ipod touch a message comes up saying that my ipod is already synced with another library. What can I do to sync it with a new library?

    I recently got a new computer and got rid of my old one. I am trying to put the music from my ipod touch onto my new computer but keep getting a message saying that my ipod is already synced with a library and cannot be synced with more than one. How do I access that library on my new computer and if I can't are their other ways for me to put the music on my ipod into my new computer?

    Syncing to a new iTunes library or computer will erase your ipod. Only if you back up your iPod manually before syncing, you can restore your device from that backup again. A manual backup does not include the sync process.
    Disable autosync in iTunes, connect your iPod to your new computer and right click on it in the device list and choose backup. iTunes will backup your ipod without syncing.
    Transfer your purchases the same way, choosing "transfer purchases" this time.
    When you connect your iPod for the first time, all media content will be erased. But you can restore your settings and app data from your manual backup afterwards.
    Don't forget to set up at least one contact and event on your new computer to be able to merge calendars and contacts when you sync the ipod for the first time.
    Music is one way only, from the computer to your device, unless you bought the songs in itunes and transferred your purchases.
    There is 3rd party software out there, but not supported by Apple, see this thread:http://discussions.apple.com/thread.jspa?threadID=2013615&tstart=0
    About backups and what's saved: http://support.apple.com/kb/HT4946
    How to back up and restore:http://support.apple.com/kb/HT1414
    How to download apps for free again:http://support.apple.com/kb/HT2519
    Saving other data is also described here. How to back up your data and set up as a new device

  • How do I stop an app from waiting?  I have tried to reboot by holding the home key and power button to power down.  Also, I have tried to sync the apps from my laptop with no success.  Can you help?  Thanks.

    How do I stop an app from waiting?  I have tried to reboot by holding the home key and power button to power down.  The app is still grayed out and waiting so it cannot be deleted.  Also, I have tried to sync the apps from my laptop and tried downloading new appswith no success.  Can you help?  Thanks

    If there are multiple apps trying to download at once, only one can download at a time and the rest say "Waiting" until it is then their turn. Try this. Double tap the icon of the Waiting app, and it should resume the download.
    How to Solve the Problem of An iPad App Download Stuck on “Waiting”
    http://ipadacademy.com/2012/06/how-to-solve-the-problem-of-an-ipad-app-download- stuck-on-waiting
    How To Get Rid Of Your iPad App Download Frozen Problem
    http://www.sidelineapple.com/how-to-get-rid-of-your-ipad-app-download-frozen-pro blem-and-not-lose-years-of-your-life-video/
    iTunes: How to resume interrupted iTunes Store downloads
    http://support.apple.com/kb/ht1725
    Another thing to try - Turn the iPad Off & then back ON.
    If that doesn't work:
    •  Log out of your iTunes store account.  Go to Settings > Store > Sign Out Then press the Home button.
    • Then press and hold the Home and Sleep buttons simultaneously and don't release them when it brings up the Turn Off screen; keep holding them until the Apple logo appears.
    • After restart, the Waiting should be gone.
     Cheers, Tom

  • I'm trying to transfer the music from my iPhone 3G to my iPod shuffle but I don't know how. I checked on websites but i dont really trust them cause I don't want all my music to be erased (cause i spent a lot of money on them) can someone PLEASE help me.

    'm trying to transfer the music from my iPhone 3G to my iPod shuffle using iTunes but I don't know how. I checked on websites but i dont really trust them cause I don't want all my music to be erased (cause i spent a lot of money on them) can someone PLEASE help me. Why is iTunes so complicated.

    iTunes match - http://www.apple.com/itunes/itunes-match/ - see FAQ at end too
    http://arstechnica.com/apple/2011/11/itunes-match-your-questions-answered/
    http://ipod.about.com/od/UsingiOS5/a/Itunes-Match-Frequently-Asked-Questions.htm
    http://forums.macrumors.com/showthread.php?t=1277415 - deleting items from your computer but saving them in iCloud.  Yes, but risky.

  • HT201272 When i was younger i did all my itunes purchasing through my father's account. I just purchased my own Mac book Air and i am trying to transfer the music from my iphone to my Mac. Is there a way to do this even though the music wasn't purchased o

    When i was younger i did all my itunes purchasing through my father's account. I just purchased my own Mac book Air and i am trying to transfer the music from my iphone to my Mac. Is there a way to do this even though the music wasn't purchased on my id?

    Have you authorised your own Mac to your father's account?

  • How do I get my entire photo stream to my new iPad. I use my ICloud and some of them showed up but most if them did not. I am trying to sync the photos from my phone to an iPad 1 and iPad mini.

    How do I get my entire photo stream to my new iPad. I use my ICloud and some of them showed up but most if them did not. I am trying to sync the photos from my phone to an iPad 1 and iPad mini.

    Photostream in the cloud only keeps photos from the last 30 days (subject to a 1,000 photo limit). When photostream syncs the photos to your device they will stay there until deleted, which means you may well have more photos in your photostream album on your device than there are in photostream in the cloud.
    The consequence of this is that if you turn photostream off and on again on your device (or enable it for the first time), it will only be populated with photos from the last 30 days, which may not be all the photos that were previously in the photostream album on that device.

  • I am trying to display the output from my ipod touch on apple tv. i can get the audio but no video. please help

    i am trying to display the output from my ipod touch on apple tv. i can get the audio but no video. Thank you for any advice.

    What output are you trying to get to your tv?

Maybe you are looking for

  • GREATER THAN symbol appearing as &gt ; in SQL*Plus

    Version:11.2.0.3 OS : RHEL 5.4 We are a Software vedor firm.We have sent our SQL files to our client to execute. But the codes for various procedures and functions were failing because, in their SQL*Plus session (in Putty) the LESS THAN character < w

  • The Financial Accounting program cannot process the document.

    THIS PROBLEM IS COMING AFTER THE BILING AND THE ACCOUNTING DATA IS NOT CREATED FOR THIS PROBLEM CAN ANY ONE SOLVE THIS PROBLEM GURUS PLEASE HELP No account is specified in item 0000001005 Message no. F5670 Diagnosis No account was specified for accou

  • Website with list of phones that are isync compatible?

    My mum is upgrading her mobile phone but wants to ensure she only upgrades to a handset that is compatible with isync, does anyone know of a website or something that lists phones that are compatible? She currently has a Nokia 6233 and it can't isync

  • Can't download music from my laptop

    Can't find iTunes app for downloading music

  • Compressor can burn Blu Ray?

    This is a quote from Apple's web site: "Blu-ray disc and DVD burning. You can now easily burn a Blu-ray disc or a DVD directly from Compressor. Quickly add a menu to your disc by choosing one of the beautiful Apple-designed HD or SD templates or, to