Inserting data in a txt file

Hello world
I created a form in 6i where I can open a .txt file to show me all the data in this file, so after the display of data in my form, I press a button and I insert data in my database, but if I add new data to this .txt file when I press record it says that certain values are already inserted and they cannot be repeated , because the id is not null, so what I want to ask you is how can I modify the same program to make me insert values that are not already inserted. Only new data.
This is my code:
Get_file_contents PROCEDURE IS
Salida Varchar2 (1000);
Compañía Varchar2 (5);
Number of alert: = 0;
OUT_FILE Text_IO. Type_de_fichier;
-in_file Text_IO. Type_de_fichier;
-linebuf Varchar2 (1000);

Function Abre_Archivo
Return boolean is

BEGIN
OUT_FILE: = Text_IO. Fopen(:file_name,'r');
Return (true);
exception
While others then
Return (false);
END;

BEGIN
go_block ('MY_BLOCK');
clear_block (no_validate);
premier_enregistrement;
If Abre_Archivo then
OUT_FILE: = Text_IO. Fopen(:file_name,'r');
End if;
-Validation;

LOOP
Text_IO. Get_Line (OUT_FILE, Salida);
: MY_BLOCK. SCHOOL_ID: = substr (Salida, 1, instr(Salida,',',1,1)-1);
: MY_BLOCK. CLASS_ID: is substr (Salida, instr(Salida,',',1,1) + 1, (instr(Salida,',',1,2)-instr(Salida,',',1,1))-1);.
: MY_BLOCK. Class_name: = substr (Salida, instr(Salida,',',1,2) + 1);
: MY_BLOCK. STATUS: = 'A ';

next_record;
Synchronize;
END LOOP;

Text_IO. Fclose (OUT_FILE);
premier_enregistrement;
Exception when No_Data_Found then
delete_record;
Text_IO. Fclose (OUT_FILE);
premier_enregistrement;
END;

OK, the constraint is the id of class only. So adjust the WHERE condition so that it only checks the class id.

Tags: Oracle Development

Similar Questions

  • How to ignore the details of footer when loading data from a .txt file

    Hello experts,

    I import data from a txt file in my database. I jumped my header using SKIP information, but how can I ignore my footer details.
    Thank you

    Answer on your other thread:

    Txt for a required format file processing

  • How constantly write data in a txt file

    Hello
    first of all, sorry for the bad English, but I have a problem to write data continuously to the txt file... I have a chart 2D with values based 2 sliders (sliders values) and some functions I want to interpolate the value by using the bilinear method... and after that the value of the sliders, interpolated value and the value of the closest points, I want to write to a file txt... for every 2-3 seconds perhaps, it would be ideal to be formatted as ::
    x y f f1 f2 f3 f4
    ..   ..  .. . .. .   ..   ...  . ..
    ... ...  ..    ...   ...   ...   ...

    but... first of all I have a problem with writing data, because every time he deletes old data and simply write a new and it is not horizontal... I am very very new to this (it's obvious) and any help will be very grateful 
    Thank you

    Diane beat me to it, I made a few changes to your code, so I'll post it anyway.

    As proposed, please go through the tutorials.

    I added an entry to the worksheet at the end node just to show it can be done at the end so. Table of building on a while loop is not very efficient memory, but it's just to show you what can be done. If you plan to go this route, initialize an array and use the subset to the table replace.

    All the best.

  • write data to a txt file

    Hello.

    I use visa and serial Protocol in my vi n want to save the data from MCU in labview to txt file format which, in the data record in each row not each tab.

    I want to just save not given time. Meanwhile, I plot the data in the chart.

    I search in the forum and consider the posts but can't find a solution.


  • Problem with registration of data in the txt file

    Hello

    I have 2009 Labview, Labview real-time 2009 and cRIO 3.3.0. I also NEITHER cRIO-9024 more cRIO-9112 chassis and modules.

    I would like to save the data measured modules in the txt files, but I want to do in a period of time to time desire. For example, I want to save data of measurements of 60 seconds and repeat every one hour. I of the project (in the file attachment vi) and normally it works fine but I noticed that the recording of the data is not correct. I mean it seams to save what was in the memory before. That's the problem with Windows XP I have check with another computer with Vista and it seems to be ok. It seems that on XP the buffer (refnum?)  is not clear and it retains the previous values.

    Can someone explain to me why it happened and how I can obey Windows XP? Or maybe there are techniques to clear the memory buffer/refnum for rescue?

    Thanks for any help.

    Kind regards

    Kamil


  • How to save data in a txt file.

    Does anyone know why the txt file is empty with no content?

    FILE * f = fopen ("/ shared/documents/save.dat", "w");
    {if(f==null)}
    fprintf (stderr, "Failed to create output. txt\n");
    _exit(2) (1);
    }
    fprintf (f, "Hello World");

    File is created, but the file txt empt without 'Hello World '.

    Ha ha solved.

    fclose (f);

  • How to insert data in the XML file?

    Hi guys,.

    How to insert information into an XML file. I tell you, I have a CFM file with some questions to the user

    When users submit this form within the form information is send in an XML file.

    How can insert this information in the XML file?

    When I don't have a DB?

    Thank you

    Kind regards

    Fabiano Magno Pechibella

    You must

    1. Read in the XML file
    2. Analyze the document in an XML (just one big struct) object
    3. Insert your XML code of the object where you need
    4. rewrite the XML file with your data now included

    You can Google 'ColdFusion working with XML' and find hundreds of items to help you. Here's a beginning tutorial to help you get started:

    Intermediate ColdFusion Tutorials - working with XML

  • IDCS6 MACOSX JS: data merge multiple txt files one after the other

    Hello everyone.

    I have a situation where I have to data merge multiple text files to a single file indesign real "base". Databases formats are the same, the point of difference is a code in the second field of the database that refers to a postal box (not a zip/postal code, a code of 'distribution center' that has possibilities of 56 or greater). I would prefer data merge a file and then somehow split the PDF via Acrobat, but the length of postal areas resulting is incompatible and something that cannot be done if the document "split" feature in acrobat.

    The database starts as one massive file but using a one line code, can be divided into postal areas in separate text files.

    My last question: is it possible data merge several files at the same time (for example one after the other) and to give them their names based on the names of the input text file?

    OLE Kvern had a script to merge the data to a file without the user interface. I changed the last line slightly so that it generates a PDF file based on [high quality]:

    if(app.documents.length != 0){
            var myDocument = app.activeDocument;
            app.dataMergeOptions.removeBlankLines = true;
            //Select a source file.
            var myDataFile = File.openDialog("Select a data file")
            var exported = "file location(redacted for the sake of this post)"
            if(myDataFile != ""){
                    myDocument.dataMergeProperties.selectDataSource(myDataFile,);
                    myDocument.dataMergeProperties.exportFile(exported,"[High Quality Print]",);
            }
    
    }
    

    I guess that the answer has to do with the variable "myDataFile" and rather than just being open a dialog box, it could be somehow by selecting a table of text files, but it is where I am out of my depth.

    Ideas or thoughts which may not involve trying to do both the many mergers, but can somehow revolve around a great fusion of PDF?

    Thank you very much

    Colin

    Since writing my last response, I realized there was a better answer. It is a scenario of Peter Kahrel and a modified version of a script by Olav Kvern. Details can be found here: batch of merge data | Adobe Community

    I have since made other mods to the script is easier to understand:

    if(app.documents.length != 0){
    // make sure to use the document that is open
            var myDoc = app.activeDocument;
    // get the name of the document that is open for future naming purposes
            var myName = myDoc.name
    // get the location of the folder that contains both the indesign files and the text files
            var myLocation = "FULL PATH LOCATION OF FOLDER CONTAINING TEXT FILE AND DESTINATION FOR FINAL PDFS"
    // define the names of the data files to use based upon the names of the indesign files
            var myImport = myLocation + myName + ".txt"
    // define the names of the data merged PDFs to be created
            var myExport = myLocation + myName + ".pdf"
    // the actual engine for the merge, including DM instructions such as remove blank lines, object fitting etc.
            var myDataFile = myImport
            app.dataMergeOptions.removeBlankLines = true;
            if(myDataFile != ""){
                    myDoc.dataMergeProperties.selectDataSource(myDataFile,);
                    myDoc.dataMergeProperties.exportFile(myExport, "[PDF/X-1a:2001]", );
            }
    
    }
    

    If this script will automatically merge a file which is open as LONG as the data file is the same name as the indesign file with .txt at the end for example

    Woodward.indd (indesign file)

    Woodward.indd.txt (used for merging text file)

    This script does still not the original memory and who was using an indesign document, to browse for many text files and merging of PDF based on text files.

    HOWEVER, I am sure that the answer to that is based only on the use of the script above (no need to Peter batch convert script) and changing the line 9 to be a loop for... but again, this is where I come to a grinding halt. Any help would be appreciated.

    Colin

  • Record a continuous flow of data in a txt file?

    Hello world! I'm relatively new to the ICB and I was wondering if I could get help on something. I'm trying to modify a sample file that reads permanently a tension from a daq card. I would like to save this data in a text file, but I am relatively new to the C programming language (I'm a java person) and cannot distinguish the location data. Once I know where the data is, I think that I can write the data using a sort of loop and the fprintf function. Any help would be greatly appreciated. This is the code for the method StartCallBack of the "Cont Acq - Int Clk" file that I use:

    int CVICALLBACK StartCallback(int panel, int control, int event, void *callbackData, int eventData1, int eventData2)
    {
    Int32 error = 0;
    Chan Char [256];
    uInt32 sampsPerChan;
    float64 min, max, rate;
    The int journal;
    char errBuff [2048] = {'\0'};

    If (event == EVENT_COMMIT) {}
    GetCtrlVal (panel, PANEL_CHANNEL, chan);
    GetCtrlVal (Panel, PANEL_MINVAL, &min);)
    GetCtrlVal (Panel, PANEL_MAXVAL, &max);)
    GetCtrlVal (Panel, PANEL_RATE, &rate);)
    GetCtrlVal (panel, PANEL_SAMPSPERCHAN, & sampsPerChan);
    SetCtrlAttribute (panel, PANEL_STRIPCHART, ATTR_XAXIS_GAIN, 1.0/rate);
    Journal = (int) log10 (rate);
    SetCtrlAttribute (panel, PANEL_STRIPCHART, ATTR_XPRECISION, log);
    SetCtrlAttribute (panel, PANEL_STRIPCHART, ATTR_POINTS_PER_SCREEN, sampsPerChan);

    /*********************************************/
    DAQmx Configure Code
    /*********************************************/
    SetWaitCursor (1);
    DAQmxErrChk (DAQmxCreateTask("",&gTaskHandle));
    DAQmxErrChk (DAQmxCreateAIVoltageChan(gTaskHandle,chan,"",DAQmx_Val_Cfg_Default,min,max,DAQmx_Val_Volts,));
    DAQmxErrChk (DAQmxCfgSampClkTiming (gTaskHandle",", rate, DAQmx_Val_Rising, DAQmx_Val_ContSamps, sampsPerChan));
    DAQmxErrChk (DAQmxGetTaskAttribute (gTaskHandle, DAQmx_Task_NumChans, & gNumChannels));

    If ((gData =(float64*) malloc (sampsPerChan * gNumChannels * sizeof (float64))) == NULL) {}
    MessagePopup ("error", "not enough memory");
    GoTo error;
    }

    DAQmxErrChk (DAQmxRegisterEveryNSamplesEvent(gTaskHandle,DAQmx_Val_Acquired_Into_Buffer,sampsPerChan,0,EveryNCallback,));
    DAQmxErrChk (DAQmxRegisterDoneEvent(gTaskHandle,0,DoneCallback,));

    /*********************************************/
    Starting code DAQmx
    /*********************************************/
    DAQmxErrChk (DAQmxStartTask (gTaskHandle));

    SetCtrlAttribute (panel, PANEL_STRIPCHART, ATTR_NUM_TRACES, gNumChannels);
    SetCtrlAttribute(panel,PANEL_START,ATTR_DIMMED,1);
    }

    Error:
    SetWaitCursor (0);
    If {(DAQmxFailed (error))
    DAQmxGetExtendedErrorInfo (errBuff, 2048);
    If (gTaskHandle! = 0) {}
    /*********************************************/
    Stop DAQmx code
    /*********************************************/
    DAQmxStopTask (gTaskHandle);
    DAQmxClearTask (gTaskHandle);
    gTaskHandle = 0;
    If (gData) {}
    Free (gData);
    gData = NULL;
    }
    SetCtrlAttribute(panel,PANEL_START,ATTR_DIMMED,0);
    }
    MessagePopup ("DAQmx Error", errBuff);
    }
    return 0;
    }

    Hello supercharizard,

    It comes to the appropriate line in the code that you posted that can lead you to "where the data is.

    DAQmxErrChk (DAQmxRegisterEveryNSamplesEvent(gTaskHandle,DAQmx_Val_Acquired_Into_Buffer,sampsPerChan,0,EveryNCallback,NULL));
    

    DAQmxRegisterEveryNSamplesEvent function establishes a callback as a routine function that will be called when at least a predefined amount of data is acquired. The part highlighted in the line is the reminder issued on this event, that you can study and modify the data adding streaming.

    This knowledge base entry gives a brief explanation of the events available. There are many other resources on DAQmx works as well in Help and online on this site that you should carefully study to better understand data acquisition.

    Regarding the release, there are several ways to do: here are two examples that produce a binary file (more fast, but you will need to write code to read data back) or add it to an ASCII file aligned in columns (slower but readable with a text editor, which is no code needed to read the data back). Another alternative is to make use of TDM stream on the disk library: this last resource is notably more complicated then I suggest you approach after some more practice on the fundamentals.

  • Export form data to txt file

    I have created a form in LiveCycle. I need to have the data exported to a txt file. Previously, I've created a form in Word and it imported in LC. If this form has been filled out in Adobe and saved, I was able to export the data in a txt file. The form I'm working on now that I created in LC (instead of Word). When I fill the form in Adobe, save and then choose export to txt file, no data export. I have attached two forms: one that works (Unit_5_Preparate) and one that does not (assessment_template_test).

    Thank you!

    Hello

    It was a learning experience (no pun intended).

    If the LC Designer form is saved as 'static' then you will be able to export the data to a text file. If the form is saved as 'dynamic' then you won't be able to export to text file.

    See the file saved as static.

    Good luck

    Niall

  • Can LabVIEW open a *.txt file in Notepad?

    I'm logging data in a *.txt file when running a LabVIEW VI.  When the user presses the "Exit" button, I want a dialogue window for display and ask the user if he or she wants to open the data *.txt file using MS Notepad.  Is this possible?  If so, how.  I read an old thread (2005) which refers to "systemexec.vi" as a way to do it, but I can't find that VI in my examples.

    I'm using LabVIEW 2009.

    Thank you very much.

    It does not contain a virus. Anti-virus for your business needs its signatures corrected.

  • Write in a txt file to variable rate

    Hello

    I asked who need slower (100 Hz) datalogging initially and then to increase the rate of datalogging high (10 KHz) after some time.

    I've tried integrating variable data acquisition rates but not success. I also tried to maintain the rate of acquisition of data contant, but write a txt file at different rates.

    Now, without success, I am now trying to write two txt file with low and high rates.

    I would be very apprecaite, if anyone can direct me to correct logic for the task.

    Below you can find the test example VI that I'm trying to implement the requested feature. This VI to write data in a txt file with timestamp corresponding to rates of acquisition of data in the first column.

    Thanks in advance.


  • Edit/Read the .txt file Variables

    Hello world

    I'm new to Flash so it's maybe a silly question but I wonder how I can save the data to a .txt file. This .txt file will be stored on the same server that the flash file is stored on and runs. I will, eventually, be able to access the data previously stored on the my flash movie .txt file.

    Any AS3 for this?

    You must use the script on the server side (PHP, etc.) in order to be able to write/record files.  Here is a link that might help you get started...

    http://www.Flash-DB.com/tutorials/savingAS3/savingData.php?page=2

  • Location of the text (txt) file

    Hello world

    For some reason if I try to import data from a txt file in a folder on the same location as my video file it does not work:

    on startMovie()
      importFileInto(member "Contact", the applicationpath&"Documents\Contact.txt")
    end
    

    But if I move the txt file, next to my movie and change the jargon for:

    on startMovie()
      importFileInto(member "Contact", the applicationpath&"Contact.txt")
    end
    
    

    It does not work...

    I add this jargon to a film script.

    Any ideas?

    Thank you in advance...

    Rafa.

    you might want to use "the moviePath" instead of "applicationPath.  When you are in design mode, applicationPath will point to the executable Director, not your dir file.

  • How to insert the data from the table file?

    I need to know that how can I insert data into multiple columns by file. I can simply insert data into a table of columns, but could not find a way to put the data in the column all.

    My data in a file store
    ************************************************text.txt***************
    133, nanny, nagina, 14 mph, 45637, 9156729863

    **************************************************************my_data(table)**********
    try to insert into table below...

    Name, ID, last_name, add, PIN. Mob

    *********************************************

    Let me know if you need anything else... :))

    Hey nanny.

    In fact, in SQL Developer, you can open a connection to the target schema, right-click on the Tables node in the Navigator tree, select import the data, then use the data import wizard. It is extremely flexible. Looks like you have a file of comma-separated variables, so if you select Format: csv and import method: Insert it will probably work fine.

    To minimize the risk of errors during import, choose a limit value of preview so that the wizard can review the data type and the size of all columns in several lines of data as possible, and then examine the size/type of data for each column on the next page of the wizard and replace if necessary. For date columns, it is also important to choose the appropriate format mask.

    Hope this helps,
    Gary
    SQL development team

Maybe you are looking for

  • cannot open firefox; Profile showed lock-uninstalled and reinstalled, still cannot access

    Years, I used Firefox-suddlenly it won't open (can access the site with another browser). After spending hours reading forums, autonomies, etc. that I tried to look at the profile and he had a parental.lock shown in this topic. I am the administrator

  • Characters: Leaving color like that tab

    I gave everything in the nagging incessant and updated upgraded to Firefox 12 (from 3.6). Now I am trying make the appearance exactly how I like it. I have used Personas to get rid of the transparency effect and found a color that I liked: the proble

  • Replacement card mother M30X

    HelloMy M30X starts only if I apply a force to the motherboard near the power plug, then turn off if I release (soon it will be even that more since I was less and less luck with that). Seems to be a general flaw in the design of boards as many users

  • How to change step.result.status

    Hello I know just how I can configure the result step to something else state that "passed" or "failed". I know that I've done it before, but now I can't get this to work. Simple sequence attached file to demonstrate what I'm trying. Report as text i

  • Ports open VPN concentrator

    I'm running the port scan (Angry IP Scanner) against VPN concentrator. Sometimes it shows the port as open 21. I have disabled ftp under "Management protocols" sometimes it shows the port 389 & 1002 as open. What wrong with my VPN concentrator? I act