Add using a Structure

I need to run an append query by using a structure to pass in one of my fields of data. Is not a difficult thing to do normally, but that's a little unusual. I'm basically migration around 1.5 million records in a single table in a relational database data dump.

The first query gets all the NUMBERS of CASE unique from the receipt of data and places them in a table called Box_Details. Then I go and get the values of the primary key (PK) for all the unique boxes just to add to the table. I store the PK and the box number in a structure called box_Struct.

Now comes the hardest part. I have to run another query of data even discharge and I need to replace the Box_Number field with the appropriate value contained in the box_Struct structure. The last query, called AddItem, shows what I'm trying to do. Basically, I need to pass the value of the query SELECT, which runs inside the query (INSERT INTO) add to the structure of box_Struct so I can use the Box_ID as my foreign key in the table item_description. I know how I shoot everything in CF, but I don't feel more like 1.5 million records in a loop so I need a better way to make this substitution. Any ideas on how I can make this substitution inside the query work?


< CFQUERY NAME = "AddBoxDetail" DATASOURCE = "#Request.DSN_RW #" >
INSERT INTO box_detail (trans_id, uval_trans_id, agency_id, box_type, box_number, box_desc, box_begin_date, box_end_date, stype_id, vault_loc, barcode, RotFreqCnt, Box_Date_In)
SELECT DISTINCT #GetMax.MyMax # AS trans_id, 0 AS uval_trans_id agency_id, box_type, box_number, box_desc, box_begin_date, box_end_date, stype_id, vault_loc, barcode, 1 AS RotFreqCnt, Box_Date_In
OF ImportRITSData
< / CFQUERY >

<!--> get the pharmacokinetics of records comes to be added
< CFQUERY NAME = "GetBoxID" DATASOURCE = "#Request.DSN_RW #" >
SELECT box_id, box_number
OF box_detail
WHERE box_number IN (Select DISTINCT box_number OF ImportRITSData)
< / CFQUERY >

< CFSET box_Struct = StructNew() >
< CFOUTPUT QUERY = "GetBoxID" > < CFSET box_Struct ["#box_number #" ""] = box_id > < / CFOUTPUT >

< CFQUERY NAME = "AddItem" DATASOURCE = "#Request.DSN_RW #" >
INSERT INTO item_description (item_type, item_number, box_id, form_number, years_inclusive, retent_reqmt, description)
SELECT item_type, item_number, box_number, #box_Struct [box_number] # AS box_id, form_number, years_inclusive, retent_reqmt, description
OF ImportRITSData
< / CFQUERY >

Thanks in advance for the help!
Have a day Ordianry...
KomputerMan ~ |  :-)

One issue is that in your final request, input values do not match, you have 7 fields but 8 values

So, assuming your version value struct is the additional value, and assuming that the box_number is a single value, you should be able to do this...

INSERT
IN item_description
(
item_type,
item_number,
box_id,
form_number,
years_inclusive,
retent_reqmt,
Description
)
SELECT item_type,
item_number,
(select b.box_id from box_detail b where ird.box_number = b.box_number) AS box_id,.
form_number,
years_inclusive,
retent_reqmt,
Description
OF ird ImportRITSData

Tags: ColdFusion

Similar Questions

  • by using a structure of the event to restore a Boolean control with change in value for the menu ring

    I'm trying to get two Boolean buttons to reset when the value of a ring menu.  For this I use a structure of event defined to execute with a ring value change.  However I have another code that should be run while the structure of the event expected to change value.  I place my structure of the event inside the while loop buttons reset as expected but my other code is not run (except when the value of change). If I place it outside the loop the rest of functions code as expected, but the buttons do not reset.  Any help you offer is much appreciated.

    Hello

    ADD TIME OUT EVEN AND GIVE DELAY OF 100 MS.

    Adds the case-application-timeout event

  • Passing values between tabs, using a structure of housing.

    At the risk of exposing my ignorance, I have a problem of substance; How to pass values in a controlled tab structure of the case.

    I have a simple user interface that uses a control tab control container a structure of all cases wrapped in a while loop. I use

    LabVIEW 2012.

    The basic intent is to run VI in tab 1, whose results would be available for the VI tab 2 ect...

    (See the attached example; an experience I wish that changes to the controls to page 1 int & string will appear

    the indicators corresponding to page 2).

    I can "pass" the values of a case outside the case itself (through a tunnel of output) structure, but can't seem to do

    available for all other cases by a tunnel entrance.

    I tried to tunnel of the case in a registry to lag on the while loop, but am upset by retrieving that data again in another case.

    I tried to use local variables, but obviously do not understand the paradigm brought LabVIEW for variables. I can create a local

    variable but can't seem to 'plug in' to an indicator on the second page.

    First question: is a reasonable method for execution of the loop control program structure business controlled within a certain time tab?

    I chose it because I have literally dozens of parameters to define, validate and want to manage Visual space

    for the operator. For example, I would that this sequence:

    1. Question and list of facilities available on my PC
    2. Select a device to use, make sure it works properly
    3. Set the parameters for this particular device (30)
    4. run the device, collect data and save the results

    Second question: it is clear that I don't know how to use variables, and the examples I read involve transmission of data to parallel structures

    and not in a case. Is a local variable to a reasonable method of transmission of data between the "tabs"? I will gladly make

    accept the reprimand to 'RTFM' until 'FM' required is identified.

    Thank you in advance for your kind attention to my wisely first year survey

    Shift registers are simple to get data from.  Where is your problem with their use?  However, have you considered just using the terminals directly in the case of the Page 2?

    You must learn to use the Structure of the event.  You shouldn't care what tab you are on.  It's all in the same VI.  Therefore use a Structure unique event for all your control value changes.

  • change of the indicator with time using the structure of the event

    Hi all

    I use a structure within the meaning of the event to change the State of an indicator. At this point, I was wondering is there a way I can monitor this change of State in a time interval?

    Which means that how I can raise the event only when the state change is long enough (for example 5 seconds), if there is a change of State, but the State eventually back to normal (less than 5 seconds), the event is not triggered.

    Thank you and hope someone can give me some advice on how to do this?

    Sorry for this reading does not completely. Here's a version that works and not stuck to wait.

  • can I use a structure of the event in another structure of the event

    Hello

    Can use a structure of the event in another structure of the event?

    Thank you

    Viviane

    I would put your waveforms in the registers at offset.  You can then use your structure for the main event to trigger on the Show 1... the value change events and process the data, however you need from there.

  • How to use a structure of the event in a Subvi

    I am using a structure of the event within a Subvi.  The Subvi has a table constructor that built tables and the structure of the event is used so that when the program runs, it allows you to change the elements of the array.  It works, but when I apply within a Subvi, it does not work properly.  This goes into a Subvi, because it will be part of a much larger progrram, so it must be modular.

    If you are using a structure of the event, it is not a Subvi.  If you worry about modularity, you should not use the structure of the event.

    You seem to have a fundamental misunderstanding of modularity.  An event structure must be placed in a while loop.  If you have a while loop in a Subvi, you have transferred control of your program to the Subvi.  You are not at this stage modular.  Your higher level GUI has no control.  You would have to create a stupid system of variables to pass data down to the loop to stop the loop and return to your main VI.  This is not a good design decision.

    Instead of searching for a way to make something broken, you should spend effort trying to understand what you really want to accomplish.  You should also spend some time to learn how to work the event structures.

    This application is small at the moment and it is already on the way to the unreadable.  It's a terrible thing to do for you.  Break these habits now.  variables are only when absolutely necessary.  Using subVIs to accomplish individual tasks, do not run the entire application.  With the structures of the event, use a value of stop button change event for will not be held hostage to the time-out.  If your variable is '2' in it, you're doing something wrong.  It has to be something different between set points, put it in the name.  If you want to make the subVIs, create an icon.

    But first and foremost, invest time in understanding dataflow

  • How do I step manually in code that uses a structure of the event, when I want to select a particular event?

    I use an architecture of producer/consumer for an application with a structure of the event in the upper loop. Events are triggered by the user from the control panel using Boolean switches that are "change when you press on" and "release switch. My question is how can I manually step through the code using various events? It doesn't matter what I'm still not in the same event.

    Thank you.

    You can view the code? Is what event still enter? I did have problems step by step in code that uses a structure of the event. You must be patient, but because the application is slowed down a bit and it can take a while to get into the case of the specific event depending on what events you deal. Usually, I place a breakpoint in the case I am interested and run the application as usual. Once I hit the breakpoint is when I turn on highlighting of execution.

  • How to use the structure of the event to sort the listbox data?

    I have a VI that contains two list boxes.  The two list boxes are selectable by the user.  This is how I want to interact.

    When the VI is initialized, the first list box will be filled with data.  If the user double clicks on a cell in the first list box, the second list box will be filled by a sorting of the information contained in the first list box a certain way.  I do not think that the details of how these data are sorted is pertainent here...  Then I want the user to be able to double-click on one of the lines in the second list box.  The double of the item clicked in the second list box will be used in an another VI which will then start.

    I have my VI of work such that the first list box will fill the second list box whenever the user double clicks on a cell in the first list box.  To do this I use a structure of the event.  Here is where the trouble begins.  I have a second structure of the event look for double clicks in the second list box, but when I do this, the program crashes.  In addition, I want only the user to be able to double-click on the second list box, if the first list box has already been double-clicked.

    Generally, my question really revolves around the use of the structures of the event in this application?  Can I use two structures of event at the same time?  Is there a better way to do it?

    No, you probably should not use two structures of different events. One, it should work fine.

    The Subvi immediately execute and return? If not and you have the front locked until the event finishes, which would explain what you see.

  • Add using Motorola?

    Is it possible to add using Motorola? There is no drive, meeting and sleeping. It would be great add more items as cooking/Yardwork. Hands can be in the juice of chicken or the mud and you can't get that on phone, but an important call you've been waiting on sounds and you can reply by voice.

    With so many ask this expansion of attribution approach Punit Soni meeting today, I was pleased to hear that the team strives to develop all this. Once it is ready it will require only an update to the application of the Bank and not an OTA update.

  • Y at - it an option to 'Add used gradients "?

    Quick question: in the Swatches palette, it is possible to 'Add used colors' imported art. Is there also an option for "Add gradients used" in the palette as well? If this is not the case, this feature could be added to any future upgrade? It would be very convenient ;-)

    Try the script of Wolfgang:

    WR-usedColors [Illustrator Praxis]

    It should work if you delete or change the version 112 online check in CS6.

  • Error when loading an XML document using a structured application

    Hello

    I try to load an XML document using a structured application defined in the default structapps.fm

    My code is shown, extracted from the sample code API FDK.

    Problem, I still got the same message:

    "Cannot find the file named e:\xml\AdobeFrameMaker10\file. Make sure that the file exists. "

    Where "e:\xml\AdobeFrameMaker10\" is my installation directory.

    So I guess that govern trying to find the structapps.fm file but can't find it.

    What else can we?

    Does anyone known how elements achieve this simple task using extendScript?

    Thanks for all comments, Pierre

    function openXMLFile (myLastFile) {}

    var filename = myLastFile.openDlg ("XML file choose...", "*.xml", false);

    If (filename! = null) {}

    / * Default Get open the properties. Back so it can not be affected. */

    var params = GetOpenDefaultParams();

    / * Set properties to open an XML document * /.

    / * Specify XML as the type of file to open * /.

    var i = GetPropIndex (params, Constants.FS_OpenAsType)

    params [i].propVal.ival = Constants.FV_TYPE_XML;

    / * Specify the XML application to use when opening the text.

    I have = GetPropIndex (params, Constants.FS_StructuredOpenApplication)

    params [i].propVal.sval = "myApp";

    I have = GetPropIndex (params, Constants.FS_FileIsOldVersion)

    params [i].propVal.ival = Constants.FV_DoOK

    I have = GetPropIndex (params, Constants.FS_FontNotFoundInDoc)

    params [i].propVal.ival = Constants.FV_DoOK

    I have = GetPropIndex (params, Constants.FS_FileIsInUse)

    params [i].propVal.ival = Constants.FV_DoCancel

    I have = GetPropIndex (params, Constants.FS_AlertUserAboutFailure)

    params [i].propVal.ival = Constants.FV_DoCancel

    / * The file structapps.fm that contains the specified app must have

    already been read. The default structapps.fm file is read when FrameMaker is

    open so this shouldn't be a problem if the application to use is

    listed in the structapps.fm fichier.*.

    var retParm = new PropVals()

    var fileObj = Open (filename, params, retParm);

    return fileObj

    } else {}

    Returns a null value.

    }

    }

    Stone,

    According to the "myLastFile" object, the method openDlg may not yet exist (if the myLastFile object is not an object file, for example). And I do not see the myLastFile be necessary anyway, you present a dialog box to select a file to open. I recommend to use the global method of ChooseFile () instead. This will give you a file name as string in the notation of full path, or null if no file has been selected in the dialog box. I'm not sure of what your States of the return value for ChooseFile ExtendScript documentation, but if that differs from what I tell you here, won't the documentation. For example, if you change the first lines of your code by the following it should work:

    function () {} openXMLFile

    var filename = ChooseFile ('choose XML file... ("," ","*.xml", Constants.FV_ChooseSelect);

    While writing this, I see that Russ already gave you the same advice. Use the value of symbolic constant, I stated to use the ChooseFile dialog box to select a single file (it can also be used to select a directory or open a file - but you want control you the logon process). Note that this method allows you to define a directory for the dialog (second parameter). The ESTK autocompletion also gives you a fifth parameter "helplink" who is undocumented and may be ignored.

    Good luck

    Jang

  • Add used colors (PMS)

    I would like to delete all the nuances in my Swatches palette so I find myself with no color chart (from own). This way when I create illustrations using colors PMS (color chart), I can add later, and then in the Swatches palette, I will have only the PMS colors and CMYK colors used in the document.

    However, and I do not remember what happens before, but now when I "Add used color chart", all PMS colors appear in the Swatches palette, but appear as process colors, represented by CMYK values in the color palette. I used to do (add used shades) and when they were added, they appear as a spot color in the palette of Swatch and read as 'Pantone xyz' in the color palette.

    I don't want the PMS colors to add as tones of PMS, cmyk process...

    Illustrator CS 5 (15.0.2) using MBP 10.6.8.


    Thank you.

    PANTONE solid colors are tones when you add in the book of colors, but the moment you delete them in order to 'clean up' the file, you convert spot colors to process. Of course Illustrator is unclear to them as Pantone colors.

    If you want to "clean up" your file, why not just use the command "select not used" in the Panel menu?

  • Possible to use FrameMaker structured as an XML editor?

    This may sound strange, but I need an XML editor and I have 9 FM. I was wondering if I can use FM structured as my editor and if so, how to configure that?

    I don't have much experience with or any of the foregoing. I am familiar with IDEs and source code control.

    It is possible, but I wouldn't recommend it. FrameMaker is essentially an application of PAO and a good choice if you need output PDF high quality as well as XML. But what if all you want is an XML Editor, you'd be better off with an XML Editor :-)

    -Michael

  • using the structure of the event in the LabVIEW classes

    Hello

    I'm new in the use of LabVIEW classes, so don't know much how I can use them.

    In my main program, I have clusters with five elements in each. The elements are controls two States and in some groups, there are three States controls. The user will press the buttons (controls), and different things will happen. In my first program were I not using classes, I had a structure of the event and the controls were cases of event in the structure.

    Is it possible to somehow use an event of cases in one of the methods that is created in the classes, so that say, that's not in the main program?

    I have attached two photos: I wanted to have a structure of the event in servoTouchEvent (in left.tri.lvclass) who is a child.

    Let me know if my explanation is not clear.

    Grateful for the help!

    Hello

    Yes, you can have a structure of the event in a Subvi rather in your main VI of top-level UI. The trick is to use the 'Save for events' and passing in references to orders that you want to have the event trigger structure for. The refnum output since the function is entered in the terminal of dynamic event of the structure of the event who could live in a Subvi. You can add instances of event where you will see these control events as dynamic events then you can do something with. These excerpts from shows all the code in a simple diagram, but the stuff in the structure of disable diagram could easily transformed into a Subvi:

     

    All this can be done without classes. What will buy classes you include the ability to encapsulate your screws and also perform different code based on what object on the hierarchy of the parent-child classes is on a wire. If the behavior of your code is different between 2-3 State and controls (which I do not know what state controls 3 you are referring), you can take advantage of the classes.

  • A comparison to run using a structure case

    Hello

    I'm writing a simple program, but I can't seem to understand how to write it.

    I have a dynamic series of data (about 16 000 values) running inside a while loop.

    I want to add 180 a value if that value is less than 30.

    My idea was to:

    1 make a comparison: 'x '.< 30"="" to="" get="" a="" true="" or="" false="">

    2 send the Boolean value and allow to use a case structure to tell if it is real

    2. then, if it is 'real' x = x + 180, if 'false' x = x (just pass directly through the structure of the case)

    However, he always adds 180 to the value.

    Help, please!

    Thanks, Jake

    Hello

    If my uderstanding is correct, this should help you... Please see the image as an attachment...

    Accept as sollution if solved the problem...

    Thank you

    Yogesh

Maybe you are looking for

  • multiple signals in a single diagram

    Hi all I have a problem with a vi that I created, in this vi I need to draw two signals in a single diagram. These signals will eventually come from external resources. The graph displays only a signal, and this signal is not displayed correctly. I c

  • Windows 7 Bluetooth audio problems

    I bought a Sony SRS - XB2 Bluetooth speaker in the USA. I'm trying to use it to listen to music from my computer laptop runing windows 7. The speker is recognized but you are asked to install the drivers and when I access Sony supports, they say, tha

  • No update. More than an hour from the record.

    Hiya, Just thought I'd make a new thread, rather than repost under the thread previously 'resolved '. I recorded 2 hours ago and still did not have the possibility to update. For any help or advice, Bravo FC

  • How to manually add metadata, including the correct number of tracks on windows media player?

    I have an album that is automatically assigned incorrect metadata. I used the Edit option in find info for changing the metadata previously however, in these cases, the exact number of securities is applied to the album, and a simple surgravage of th

  • Hey there, I have a problem.

    I just decided yesterday to buy the 'photographers-pack' with the ps and lr.But so far there is no order in my profile.Why and how can I change this?SRY for my bad English I m, of the Germany.