Master /Detail problem using Sybase iAnywhere

From: Cameron Mathers (cmathers_at_whatsvanilla.com)
Date: 08/22/04


Date: Sun, 22 Aug 2004 15:08:38 +1000

I have two adoQuery objects setup with a Master Detail relationship

Master Query:

SELECT ROW_ID, NAME
FROM V_DOC_STYLE

Detail Query:

SELECT ROW_ID, DOC_STYLE_ID, NAME
FROM V_STYLE_FONT
WHERE DOC_STYLE_ID = :ROW_ID

The ROW_ID columns are my Primary Keys for each table. They are defined in
the database to Autoincrement.

When I try to insert a record into the detail table (V_STYLE_FONT) I keep
getting the following error:

Field 'ROW_ID' cannnot be modified.

This error occurs on the INSERT command. I am not trying to set a value in
this field.

If I re-create my V_STYLE_FONT table and rename the ROW_ID column to
anything else. ie) ID. the problem is resolved.

I'm currently using Sybase Interactive SQL v9.01. (iAnywhere) previously
called Sybase SQL Anywhere as my database. I have recently migrated my
applications from MS SQL Server to Sybase iAnywhere. When running on MS SQL
Server I did not have this problem for the same query objects.

I would prefer to name all my Primary Key columns the same across all tables
for the purpose of maintaining a standard, so if any one could advise on how
I could resolve this I would much appreciate it.

Regards

Cameron Mathers



Relevant Pages

  • Re: DBMS and lisp, etc.
    ... Naively implemented with SQL, again for 10 ... (1 query for the initial orders, 1 query for each order for its ... soon as you upgrade to the SQL database. ... (eq (order-customer orderA) ...
    (comp.lang.lisp)
  • Re: Populating a list -- table structure?
    ... I had made a report already and figured out about adding the ... your responce below, but thanks to your help with SQL, I was able to get the ... It takes a summary from a select query and gives the ... KitID, long integer ...
    (microsoft.public.access.forms)
  • How do I do Paging through a large dataset via Stored Procedures
    ... Paging by dynamically altering the SQL Query ... Create stored procedures ... SELECT * FROM STUDENTS ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Populating a list -- table structure?
    ... I don't mean to skip your responce below, but thanks to your help with SQL, I was able to get the query to pull the info the way I needed. ... I have one report complete, ... Queries (just shows the QBE grid for convenience -- ...
    (microsoft.public.access.forms)
  • Re: Populating a list -- learning Access
    ... It is kinda funny -- I started using databases in the early 80's with dBase and, for years, never knew that I knew SQL! ... If you are on a form or report, the most important property is the NAME, because that is how you refer to it in code. ... I don't mean to skip your responce below, but thanks to your help with SQL, I was able to get the query to pull the info the way I needed. ... Queries (just shows the QBE grid for convenience -- ...
    (microsoft.public.access.forms)