Visualizzazione dei risultati da 1 a 3 su 3
  1. #1

    [FoxPro/mssqlServer] inserimento dati in una tabella remota

    Ciao a tutti, non so se questo sia il forum di discussione adatto,
    ho da poco inizato ad utilizzare VISUAL FOXPRO con il dbms mssqlServer 2000 e devo creare un'applicazione che mi inserisca nuovi dati in una tabella in un database remoto. Per farlo ho creato una vista, ma gli inserimenti vengono fatti solo sulla vita mentre nella tabella nn viene apportata nessuna modifica, il codice è il seguente:

    codice:
    CREATE DATABASE 'db2'
    connes=SQLCONNECT('Tab1', '', '')
    DISPLAY CONNECTIONS
    SQLSETPROP(Connes, 'Transactions', 2)
    CREATE SQL VIEW view_cn CONNECTION 'connes' AS SELECT * FROM CN
    use view_cn
    APPEND BLANK
    INSERT INTO view_cn (ID_cn) VALUES (34)
    TABLEUPDATE()
    SQLCOMMIT(connes)
    Tab1 è un driver sql server creato con ODBC, la tabella sulla quale inserire i dati è cn.

    CIAO e grazie x un'eventuale aiuto!!!

  2. #2
    In teoria essendo la Vista un File Logico e non un File Fisico dovresti trovare i dati anche nella Tabella ...

    Almeno su DBII funziona cosi' ... Credo anche su SQLServer

  3. #3
    Utente di HTML.it
    Registrato dal
    Jul 2001
    Messaggi
    798
    in teoria... cmq ci sono delle condizioni che devono essere soffisfatte.
    If a view does not have INSTEAD OF triggers, or if it is not a partitioned view, then it is updatable only if the following conditions are satisfied:

    The select_statement has no aggregate functions in the select list and does not contain the TOP, GROUP BY, UNION (unless the view is a partitioned view as described later in this topic), or DISTINCT clauses. Aggregate functions can be used in a subquery in the FROM clause as long as the values returned by the functions are not modified. For more information, see Aggregate Functions.

    select_statement has no derived columns in the select list. Derived columns are result set columns formed by anything other than a simple column expression, such as using functions or addition or subtraction operators.

    The FROM clause in the select_statement references at least one table. select_statement must have more than non-tabular expressions, which are expressions not derived from a table.
    --> MSDN CREATE VIEW
    Ans.

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.