Write Source to Destination statement

Hi,
  We are making the code unicode compatible,
we re facing a problem in the
<b>Write <Source> to <Destination> statement</b>
as shown below
WRITE SATZ-SOFE_ERSF TO SATZ-SOFE_ERSF CURRENCY P0008-WAERS
the unicode error is, the destination field must be of type Charracter.
If we use a temporary variable of type char, then we must convert this character variable back to the type P and assign it to the actual variable.
How do we achieve this.
Thanks,
Chetana

if you dont want to use char type u dont need to use WRITE syntax.
you can use MOVE syntax to move data from type has any decimal to type any decimal.
WRITE is generally using when datas wanted to display formatted.
ibrahim

Similar Messages

  • Dynamic source and destination tables

    Hi all
    I've got to import 142 tables from csv into SQL 2008 on a regular basis.
    I was looking at building a 142-part SSIS package to do this, then thought there must be a dynamic way of doing it.
    Is there any way of dynamically changing the source and and destination tables?
    The csv filenames will remain identical, the SQL tables will be the same names but with "_Staging" at the end of them (e.g. SRSection.csv will always go into SRSection_Staging).
    I can then write MERGE statements to update the main tables from the staging data.
    Any help on this would be greatly appreciated.
    I get the the feeling I would need a FOREACH LOOP container but I'd really aprreciate a step-by-step guide if you can.

    Please check this :- http://sql-bi-dev.blogspot.com/2010/07/dynamic-database-connection-using-ssis.html  
    STEP1:
    To begin, Create two tables as shown below in on of the environment:
    -- Table to store list of Sources
    CREATE TABLE SourceList (
       ID [smallint],
       ServerName [varchar](128),
       DatabaseName [varchar](128),
       TableName [varchar](128),
       ConnString [nvarchar](255)
    GO
    -- Local Table to store Results
    CREATE TABLE Results(
       TableName  [varchar](128),
       ConnString [nvarchar](255),
       RecordCount[int],
       ActionTime [datetime]
    GO
    STEP 2:
    Insert all connection strings in SourceList table using below script:
    INSERT INTO SourceList
    SELECT 1 ID,
    '(local)' ServerName,
    --Define required Server
    'TestHN' DatabaseName,--Define DB Name
    'TestTable' TableName,
    'Data Source=(local);Initial Catalog=TestHN;Provider=SQLNCLI10.1;Integrated Security=SSPI;Auto Translate=False;' ConnString
    Insert as many connections as you want.
    STEP 3:
    Add new package in your project and rename it with ForEachLoopMultipleServers.dtsx. Add following variable:
    Variable
    Type
    Value
    Purpose
    ConnString
    String
    Data Source=(local);
    Initial Catalog=TestHN;
    Provider=SQLNCLI10.1;
    Integrated Security=SSPI;
    Auto Translate=False;
    To store default connection string
    Query
    String
    SELECT '' TableName,
    N'' ConnString,
    0 RecordCount,
    GETDATE() ActionTime
    Default SQL Query string.
    This can be modified at runtime based on other variables
    SourceList
    Object
    System.Object
    To store the list of connection strings
    SourceTable
    String
    Any Table Name.
    It can be blank.
    To store the table name of current connection string.
    This table will be queried at run time
    STEP 4:
    Create two connection managers as shown below:
    Local.TestHN: For local database which has table SourceList. Also this will be used to store the result in Results table.
    DynamicConnection: This connection will be used for setting up dynamic connection with multiple servers.
    Now click on DynamicConnection in connection manager and click on ellipse to set up dynamic connection string. Map connection String with variable
    User::ConnString.
    STEP 5:
    Drag and drop Execute SQL Task and rename with "Execute SQL Task - Get List of Connection Strings". Now click on properties and set following values as shown in snapshot:
    Result Set: Full Result Set
    Connection: Local.TestHN
    ConnectionType: Direct Input
    SQL Statement: SELECT ConnString,TableName FROM SourceList
    Now click on Result Set to store the result of SQL Task in variable User::SourceList.
    STEP 6:
    Drag and drop ForEach Loop container from toolbox and rename with "Foreach Loop Container - DB Tables". Double click on ForEach Loop container to open Foreach Loop Editor. Click on Collection  and select
    Foreach ADO Enumerator as Enumerator. In Enumerator configuration, select User::SourceList as ADO object source variable as shown below:
    STEP 7: Drag and drop Script Task inside ForEach Loop container and double click on it to open Script Task Editor. Select
    User::ConnString,User::SourceTable as
    ReadOnlyVariables and User::Query as
    ReadWriteVariables. Now click on Edit Script button and write following code in Main function:
    public void Main()
    try
    String Table = Dts.Variables["User::SourceTable"].Value.ToString();
    String ConnString = Dts.Variables["User::ConnString"].Value.ToString();
    MessageBox.Show("SourceTable = " + Table +
    "\nCurrentConnString = " + ConnString);
    //SELECT '' TableName,N'' ConnString,0 RecordCount,GETDATE() ActionTime
    string SQL = "SELECT '" + Table +
    "' AS TableName, N'" + ConnString +
    "' AS ConnString, COUNT (*) AS RecordCount, GETDATE() AS ActionTime FROM " + Dts.Variables["User::SourceTable"].Value.ToString() +
    " (NOLOCK)";
          Dts.Variables["User::Query"].Value = SQL;
          Dts.TaskResult = (int)ScriptResults.Success;
    catch (Exception e)
          Dts.Log(e.Message, 0,
    null);
    STEP 8:
    Drag and drop Data Flow Task and double click on it to open Data Flow tab. Add OLE DB Source and Destination. Double click on OLE DB Source to configure the properties. Select
    DynamicConnection as OLE DB connection manager and
    SQL command from variable as Data access mode. Select variable name as User::Query. Now click on
    columns to genertae meta data.
    Double click on OLE DB Destination to configure the properties. Select Local.TestHN as
    OLE DB connection manager and Table or view - fast load as
    Data access mode. Select [dbo].[Results] as Name of the table or the view. now click on
    Mappings to map the columns from source. Click OK and save changes.
    Finally DFT will look like below snapshot:
    STEP 9: We are done with package development and its time to test the package.
    Right click on the package in Solution Explorer and select execute. The message box will display you the current connection string.
     Once you click OK, it will execute Data Flow Task and load the record count in Results table. This will be iterative process untill all the connection are done. Finally package will execute successfully.
    You can check the data in results table:
    Here is the result:
    SELECT *
    FROM SourceList
    SELECT *
    FROM Results
    Regards, Pradyothana DP. Please Mark This As Answer if it solved your issue. Please Mark This As Helpful if it helps to solve your issue. ========================================================== http://www.dbainhouse.blogspot.in/

  • SELECT * cannot be used in an INSERT INTO query when the source or destination table contains a multivalued field

    Hi,
    I am using Access 2013 and I have the following VBA code, 
    strSQL = "INSERT INTO Master SELECT * from Master WHERE ID = 1"
     DoCmd.RunSQL (strSQL)
    when the SQL statement is run, I got this error.
    SELECT * cannot be used in an INSERT INTO query when the source or destination table contains a multivalued field
    Any suggestion on how to get around this?
    Please advice and your help would be greatly appreciated!

    Rather than modelling the many-to-many relationship type by means of a multi-valued field, do so by the conventional means of modelling the relationship type by a table which resolves it into two one-to-many relationship types.  You give no indication
    of what is being modelled here, so let's assume a generic model where there is a many-to-many relationship type between Masters and Slaves, for which you'd have the following tables:
    Masters
    ....MasterID  (PK)
    ....Master
    Slaves
    ....SlaveID  (PK)
    ....Slave
    and to model the relationship type:
    SlaveMastership
    ....SlaveID  (FK)
    ....MasterID  (FK)
    The primary key of the last is a composite one of the two foreign keys SlaveID and MasterID.
    You appear to be trying to insert duplicates of a subset of rows from the same table.  With the above structure, to do this you would firstly have to insert rows into the referenced table Masters for all columns bar the key, which, presuming this to be
    an autonumber column, would be assigned new values automatically.  To map these new rows to the same rows in Slaves as the original subset you would then need to insert rows into SlaveMastership with the same SlaveID values as those in Slaves referenced
    by those rows in Slavemastership which referenced the keys of the original subset of rows from Masters, and the MasterID values of the rows inserted in the first insert operation.  This would require joins to be made between the original and the new subsets
    of rows in two instances of Masters on other columns which constitute a candidate key of Masters, so that the rows from SlaveMastership can be identified.
    You'll find examples of these sort of insert operations in DecomposerDemo.zip in my public databases folder at:
    https://onedrive.live.com/?cid=44CC60D7FEA42912&id=44CC60D7FEA42912!169
    If you have difficulty opening the link copy its text (NB, not the link location) and paste it into your browser's address bar.
    In this little demo file non-normalized data from Excel is decomposed into a set of normalized tables.  Unlike your situation this does not involve duplication of rows into the same table, but the methodology for the insertion of rows into a table which
    models a many-to-many relationship type is broadly the same.
    The fact that you have this requirement to duplicate a subset of rows into the same table, however, does make me wonder about the validity of the underlying logical model.  I think it would help us if you could describe in detail just what in real world
    terms is being modelled by this table, and the purpose of the insert operation which you are attempting.
    Ken Sheridan, Stafford, England

  • Dbms_lob.getlength() returns different source and destination lengths

    I am fairly new to PL/SQL so maybe this is an obvious problem but here goes. I am updating a clob field with a text file ~5KB in size. The field updates fine (as far as I can tell). Before I update the field, I open the source file as a bfile and then inquire the length using dbms_lob.getlength(). I then update the clob field using dbms_lob.loadclobfromfile(). This seems to work fine. However, when I use dbms_lob.getlength() on the destination object returned by dbms_lob.loadclobfromfile(), I get a length 3 characters less than then the source object (5072 vs 5075). Both the source and destination offsets are set to 1.
    Probing on what documentation I could find, I found this at http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28419/d_lob.htm#i998484:
    "The length returned for a BFILE includes the EOF, if it exists. Any 0-byte or space filler in the LOB caused by previous ERASE or WRITE operations is also included in the length count. The length of an empty internal LOB is 0."
    I did not create the source file and I believe it is a Unix type file (because of the lack of CRs) and I am running on Windows 7. I am also using 11g Express. Could the use of a Unix-type file for a CLOB on a Windows system be causing this character count difference?
    Once I found this issue I can work around it. I just want to understand what is going on.
    Thanks to all who look at this.

    The EOF and the LF versus CR/LF could influence the count difference, yes.
    Another explain could possibly be character set conversions. The BFILE I believe counts bytes, a CLOB would count "characters" - so if the source happens to contain a few multibyte characters (UTF), then the byte count would be larger than the character count.
    To help you find the cause for your exact file, then I can suggest a couple of things you might do to explore the issue:
    <li>Load the file into a BLOB instead of a CLOB and see what getlength() returns for the BLOB. BLOBs would also do byte counts and not try to treat the source as text.
    <li>Save the CLOB back into the filesystem and compare the original file with the exported CLOB and check the differences with some filecompare tool.

  • Move files from source to destination directory

    I would like to copy files from source directory to destination directory, which have a creation date lower than p_date. p_date is a entered value of a forms field.
    source:
    c:\tmp\my_b.pdf 10.10.06 04:21
    c:\tmp\my_c.pdf 10.10.06 04:20
    c:\tmp\my_d.pdf 09.10.06 01:35
    c:\tmp\my_e.pdf 05.10.06 02:13
    c:\tmp\my_f.pdf 01.10.06 00:20
    User enter the value: 09.10.06 09:35
    destination should be:
    f:\tmp\my_d.pdf 09.10.06 01:35
    f:\tmp\my_e.pdf 05.10.06 02:13
    f:\tmp\my_f.pdf 01.10.06 00:20
    win_api_utility.move_file move all files from source to destination, but only I need a part of them. I have installed Forms 6i and Windows 2000. Does anybody have an idea?
    Best regards,
    tom

    Hi Tom,
    In a Forms 10g environment you would probably use a Java component. On a c/s environment I would issue a host command. Although the windows 'copy' statement has no 'date' flag, the windows 'xcopy' statement has. Type 'help xcopy' in a command/dos box for the syntax/flags for the 'xcopy' statement.
    Hope this helps,
    Matthieu de Graaf

  • How to write source code in smart forms?

    hi friends,
    can anyone can help me in writing  sorcecode in smartforms r
    any materail link.
    if it is helpful points can b rewarded.Thanks in advance.

    Hi,
    Check this link for
    how to write source code in smart forms?
    http://****************/Tutorials/Smartforms/GettingStarted/SimpleText.htm
    You can write Source Code in smartforms By Choosing Program Lines.
    Check this link with Screen Shots
    http://****************/Tutorials/Smartforms/PO/page1.htm
    Reward All Helpfull Answers
    Regards
    Fareedas
    Edited by: Fareeda Tabassum S on May 21, 2008 3:09 PM

  • After installing SSMS 2014 I can no longer add a source or destination in SSIS VS2010

    I really don't know what is happening but I have been using VS2010 and SSMS 2014 for a couple of months now with no issue. Yesterday when I opened an SSIS package that I had created in VS2010 I was no longer able to add a source or destination to any of
    the data flows. I can copy an existing one and change the properties but when I try to drag it from the tool bow I get the following error -
    TITLE: Microsoft Visual Studio
    The component could not be added to the Data Flow task.
    Could not initialize the component. There is a potential problem in the ProvideComponentProperties method.
    ADDITIONAL INFORMATION:
    Error at "WORKFLOW NAME" [SSIS.Pipeline]: Component ", clsid {GUID}" could not be created and returned error code 0x80070005 "Access is denied.". Make sure that the component is registered correctly.
    Error at "WORKFLOW NAME" [ [128]]: The component is missing, not registered, not upgradeable, or missing required interfaces. The contact information for this component is "".
    Exception from HRESULT: 0xC0048021 (Microsoft.SqlServer.DTSPipelineWrap)
    Program Location:
       at Microsoft.SqlServer.Dts.Pipeline.Wrapper.CManagedComponentWrapperClass.ProvideComponentProperties()
       at Microsoft.DataTransformationServices.Design.PipelineTaskDesigner.AddNewComponent(String clsid, Boolean throwOnError, Boolean select)
    NOTE:I replaced the workflow name and the GUID because I don't think it is important for the post.
    When I search for the GUID in regedit it leads me to an entry that has the folder DTSInfo and the value of
    Microsoft.DataTransformationServices.DataFlowUI.OleDbSourceUI, Microsoft.DataTransformationServices.DataFlowUI, Version=12.0.0.0, Culture=neutral, PublicKeyToken=********** 'This was not the original value, just hiding it for the post.
    for UITypeName
    No one here could figure out what the exact issue and how to fix it so my pc was rebuilt. Everything was working just fine until I installed SSMS 2014. Now I am right back where I started.
    I really need to know what is going on because I wasted an entire day on trying to figure out this issue and I have already tried reinstalling/repairing VS2010. Removing SSMS 2014. Registering OleDbSrc.dll but get an error when trying to do that.

    Somebody on my team had this issue. If I recall correctly you need to re-install SSDT 2012
    Arthur My Blog

  • How to keep sort order in Shuttle item's source and destination boxes?

    I have defined a shuttle item on a page and the list of values in the source box is populated by a SQL with sort order specified. In the Settings of the shuttle item, Show Controls value is set to Moving Only instead of All. When a user moves selected values from the source box to the destination box or vice versa, the list of values does not maintain the original sort order. For example, if I have 26 values A through Z, a user can put value Z before A in the destination box. And when a user move A from the destination box to the source box, A is the last item in the source box. The reset button clears everything in the destination box and resets the source box to the original sorted list. This is not the solution that I am looking for. I would like to see the items in the source and destination boxes to maintain their original sort order all the time.
    Is it possible?
    APEX v4.0.1.00.03
    Oracle 11g (v11.2.0.1.0)

    Hi,
    See if this post help
    Re: Sort Shuttle Right
    Regards,
    Jari

  • File transfer from source to destination location using 11g b2b

    Hi,
    I have a requirement where I need to transfer a file(custom file format) from a source location to a destination location using 11g b2b.
    The problem here is I can't use any composite to push data to b2b, it has to be through b2b configuration alone.
    If i understand correctly, delivery channel (in this case transport protocol is FTP) is defined for a trading partner and we specify the hostname,destination folder etc in the transport protocol parameter.
    Is there a way I can specify the source location anywhere in the B2B configuration screens so that b2b understands what is the source and destination location to transfer the file.
    Steps that I have followed:
    1. created remote trading partner
    2. created document definition for a custom file format
    3. Configured Delivery channel for the remote trading partner.
    4. Created an agreement.
    Is there anything else I can do to solve this problem.
    Regards,
    Satrajit

    Hi Nitesh,
    Thanks a lot.
    I tried with Generic file and the file is getting picked up from the source location but its not getting delivered to the destination.
    Checked file permission in the destination and its fine, files can be created there. Also, checked the reports section and saw those messages in error with
    Error Code: B2B-50014
    Error Level: ERROR_LEVEL_COLLABORATION
    Error Text: General Error
    Steps I have followed:
    1. Created Internal Listening channel
    Protocol: Generic File-1.0
    Folder Name: Important.txt
    Folder Name: /home/applvis/dev/Inbound_dir and specified it as internal.
    This is working fine as file is getting picked up from the location
    2. Created Delivery channnel for the remote trading partner.
    Protocol: Generic File-1.0
    Folder Name: /home/applvis/dev/Outbound_dir
    Filename format: Ship_%FROM_PARTY%.txt
    3. Created and deployed the agreement.
    Am I missing any necessary step here?
    Regards,
    Satrajit

  • Product Tax rules & Destination State

    Hi partners,
    What's the best way to set up Tax Options for differently taxed products in Business Catalyst?
    We have 3 types of product taxes: GST 5%, HST 12% and tax excempt 0%.
    Some products have taxes and some don't.
    Depending on website visitor's Destination State - the taxes will change.
    A couple of examples:
    Product
    Canada - British Columbia
    Canada - Other Provinces
    United States
    Candle
    HST 12%
    GST 5%
    0%
    Honey
    0%
    0%
    0%
    It looks like Taxes and Destination States are merged in Business Catalyst.
    Once I add the Tax Options in Business Catalyst, for example:
    HST 12%
    GST 5%
    Tax Excempt 0%
    They appear in the Shopping Cart as Destination State.
    Is there a way to set a different Tax to each product and
    still be able to select a correct Destination State in the shopping cart?

    Cody,
    The solution that worked for us:
    1) setup a tax for each province - examples Ontario 13%, Alberta 12%, etc. (Unfortunatelly there is no clean way to display GST & PST separately - so you'll need to combine them into a single rate, ie 12%)
    2) DON'T apply tax to each product (just leave it as Not Applicable)
    3) Enable destination state tax on shopping cart (this will enable the Destination State dropdown in the shopping cart, which will calculate the correct tax)
    If you have different products on your website which require more than 1 tax in a specific State/Province (for example, in British Columbia you have one product taxed at GST 5%, and another product taxed at GST+PST 12%), then there IS NO WAY to do this properly in BusinessCatalyst (as of April 2013)

  • Association must have both source and destination ends.

    I am getting this error when trying to developer Oracle Applications framework page using ICX and FND information. I am trying to find out if there is something missing. I don't see an assocation that is missing a source or destination.

    {forum:id=210}

  • HPCM custom driver use source and destination

    Hi All,
    I'm using HPCM 12.1.2, I need your help to create one custom driver that uses information from source and destination. I need to use 1 dimension of source and 2 of destination.
    I have the situation bellow:
    STAGE1 (SOURCE)
    Dim1 Machine
    Dim2 Account
    STAGE2 (DESTINATION)
    Dim1 Process
    Dim2 Operation
    Dim 3 Account
    Measure: Time used in the Machine
    The infromation is extracted:
    Machine1 - Process1 - Operation1 = 10 Hours
    Machine1 - Process1 - Operation2 = 9 Hours
    Machine2 - Process1 - Operation1 = 13 Hours
    How can I create one Driver that I could use these informations? It is possible?
    Thanks in Advance
    Diogo
    Edited by: user10432898 on 15/05/2012 14:21

    Hi Alex,
    You have to increase the Max Row size limit in Xcelsius.
    Goto >> File menu >> Preferences >> Increase the "Max Row Sixe"  by default it will be 500 you can increase it as per the requirement.
    Regards,
    AnjaniKumar C.A.

  • Problem with transformations involving excel source or destination

    I am using SQL server 2008 R2.None of the transformations involving excel source or destination is working fine.What can be done?

    Hi Sapna,
    According to your description, you are
    experiencing the issue that transformations involving excel source or destination is working fine, right?
    It's hard to give you the exactly reason that cause this issue based on the limited information. Here are some articles that use Excel as the source or destination, please refer to the link below.
    http://www.mssqltips.com/sqlservertutorial/211/sql-server-integration-services-ssis-data-flow/
    http://www.sqlshack.com/using-ssis-packages-import-ms-excel-data-database/
    If the issue persists, please provide us more information about your issue, so that we can make further analysis.
    Regards,
    Charlie Liao
    TechNet Community Support

  • Could nt complete your request because source and destination files are the same

    Hi, thank you for reading.
    I'm having this problem and it's driving me nuts.
    I'm actually following a tutorial that you can check out here: http://nightshifted.tumblr.com/post/2559360661/tutorial-paused-animations
    basically I'm trying to do a animated gif with canvas (I'm sorry if my english is not so great). when I try to drag the layers into the canvas (step 2 of the tutorial), I get the error: "could not complete your request because source and destination are the same".
    can anybody help me? I have both CS3 and CS5 and they the error appears in both.
    thank you in advanced

    I think they mean select the layers and frames and using the move tool, drag
    inside the document (click inside the document window and drag) to move the
    selected layers to the top half  (transparent area), not to drag the layers from
    the layers palette into the document, which would give that error.
    MTSTUNER

  • How adding a data source-data destination inside SSIS 2012-SSDT

    Hi,
    I need to see inside a SSIS 2012 project a new SSIS installed component but in the SSDT 2010 I cannot see the SSIS Data Flow Items tab for adding data source/data destination respect to the choose toolbox items pane:
    It seems a SSIS bug.
    Any helps to me, please?
    Thanks

    Hi,
    In SQL 2012 you are no longer required to manually pick the tasks and components you want to use. You have to select from the new custom SSIS Toolbox to use the additional components you need.
    SSIS Tasks Components Scripts Services | http://www.cozyroc.com/

Maybe you are looking for

  • Webview with windows 7 Proff and IE 8

    We are trying to run Cisco webview  from client Machine(windows 7 professional with IE 8) the webview is accessible but when we generate any report we got the below  error Message: ((((Error. The server encountered an unexpected condition which preve

  • Populateing Calendar Server with calendar events???

    Hi all, is it possible to populate a user's calendar in Calendar Server with particular events? We are building a communications environment that will initially be comprised of Comms Express and Messaging server and later Calendar Server. This is for

  • IPod and iPad mini

    I have and iPad mini but i want to take something into school And I'm not sure whether I should get an iPod touch or nano And the whether it should be 16gb or 32gb Thx FYI my iPad mini is 32gb

  • CATS: Creation of SES through TX-CATM with multiple personnel numbers

    Hi Gurus, We need to create through CATM SES for multiple personnel numbers. We need also to be able entering hours for multiple personnel through CAT2. Tried using settings u201Center for several personnel nosu201D and u201Cselect via personnel list

  • How to make WS-I compliant Web Services

    What is Oracle's recommended way to develop Web Services that fully conform to the WS-I standards using PRODUCTION RELEASES of Oracle's software (JDeveloper 10G and OracleAS 10G)? This is for a production site and it needs to be supported from Oracle