Welcome to Sign in | Join | Help

XML Data Manipulation Language

  •  10-19-2006, 10:56 AM

    XML Data Manipulation Language

    XML Data Manipulation Language

    Limbajul XQUERY nu permite modificarea documentelor xml, pentru modificari folosindu-se o extensie a XQUERYXML DML (XML Data Manipulation Language).

    Concret  XML DML extinde XQUERY cu urmatoarele instructiuni:

    §          insert – pentru adaugare

    §          delete – pentru stergere

    §          replace value of – pentru modificare

    Instructiunile se pot folosi prin intermediul metodei modify.

    Exemplu:

    -- declarare si setare variabila tip xml

    DECLARE @myDoc XML

    SELECT  @myDoc = BulkColumn

    FROM OPENROWSET( Bulk 'C:\Books.xml', SINGLE_BLOB ) AS x

    -- insereaza un element autor pentru al doilea

    -- element carte

    SET @myDoc.modify('      

    insert <autor>Karli Watson</autor>

    into (/magazin/carte/autori)[2]')

    SELECT @myDoc

     


    Cristian Andrei Lefter, SQL Server MVP
    MCT, MCSA, MCDBA, MCAD, MCSD .NET,
    MCTS, MCITP - Database Administrator SQL Server 2005
    http://sqlserver.ro
    Filed under: ,
View Complete Thread
Powered by Community Server (Commercial Edition), by Telligent Systems