SSIS - Script Task creates a DTS var and using Foreach loop, Execute SQL needs to INSERT into table from this DTS var.

I have a script task written in C# that creates an array of strings "arrayFields" after parsing a text file. It saves the array of strings in a DTS variable.
Each row in array represents a row is comma separated and is a row that must be inserted into a table. For example,
X and Z are fields in the table
X1, X2,....Xn
Z1,Z2,...Zn
I am using a Foreach Loop  to grab each row and then  Execute SQL Task to take each row from the array and insert each field per row in a table,
The SQL is something like,
INSERT dbo.table values(field1, field2,...fieldn) arrayFields?
What should this this INSERT look like?

I guess you implemented
Shredding a Recordset
Based on what I understood (correct me if I am wrong) you have difficulties mapping the input parameters, if so here is the guide
http://www.sqlis.com/sqlis/post/The-Execute-SQL-Task.aspx
In short it might look like
INSERT dbo.table  (ColumnA, ColumnB,...) VALUES (?,?...)
The syntax for the T-SQL INSERT is http://technet.microsoft.com/en-us/library/dd776381%28v=sql.105%29.aspx
Arthur
MyBlog
Twitter

Similar Messages

  • Create and insert into table from Oracle to MS SQL server.

    Hello,
    Oracle Database 11g and Red hat 5
    I have a very different kind of issue. I am handling the ORACLE db(remote db with all the important data). On the other side their is a MS SQL server db(local db with some testing data in it). All the users will access the ORACLE db for the actual processing but for sometime they need to apply some of their own concepts. So they will transfer the data from ORACLE to MS sql server.
    I want to create a code in ORACLE db like a procedure , which will create a table in MS sql server , insert data into it,Also create some metadata table to keep some of my table's info on MS SQL serve db,If the table is present it should append the data, .... like many things ...
    Overall my question is , how can i write a code to make these operation on a remote db, that to these operations are DDL and on MS SQL Server(Non-Oracle) ???
    Please guide me with some ideas or solutions ...
    Also provide if you have some good links to study ...
    thanks in advance.

    I'm not sure why you never visit http://tahiti.oracle.com prior to asking any question. Is it forbidden in your locale? Are you afraid of it? Will your salary be decreased when you visit the documentation?
    http://www.oracle.com/pls/db111/search?word=sql+server&partno=
    should provide sufficient information.
    Your doc question must be considered a violation of Forum Etiquette and an abuse of this forum.
    Sybrand Bakker
    Senior Oracle DBA

  • Convert ActiveX DTS script task to SSIS Script task - Please help

    Hello,
    I Have a ActiveX script that was used in a DTS package but I'm currently trying to convert all my DTS packages to SSIS.The script is tasked to run the package on a daily basis. Everything works fine except the ActiveX script. It gives an error on my DTSGlobalVariables.parent,
    I looked up this error and changed it to "DTS.Variables("User::VariableName").Value", in
    the SSIS script task (in VB) but now I'm getting error: 
    Microsoft.SqlServer.Dts.Runtime.DtsRuntimeException: The element cannot be found in a collection.
    ---> System.Runtime.InteropServices.COMException (0xC0010009): The element cannot be found in a collection.
    bij Microsoft.SqlServer.Dts.Runtime.Wrapper.IDTSVariables100.get_Item(Object Index)
    bij Microsoft.SqlServer.Dts.Runtime.Variables.get_Item(Object index)
    --- Einde van intern uitzonderingsstackpad ---
    bij Microsoft.SqlServer.Dts.Runtime.Variables.get_Item(Object index)
    bij ST_f32fc12b60f34bebbbdfc0c5e5b40a96.vbproj.ScriptMain.Main()
    --- Einde van intern uitzonderingsstackpad ---
    bij System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
    bij System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
    bij System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
    bij System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
    bij System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
    bij System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, CultureInfo culture)
    I have tried to convert this ActiveX script into a SSIS script task in VB but I know hardly any VB... So I'm wondering what the best course of action for me is, should I try to convert it into the script task like I am trying now, if so, how do I make it
    work?
    Any help would be really really welcome.
    This is the original ActiveX script that needs to be converted:
    ' Visual Basic ActiveX Script
    Function Main()
    Dim sEnvironm
    Dim sServer
    Dim sSourceFile
    Dim sSourcePath
    Dim sBackupPath
    Dim sErrorPath
    Dim sFileName
    Dim sUDLPath
    ' Set vars
    ' First 2 are depending on the server and db
    ' FILL IN THE RIGHT VALUES
    sEnvironm = "MON_Datamart"
    sServer = "BrechtProesmans"
    ' --- DO NOT CHANGE ANYTHING BELOW THIS LINE ---
    sSourceFile = "C:\Program Files\Microsoft SQL Server\MON_Datamart\SourceFiles\tbl_L00T1.txt"
    sSourcePath = "C:\Program Files\Microsoft SQL Server\MON_Datamart\SourceFiles\"
    sBackupPath = "C:\Program Files\Microsoft SQL Server\MON_Datamart\BackupFiles\"
    sErrorPath = "C:\Program Files\Microsoft SQL Server\MON_Datamart\ErrorFiles\"
    sFileName = "tbl_L00T1.txt"
    sUDLPath = "C:\Program Files\Microsoft SQL Server\MON_Datamart\MON_Datamart.udl"
    ' Initial
    FoundError = False
    ' Get a handle to the Package object.
    Set oPackage = DTSGlobalVariables.Parent
    ' Update DTSConnections
    Set oConnection = oPackage.Connections("tbl_L00T1.txt")
    oConnection.DataSource = sSourceFile
    Set oConnection = oPackage.Connections("Datamart")
    oConnection.UDLPath = sUDLPath
    Set oConnection = oPackage.Connections("Truncate")
    oConnection.UDLPath = sUDLPath
    ' Update DTSTasks
    Set oTask = oPackage.Tasks("DTSTask_DTSDataPumpTask_1").CustomTask
    oTask.SourceObjectName = sSourceFile
    oTask.DestinationObjectName = sEnvironm & ".dbo.stg_tbl_L00T1"
    ' Set Global vars
    DTSGlobalVariables("SourcePath").Value = sSourceFile
    DTSGlobalVariables("BackupPath").Value = sBackupPath
    DTSGlobalVariables("ErrorPath").Value = sErrorPath
    DTSGlobalVariables("FileName").Value = sFileName
    ' Clean up.
    Set oTask = Nothing
    Set oConnection = Nothing
    Set oPackage = Nothing
    Main = DTSTaskExecResult_Success
    End Function

    Set a breakpoint and tell us on what line it dies, at the same time, you can inspect the variable values in the Auto window (if there are) as it merely perhaps is an issue with values not being passed in.
    Arthur
    MyBlog
    Twitter

  • Consuming Web Services in SSIS Script Task

    Hello
    Sorry for my English, I' ll try to explain my problem.
    I am new to SSIS. Using this article http://blogs.msdn.com/b/dataaccesstechnologies/archive/2010/01/28/consuming-web-services-in-ssis-script-task.aspx I have tried to consume web service.
    1. I have created proxy class using VS Command Prompt
    2. A have added proxy class to Script Task
    3. But when I  want to create the instance of the proxy class, it can be accessed from the ScriptMain.cs. 
    I will be very pleased for the help!

    perhaps you missed this step:
    --> Modify the code and add Credentials before calling the web method:
    Public
    SubMain()
    Dim
    ws As NewService1
    ws.Credentials =
    New System.Net.NetworkCredential("user name",
    "password",
    "domain name")
    MsgBox("Square
    of 2 = "& ws.Square(2))
    Dts.TaskResult = Dts.Results.Success
    End
    Sub
    Arthur
    MyBlog
    Twitter

  • NameSpace for XML But in SSIS Script Task

    Hello, 
    I am creating an xml Document that pulls information from a staging table in sql. However the issue I am having is that i need  a namespace or a start element to handle a ':' but i keep getting its not a hexadecimal blah blah. 
    I feel like I have tried everything for this. 
    So maybe someone can help me  
           writer.WriteStartDocument()
     writer.WriteComment("edited with XMLSpy v2010 rel. 3 (http://www.altova.com) by MESMERiZE (MSM)")
    writer.WriteComment("Samply XML file generated by XMLSpy v2010 rel. 3 (http://www.altova.com)")
    So i have the comments show up fine but then i need it to show 
    <mssext:sendWarrantyContractBatch xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mssext="http://jlrint.com/mss/message/sendwarrantycontract/1" xsi:schemaLocation="http://jlrint.com/mss/message/sendwarrantycontract/1
    FRS_000143-SendWarrantyContractMessages.xsd">
     I can get the websites and all the xmlns to show up fine that is not the issue the issue is the mssext:sendWarrantyContractBatch 
    IS there any way to get the Colon to show up ?? 
    Remember this is in a ssis script task with visual basic 2008 code 

    check this link. it has a method specified in the comments section
    http://blogs.lessthandot.com/index.php/datamgmt/dbprogramming/create-xml-files-out-of-sql-server-with/
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Running a Select query against multiple sql servers using SSIS script task.

    Hi Guys,
    I need to fetch data from multiple sql servers using  SSIS scirpt task inside a foreach container.
    is there anyway i can build dynamic sql connections using ssis variables inside SSIS script task in each loop
    Please guide me or refer any blogs so that i will try..
    Thanks in advance.

    Your only options is using .net code, then it will be no different than using a console app in a loop.
    using (SqlConnection connection = new SqlConnection(connectionString))
    connection.Open();
    Console.WriteLine("ServerVersion: {0}", connection.ServerVersion);
    Console.WriteLine("State: {0}", connection.State);
    and so forth for each connection string
    the connection string would come from the ForEach loop
    Arthur My Blog

  • PowerShell Script to Create a Contact Card and Enable Email Forwarding

    Exchange 2010
    Can anyone help with creating a powershell script to create a contact card and set email forwarding at the sametime?
    I'm looking to import a list of 200 users via a text or csv file, create the contact card with first name, middle initial if one exists, last name, (no alias) and put the contact card in the following OU "DIS###" in the a.b.c.com domain as well
    as enable forwarding to @mail.com.
    I've been able to create a script to enable mail forwarding but it doesn't help me without a contact card.  I hate to put this upon anyone, but my ps scripting and Exchange knowledge is still in it's infant stage and I need get this done post haste

    Q:Import csv: Does this contain 200 mailboxes name
    A:It contains 200 user logon names.
    For the mail forwarding:
    I currently have a csv file with two columns -- one named displayname and the next call mailaddress.  Under the displayname column I have the users account name (first.mi.last -- middle initial if they have one) and under mailaddress i have @mail.com.                                                                                                           
    script:                                                                                                                                                                    
    Import-CSV C:\setmailforwarding\mailforwarding.csv | foreach-Object{Get-Mailbox $_.displayname | set-Mailbox -forwardingAddress $_.mailaddress}
    The above script should work if the contact card has been created.  Obviously I need to create the card first.
    I don't have a script to set up the contact card as of yet -- I was hoping to get some help on that.
    Q:E-mail forwarding: Is this  from  mailboxes to mail contact, you will be creating
    A:Not really sure what you are asking.  I'm looking to create the contact card with a csv or txt file for first name, middle initial if one exists, last name, (no alias) and put the contact card in the following OU "DIS###" in the a.b.c.com domain as
    well as enable forwarding to @mail.com.  The users current email is @mail.1234.com and we will be migrating our mailboxes to another organization that uses @mail.com.  I will need to set forwarding in the interim until the migration is complete.
    Hope this helps.

  • HELP !!!I want to give my old apple to my girlfriend, SO SHE CAN PLUG IN HER NEW IPHONE, CREATE AN APPLE ID AND USE MY OLD LAPTOP TO DOWNLOAD itunes music, but im having trouble deautherizing it, and making her the OWNER, IF you get my drift, how to i mak

    Hi
    I have a new powerbook and want to give my girlfriend my old G4 power book, she has a new iphone 5s, and wants to create a new itunes/apple id. When i try to de authorize the G4 and sign in with her new apple ID it says bad password, how can i release the G4 from my cluster of authorized apples and make her the owner so she can download music and more importantly sync her music with her phone, she only has 3 songs on her iphone, and loaded all her CD's into the g4 but cant sync, im no dummy and this shouldnt be hard, but its driving me crazy!!!!!!
    thx u so much for your time heeeellppppp.

    Perhaps, as we have the same music tastes, for now i should just authorize her phone to my power book just to sync music, not pics, contacts etc? I'd hate to overright her contacts etc lol????
    HELP !!!I want to give my old apple to my girlfriend, SO SHE CAN PLUG IN HER NEW IPHONE, CREATE AN APPLE ID AND USE MY OLD LAPTOP TO DOWNLOAD itunes music, but im having trouble deautherizing it, and making her the OWNER, IF you get my drift, how to i mak 

  • How to create a stored procedure and use it in Crystal reports

    Hi All,
    Can anyone explain me how to create a stored procedure and use that stored procedure in Crystal reports. As I have few doubts in this process, It would be great if you can explain me with a small stored proc example.
    Thanks in advance.

    If you are using MSSQL SERVER then try creating a stored procedure like this
    create proc Name
    select * from Table
    by executing this in sql query analyzer will create a stored procedure that returns all the data from Table
    here is the syntax to create SP
    Syntax
    CREATE PROC [ EDURE ] procedure_name [ ; number ]
        [ { @parameter data_type }
            [ VARYING ] [ = default ] [ OUTPUT ]
        ] [ ,...n ]
    [ WITH
        { RECOMPILE | ENCRYPTION | RECOMPILE , ENCRYPTION } ]
    [ FOR REPLICATION ]
    AS sql_statement [ ...n ]
    Now Create new report and create new connection to your database and select stored procedure and add it to the report that shows all the columns and you can place the required fields in the report and refresh the report.
    Regards,
    Raghavendra
    Edited by: Raghavendra Gadhamsetty on Jun 11, 2009 1:45 AM

  • Hello I bought a G-Raid GR4 4000 4 TB and used it for a backup with my new Imac27. Now this is all I get. "Time Machine couldn't complete the backup to "G-RAID". to complete backup. An error occurred while creating the backup folder.

    Hello I bought a G-Raid GR4 4000 4 TB and used it for a backup with my new Imac27. Now this is all I get. "Time Machine couldn’t complete the backup to “G-RAID”. to complete backup. An error occurred while creating the backup folder."
    Any idea what I should do?

    If you have more than one user account, these instructions must be carried out as an administrator.
    Launch the Console application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Console in the icon grid.
    Make sure the title of the Console window is All Messages. If it isn't, select All Messages from the SYSTEM LOG QUERIES menu on the left. If you don't see that menu, select
    View ▹ Show Log List
    from the menu bar.
    Enter the word "Starting" (without the quotes) in the String Matching text field. You should now see log messages with the words "Starting * backup," where * represents any of the words "automatic," "manual," or "standard." Note the timestamp of the last such message. Clear the text field and scroll back in the log to that time. Select the messages timestamped from then until the end of the backup, or the end of the log if that's not clear. Copy them (command-C) to the Clipboard. Paste (command-V) into a reply to this message.
    If all you see are messages that contain the word "Starting," you didn't clear the search box.
    If there are runs of repeated messages, post only one example of each. Don't post many repetitions of the same message.
    When posting a log extract, be selective. Don't post more than is requested.
    Please do not indiscriminately dump thousands of lines from the log into this discussion.
    Some personal information, such as the names of your files, may be included — anonymize before posting.

  • Is it possible to load multiple .xlsx files into a SQL Server Table using SSIS and a Foreach Loop Container when each Excel spreadsheet is comprised of two different worksheets

    So we have an Invoice .xlsx File from a 3rd party vendor. It contains two worksheets..."Enrolled" and "Engaged". The data and data columns in each worksheet is different. Is it possible to loop through multiple .xlsx files using SSIS
    and a Foreach Loop Container for each spreadsheet, and then another Foreach Loop Container to control each worksheet, and pump the Excel data into a SQL Server Table first for "Enrolled" and then for "Engaged"? How can I control the Foreach
    Loop Container in SSIS to process ONLY the "Enrolled" worksheet first? And then the "Engaged" worksheet next?
    I know I have multiples out here and I apologize for that...but right now it seems as though I take three steps forward and then two back.
    Any help would be GREATLY appreciated!
    Thanks in advance!

    If the structure of the Excel sheets does not change from file to file then you can by having one ForEach Loop processing always the "Enrolled" sheet and another always the "Engaged" this is doable because the Excel OLEDB connector allows
    to pick individual sheets, it is problematic therefore when sheet names themselves change.
    MSDN has an example: https://msdn.microsoft.com/en-ca/library/ms345182.aspx
    Arthur
    MyBlog
    Twitter

  • Reg: read excel column and insert into table.

    hi Friends,
          i wanted to read the data from Excel and insert into in my oracle tables.
          can you provide the link or example script.
        how to read the column value from excel and insert into table.
      please help.

    < unnecessary reference to personal blog removed by moderator >
    Here are the steps:
    1) First create a directory and grant read , write , execute to the user from where you want to access the flat files and load it.
    2) Write a generic function to load PIPE delimited flat files:
    CREATE OR REPLACE FUNCTION TABLE_LOAD ( p_table in varchar2,
    p_dir in varchar2 DEFAULT ‘YOUR_DIRECTORY_NAME’,
    P_FILENAME in varchar2,
    p_ignore_headerlines IN INTEGER DEFAULT 1,
    p_delimiter in varchar2 default ‘|’,
    p_optional_enclosed in varchar2 default ‘”‘ )
    return number
    is
    – FUNCTION TABLE_LOAD
    – PURPOSE: Load the flat files i.e. only text files to Oracle
    – tables.
    – This is a generic function which can be used for
    – importing any text flat files to oracle database.
    – PARAMETERS:
    – P_TABLE
    – Pass name of the table for which import has to be done.
    – P_DIR
    – Name of the directory where the file is been placed.
    – Note: The grant has to be given for the user to the directory
    – before executing the function
    – P_FILENAME
    – The name of the flat file(a text file)
    – P_IGNORE_HEADERLINES
    – By default we are passing 1 to skip the first line of the file
    – which are headers on the Flat files.
    – P_DELIMITER
    – Dafault “|” pipe is been passed.
    – P_OPTIONAL_ENCLOSED
    – Optionally enclosed by ‘ ” ‘ are been ignored.
    – AUTHOR:
    – Slobaray
    l_input utl_file.file_type;
    l_theCursor integer default dbms_sql.open_cursor;
    l_lastLine varchar2(4000);
    l_cnames varchar2(4000);
    l_bindvars varchar2(4000);
    l_status integer;
    l_cnt number default 0;
    l_rowCount number default 0;
    l_sep char(1) default NULL;
    L_ERRMSG varchar2(4000);
    V_EOF BOOLEAN := false;
    begin
    l_cnt := 1;
    for TAB_COLUMNS in (
    select column_name, data_type from user_tab_columns where table_name=p_table order by column_id
    ) loop
    l_cnames := l_cnames || tab_columns.column_name || ‘,’;
    l_bindvars := l_bindvars || case when tab_columns.data_type in (‘DATE’, ‘TIMESTAMP(6)’) then ‘to_date(:b’ || l_cnt || ‘,”YYYY-MM-DD HH24:MI:SS”),’ else ‘:b’|| l_cnt || ‘,’ end;
    l_cnt := l_cnt + 1;
    end loop;
    l_cnames := rtrim(l_cnames,’,');
    L_BINDVARS := RTRIM(L_BINDVARS,’,');
    L_INPUT := UTL_FILE.FOPEN( P_DIR, P_FILENAME, ‘r’ );
    IF p_ignore_headerlines > 0
    THEN
    BEGIN
    FOR i IN 1 .. p_ignore_headerlines
    LOOP
    UTL_FILE.get_line(l_input, l_lastLine);
    END LOOP;
    EXCEPTION
    WHEN NO_DATA_FOUND
    THEN
    v_eof := TRUE;
    end;
    END IF;
    if not v_eof then
    dbms_sql.parse( l_theCursor, ‘insert into ‘ || p_table || ‘(‘ || l_cnames || ‘) values (‘ || l_bindvars || ‘)’, dbms_sql.native );
    loop
    begin
    utl_file.get_line( l_input, l_lastLine );
    exception
    when NO_DATA_FOUND then
    exit;
    end;
    if length(l_lastLine) > 0 then
    for i in 1 .. l_cnt-1
    LOOP
    dbms_sql.bind_variable( l_theCursor, ‘:b’||i,
    ltrim(rtrim(rtrim(
    regexp_substr(l_lastLine,’([^|]*)(\||$)’,1,i),p_delimiter),p_optional_enclosed),p_optional_enclosed));
    end loop;
    begin
    l_status := dbms_sql.execute(l_theCursor);
    l_rowCount := l_rowCount + 1;
    exception
    when OTHERS then
    L_ERRMSG := SQLERRM;
    insert into BADLOG ( TABLE_NAME, ERRM, data, ERROR_DATE )
    values ( P_TABLE,l_errmsg, l_lastLine ,systimestamp );
    end;
    end if;
    end loop;
    dbms_sql.close_cursor(l_theCursor);
    utl_file.fclose( l_input );
    commit;
    end if;
    insert into IMPORT_HIST (FILENAME,TABLE_NAME,NUM_OF_REC,IMPORT_DATE)
    values ( P_FILENAME, P_TABLE,l_rowCount,sysdate );
    UTL_FILE.FRENAME(
    P_DIR,
    P_FILENAME,
    P_DIR,
    REPLACE(P_FILENAME,
    ‘.txt’,
    ‘_’ || TO_CHAR(SYSDATE, ‘DD_MON_RRRR_HH24_MI_SS_AM’) || ‘.txt’
    commit;
    RETURN L_ROWCOUNT;
    end TABLE_LOAD;
    Note: when you run the function then it will also modify the source flat file with timestamp , so that we can have the track like which file was loaded .
    3) Check if the user is having UTL_FILE privileges or not :
    SQL> SELECT OWNER,
    OBJECT_TYPE
    FROM ALL_OBJECTS
    WHERE OBJECT_NAME = ‘UTL_FILE’
    AND OWNER =<>;
    If the user is not having the privileges then grant “UTL_FILE” to user from SYS user:
    SQL> GRANT EXECUTE ON UTL_FILE TO <>;
    4) In the function I have used two tables like:
    import_hist table and badlog table to track the history of the load and another to check the bad log if it occurs while doing the load .
    Under the same user create an error log table to log the error out records while doing the import:
    SQL> CREATE TABLE badlog
    errm VARCHAR2(4000),
    data VARCHAR2(4000) ,
    error_date TIMESTAMP
    Under the same user create Load history table to log the details of the file and tables that are imported with a track of records loaded:
    SQL> create table IMPORT_HIST
    FILENAME varchar2(200),
    TABLE_NAME varchar2(200),
    NUM_OF_REC number,
    IMPORT_DATE DATE
    5) Finally run the PLSQL block and check if it is loading properly or not if not then check the badlog:
    Execute the PLSQL block to import the data from the USER:
    SQL> declare
    P_TABLE varchar2(200):=<>;
    P_DIR varchar2(200):=<>;
    P_FILENAME VARCHAR2(200):=<>;
    v_Return NUMBER;
    BEGIN
    v_Return := TABLE_LOAD(
    P_TABLE => P_TABLE,
    P_DIR => P_DIR,
    P_FILENAME => P_FILENAME,
    P_IGNORE_HEADERLINES => P_IGNORE_HEADERLINES,
    P_DELIMITER => P_DELIMITER,
    P_OPTIONAL_ENCLOSED => P_OPTIONAL_ENCLOSED
    DBMS_OUTPUT.PUT_LINE(‘v_Return = ‘ || v_Return);
    end;
    6) Once the PLSQL block is been executed then check for any error log table and also the target table if the records are been successfully imported or not.

  • Popup not INSERTing into table and not refreshing called page ...

    Greetings
    Environment: APEX 3.1.1.00.09 on AIX 5.3 in 10gR2
    I have read many of the threads concerning my issue and I feel I am getting close to the answer but somehow have combined too many of the suggestions and am tripping over my own code.
    Please look at my sample application on apex.oracle.com:
    Workspace: galway
    User: gwicke
    Password: gwicke
    Please start with Page3, select any Agency and then click 'Add New Contract'.
    There is currently a <strong>BOLD </strong>label 'Add New Builder' that is a link that should open a popup window. Type any name into the field and click 'Create Builder'. This should INSERT the row into the builder table, close the popup, assign the new builder name to the calling page item 'Builder Name' and populate the screen item.
    In it's current state, the application will open the popup window, allow entry and close upon clicking the 'Create Builder' button. However the new builder is NOT inserted into the table and the calling page item is not populated.
    By looking at the Page Items and Session State I can see the correct values assigned to the 'Pn_BULDER_NAME' items on both the popup page (4) and the calling page (2) but the value does not appear on the screen.
    I've read where there's really two parallel universes, no sorry, two versions of the screen items, one in Session State and one that is displayed in the browser and there are steps to take to be sure the one displayed is updated from Session State as I would like in this case.
    I've entered Javascript code in the Page4 - header to define the 'passBack2()' function and code in the 'Optional URL Redirect' section of the 'Add Builder' button to hopefully execute the ARP for the INSERT, assign the Page2 items and close the popup. It doesn't quite get all that done.
    Any helpp is greatly appreciated. Thanks to Denes for most of the code suggestions I've followed.
    -gary

    Hi Gary,
    I think that there's a very simple solution to this - didn't really spot it last night.
    Firstly, yes, you could use a "button" to handle the call for the popup - just make sure that the button is a URL type "button" that is actually an A tag with the call in the URL target setting. Alternatively, you could take you existing A tag and use the same class attribute for one of your buttons as this should make it look like a button.
    More importantly, though, I think that we could do it as:
    1 - On your page 2 popup call, clear that cache for page 4 (the popup page) - I have already done this in your app by updating the url
    2 - On the popup page, allow the user to enter in their desired P4_BUILDER_NAME value (not sure if you want to do something to make this unique?)
    3 - Let the user click the Create button on the popup. This will submit the page, which will get your P4_BUILDER_RANK (the pk) value and insert a new record into the table (you could consider creating a sequence and a trigger to handle the creation of a new PK value?).
    4 - Assuming the P4_BUILDER_RANK then exists (it wouldn't if there was an error somewhere), then conditionally display a region that had a piece of javascript that submits page 2 and then closes itself - we don't need to pass anything back to page 2 (see below)
    5 - As the P4_BUILDER_NAME and P4_BUILDER_RANK exist in the session, when page 2 is being reloaded, (A) the select list would be updated with the new Builder (still not sure why all my entries appeared at the bottom instead of in alpha order??) and (B) both P2_BUILDER_NAME and P2_BUILDER_RANK can have Post Calculation Computations set (NVL(:P4_BUILDER_NAME,:P2_BUILDER_NAME) and NVL(:P4_BUILDER_RANK, :P2_BUILDER_RANK) respectively) - the effect of this is, if there are values stored in the P4 page items, we use them, otherwise we use whatever values were in the P2 page items
    6 - Finally, to stop (5) happening in all page 2 loads, you would need to clear the cache for page 4 in as many places as possible - eg, branches to page 2 or buttons on page 2
    The reason we can't pass values back to page 2 is that one of the items is a select list. The value we want to select won't appear on the select list until the page has been submitted. So, we can't set the value and submit because the value isn't there. We can't submit and set the value because javascript wouldn't know when the page has been updated (or, at least, you would have to put some independant mechanism in place to identify this, which may become complicated).
    So, simply put, as long as we know that if the values are in the session, we can use Post Calculation Computations to set our fields to these values. The only thing to bear in mind is that we need to ensure that these session values only exist when we need them - hence clearing the cache. This principle should work for any type of field - but, as you have no doubt seen, simple text fields can be updated by the popup directly as the field should accept any value we give it.
    My only other recommendation would be to completely remove the MRU processes from the page as these are not required (they just confuse the issue) and you could make your PK fetch and record insert into a single process - just to keep things neat and tidy, you understand!
    When I finished with your app last night, I did leave it so that javascript would create a new option on the select list and then set the value. But the above methodology seems to be a lot simpler.
    Andy

  • Reading  xml data from url and insert into table

    CREATE TABLE url_tab2
    URL_NAME VARCHAR2(100),
    URL SYS.URIType
    INSERT INTO url_tab2 VALUES
    (’This is a test URL’,
    sys.UriFactory.getUri(’http://www.domain.com/test.xml’)
    it is giving error as invalid character

    Check if your single quotes are the correct single quotes.
    The principle works as advertised in the XMLDB Developers Guide...
    C:\>sqlplus / as sysdba
    SQL*Plus: Release 11.1.0.7.0 - Production on Tue Nov 25 21:44:46 2008
    Copyright (c) 1982, 2008, Oracle.  All rights reserved.
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL> create user OTN identified by OTN account unlock;
    User created.
    SQL> grant dba, xdbadmin to OTN;
    Grant succeeded.
    SQL> conn OTN/OTN
    Connected.
    SQL> CREATE TABLE uri_tab (docUrl SYS.URIType, docName VARCHAR2(200));
    Table created.
    SQL> -- Method SYS.URIFACTORY.getURI() with absolute URIs
    SQL> -- Insert an HTTPUri with absolute URL into SYS.URIType using URIFACTORY.
    SQL> -- The target is Oracle home page.
    SQL> INSERT INTO uri_tab VALUES
      2  (SYS.URIFACTORY.getURI('http://www.oracle.com'), 'AbsURL');
    1 row created.
    SQL> -- Insert an HTTPUri with relative URL using constructor SYS.HTTPURIType.
    SQL> -- Note the absence of prefix http://. The target is the same.
    SQL> INSERT INTO uri_tab VALUES (SYS.HTTPURIType('www.oracle.com'), 'RelURL');
    1 row created.
    SQL> -- Insert a DBUri that targets employee data from database table hr.employees.
    SQL>
    SQL> INSERT INTO uri_tab VALUES
      2  (SYS.URIFACTORY.getURI('/oradb/HR/EMPLOYEES/ROW[EMPLOYEE_ID=200]'), 'Emp200');
    1 row created.
    SQL> SELECT e.docUrl.getCLOB(), docName FROM uri_tab e;
    E.DOCURL.GETCLOB()
    DOCNAME
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN
    ">
    <html>
    <head>
    AbsURL
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN
    ">
    <html>
    E.DOCURL.GETCLOB()
    DOCNAME
    <head>
    RelURL
    <?xml version="1.0"?>
    <ROW>
      <EMPLOYEE_ID>200</EMPLOYEE_ID>
      <FIRST_NAME>Jenn
    Emp200
    SQL> set long 1000
    SQL> select HTTPURITYPE('www.oracle.com').getCLob() from dual;
    HTTPURITYPE('WWW.ORACLE.COM').GETCLOB()
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN
    ">
    <html>
    <head>
    <title>Oracle 11g, Siebel, PeopleSoft |
    Oracle, The World's Largest Enterprise S
    oftware Company</title>
    <meta name="title" content="Enterprise Applications | D
    atabase | Fusion Middleware | Applicatio
    ns Unlimited | Business | Oracle, The Wo
    rld's Largest Enterprise Software CompanEdited by: Marco Gralike on Nov 25, 2008 10:13 PM

  • I want to create a cd on my mac that autolaunches an .html-page after inserting into a pc or a mac. Is that possible?l

    I want to create a cd on my mac that autolaunches an .html-page after inserting into a pc or a mac. Is that possible?

    Solving this requirement on a modern Windows system is going to be problematic too, as the autorun mechanisms are increasingly being locked down over there, if not by the end-user or the system installer, then by the usual anti-malware tools that are installed.
    Given this is one of the most vulnerable populations here in terms of operational security, you'll probably want to target online distribution, or to distribute a signed application that can be installed on the target (akin to a managed system) and that then accesses your data on external storage.  All that app might do is access the disk, verify that the contents of the device are trusted and valid, and launch the browser.
    I'd likely target online distribution or pre-loaded distributions and iOS, as that's where all of the older folks I'm dealing with are headed, too.  If not a native app, then maybe a web-app here, and download the contents into the HTML5 local storage.

Maybe you are looking for

  • Studio MX 2004 programs will not open at all

    As others here and elsewhere have reported, Mac OS updates occasionally (often?) cause problems with the Macromedia Studio MX 2004 programs. After these problematic updates, the Macromedia programs do not open; the icons bounce in the dock a few time

  • Key in table

    Is it advicable to make all the fields in a table as key? The case is to maintain a control table where 2 fields are required and it should be unique also. is there any thing wrong in doing it?

  • How to hide or lock toolbar fileds by using script

    Hi experts, Could you please let me know how to lock or hide toolbar fields by using script. Thanks, Pavan

  • Will the console log show a history of random shutdowns?

    My macbook has suddenly started the random shutdown problem. It started a couple of days ago, I'd had no problems up until then. At one point today it was shutting down immediately on waking from sleep, and then would only stay on for about two minut

  • Is there a way to save MY workspace the way I want it?

    Currently in Bridge, I cannot save my custom workspace. Everytime I launch bridge I have to rearrange the size of my windows. I have set it up and saved custom workspaces with different names only to have them not be what I want when I launch bridge