Professional Web Applications Themes

using DTS transforming those records in decimal - Microsoft SQL / MS SQL Server

I have a table.DBF who has 8 fields with texts, want to import the records for a table SQL using DTS transforming those records in decimal how do I make that?...

  1. #1

    Default using DTS transforming those records in decimal

    I have a table.DBF who has 8 fields with texts, want to import the records
    for a table SQL using DTS transforming those records in decimal

    how do I make that?


    Frank Guest

  2. #2

    Default Re: using DTS transforming those records in decimal

    But as it would be that function?

    Function Main()
    DTSDestination("os_numero") = DTSSource("OS")
    DTSDestination("os_otica") = DTSSource("EM")
    DTSDestination("os_odesfl") = DTSSource("CL")
    DTSDestination("os_odcill") = DTSSource("LED")
    DTSDestination("os_odeixl") = DTSSource("LCD")
    DTSDestination("os_oddnpl") = DTSSource("LEE")
    DTSDestination("os_odaltl") = DTSSource("LCE")
    DTSDestination("os_oddscl") = DTSSource("EIXOD")
    DTSDestination("os_odesfp") = DTSSource("EIXOE")
    DTSDestination("os_odcilp") = DTSSource("ADD")
    DTSDestination("os_odeixp") = DTSSource("ADE")
    DTSDestination("os_oddnpp") = DTSSource("PED")
    DTSDestination("os_odaltp") = DTSSource("PCD")
    DTSDestination("os_oddscp") = DTSSource("PEE")
    DTSDestination("os_oeesfl") = DTSSource("PCE")
    Main = DTSTransformStat_OK
    End Function


    "SriSamp" <co.in> escreveu na mensagem
    news:phx.gbl... 
    TEXT [/ref]
    records 
    >
    >[/ref]


    Frank Guest

  3. #3

    Default Re: using DTS transforming those records in decimal

    I'm not sure I understand your question.
    --
    HTH,
    SriSamp
    Please reply to the whole group only!
    http://www32.brinkster.com/srisamp

    "Frank Dulk" <com.br> wrote in message
    news:phx.gbl... 
    > TEXT [/ref]
    > records 
    > >
    > >[/ref]
    >
    >[/ref]


    SriSamp Guest

  4. #4

    Default Re: using DTS transforming those records in decimal

    Is that my vbscript for import of the data, now like me I do glue the
    function to transform the fields texts in decimal using the vbscript?

    "SriSamp" <co.in> escreveu na mensagem
    news:phx.gbl... 
    > > TEXT 
    > > records 
    > >
    > >[/ref]
    >
    >[/ref]


    Frank Guest

  5. #5

    Default Re: using DTS transforming those records in decimal

    In this VBScript, you can use the CDbl function on the appropriate field of
    DTSSource and get the data into the destination.
    --
    HTH,
    SriSamp
    Please reply to the whole group only!
    http://www32.brinkster.com/srisamp

    "Frank Dulk" <com.br> wrote in message
    news:phx.gbl... [/ref][/ref]
    the 
    > >
    > >[/ref]
    >
    >[/ref]


    SriSamp Guest

  6. #6

    Default Re: using DTS transforming those records in decimal

    It would not be easier I to matter as text and later to create a procedure
    that recovers as decimal and it generates a file. For instance all that
    fields where are made subtractions would have to be transformed in decimal
    the rest doesn't need.



    CREATE PROCEDURE [dbo].[usp_exp_OS_calc]


    (
    Numos int
    )

    AS


    declare db nvarchar(50)
    set db = (select servername)

    select
    os_numero,
    numolho=case when os_odesfl is null then 3 when os_oeesfl is null then 2 else 1 end,
    os_cliente,
    esfod=case when os_odesfl is not null then os_odesfl else 0 end ,
    cilod=case when os_odcill is not null then os_odcill else 0 end ,
    eixod=case when os_odeixl is not null then os_odeixl else 0 end ,
    adiod=case when os_odadi is not null then os_odadi else 0 end ,
    esfoe=case when os_oeesfl is not null then os_oeesfl else 0 end ,
    ciloe=case when os_oecill is not null then os_oecill else 0 end ,
    eixoe=case when os_oeeixl is not null then os_oeeixl else 0 end ,
    adioe=case when os_oeadi is not null then os_oeadi else 0 end ,
    c1=0 ,
    c2=0 ,
    c3=0 ,
    c4=0 ,
    c5=0 ,
    c6=0 ,
    c7=0 ,
    c8=0 ,
    dplod=case when os_oddnpl is not null then os_oddnpl else 0 end ,
    dppod=case when os_oddnpl is not null then os_oddnpl - 2 else 0 end ,
    dploe=case when os_oednpl is not null then os_oednpl else 0 end ,
    dppoe=case when os_oednpl is not null then os_oednpl - 2 else 0 end ,
    c9=5,
    altod=case when os_odaltl is not null then os_odaltl else 0 end ,
    ca=5,
    altoe=case when os_oealtl is not null then os_oealtl else 0 end
    into ##OScalc
    from labotica.dbo.ordem
    where os_numero = numos

    exec ('master.dbo.xp_cmdshell ''bcp "##OScalc" OUT "c:\labotica\lab_calc\'+ numos + '" -o "c:\temp\outputoscalc.txt" -e "c:\temp\erroroscalc.txt" -S '+ db + ' -c -t"," -T '' ')
    exec ('master.dbo.xp_cmdshell ''copy C:\labotica\lab_calc\'+
    numos +' \\labcr3901\os\'' ')

    drop table ##OScalc
    return

    GO


    "SriSamp" <co.in> escreveu na mensagem
    news:#phx.gbl... 
    of [/ref]
    > the [/ref][/ref]
    the 
    > >
    > >[/ref]
    >
    >[/ref]


    Frank Guest

  7. #7

    Default Re: using DTS transforming those records in decimal

    I am trying in that way and this giving mistake

    Function Main()
    DTSDestination("os_odcill") = CDbl (DTSSource("LED"))
    Main = DTSTransformStat_OK
    End Function


    "SriSamp" <co.in> escreveu na mensagem
    news:#phx.gbl... 
    of [/ref]
    > the [/ref][/ref]
    the 
    > >
    > >[/ref]
    >
    >[/ref]


    Frank Guest

Similar Threads

  1. Transforming each point of a letterform
    By Persa_Zula@adobeforums.com in forum Adobe Illustrator Windows
    Replies: 3
    Last Post: May 27th, 11:50 PM
  2. how to date/time transforming
    By Rod in forum PERL Beginners
    Replies: 2
    Last Post: July 5th, 03:57 PM
  3. Transforming locked objects
    By vbrajan webforumsuser@macromedia.com in forum Macromedia Freehand
    Replies: 4
    Last Post: December 2nd, 11:22 AM
  4. Transforming - Bending objects
    By Richard Archer-Jones in forum Adobe Photoshop 7, CS, CS2 & CS3
    Replies: 7
    Last Post: July 5th, 03:16 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139