Code for creating a table in SQL from external source

I'm looking to create a table in SQL using data from the as/400. I need some code that extracts it from as/400 using odbc and I need it to loop and create that table every minute.
The file its retrieving is a live file but not very large.. I need to basically poll the data. Does anyone have code for something like this..

Posted On: Friday 26th of October 2012 12:02:37 AM Total Views:  459
View Complete with Replies

Related Messages:

add checkbox column to access table (was "SQL query help.., please, any one??")   (381 Views)
good people of this forum.. I am working on an eccess db, and using asp to update, change and so on... I want to add dynamicly a field to the db, using the ALTER TABLE command, but for some reson I can't find a way to make it work, the field type I am trying to add is boolean, and I want it to show up in the actual db as a checkbox, and not as a bit field (0/1), so I've been trying this and non of them work, and I couldn't find any sites with examples for this... any help would be very appricated..., this is what I've tryed so far and didn't work: "ALTER TABLE [Users] ADD [CHILD] boolean" "ALTER TABLE [Users] ADD [CHILD] boolean False" "ALTER TABLE [Users] ADD [CHILD] boolean(f)" "ALTER TABLE [Users] ADD [CHILD] boolean f" me out on this
table Self-joins with updates   (445 Views)
table = PEOPLE Name Money Type ----- ----- ---- Steve 400 R Steve 100 R Paul 500 R Paul 100 R Matt 500 R Matt 200 R Matt 0 T Steve 0 T Paul 0 T I'm trying to add-up all of the Money values for each Name and store them into their names, but under Type 'T'. after the update command it should look like this Name Money Type ----- ----- ---- Steve 400 R Steve 100 R Paul 500 R Paul 100 R Matt 500 R Matt 200 R Matt 700 T Steve 500 T Paul 600 T
Trying to pull data from 2 tables into a query   (473 Views)
I'm trying to create a SQL query to pull together a job info table and a customer info table in an Access DB. We can't have a unique ID on the customer that we can store in the job table because the customer info is dumped from Exchange and the ID (row number) in the cust_List table will change each time we export from Exchange. What I need to do is go through jobs, get the CO_ID, the CONTACT_LN and the CONTACT_FN and then match it against Customer_List>Account, Lastname, Firstname. Any ideas
Checking duplicate values two tables   (545 Views)
Hi , Is it possible in SQL to Restrict value in one table checking a value on anather tables. Scenerio-1. I have two table let say, Teb1 and Teb2. Teb1 has a column called- Business_type and Teb2 has a coulmn called Incorporated_date. I just need to restrict If the value of Business_type column in Teb1 is "Propritory" then Incorporated_date in Teb2 should not be blank (nulll) . Otherwise it can take null value. Scenerio -2.[/B] I have table called [B]SIC. This table has a two column called SIC1 anc SIC2 . Is it possible to restrict that clumn SIC1 and SIC2 should have same values( duplicate values cannot be entered in both columns. Please Advise. Vijay
Converting a SQL table into Text file   (513 Views)
How to convert a SQL table into Text file I have a table and I want to extract the values with the field names above to a text file. The query should also allow me to define the starting position of the fields in the text file. email:
Copying data from one table to another table   (391 Views)
I need to copy data from one table into another table. The field names are NOT the same: I need to INSERT Table 1 fields: cdescurl cname cdescription cimageurl category cprice INTO Table 2: product_url name description image_url category price How do I do this Thank you in advance for any help you can give me!
copy table to different server   (426 Views)
i need a script that can copy a table from a db on one server to another for me, but i have no idea how.. help much appreciated !
aggregates from two unrelated tables   (546 Views)
Hi I have similar problem and i explained in detail here Pls help me to fix this sql Regds Bala
Combining info from two tables?   (540 Views)
, I'm having some problems trying to access two tables in a SQL database at the same time and making some results out of them. Let me explain further: the first table has some information in that I'm going to be doing a select query on and reading out, but one of the columns in this table is a set of codes, the second table contains the codes in one column and their meanings in the other. So I want to bring back the information from the first table and then select the information for the codes shown from the second table and print their meanings alongside the information from the first table. Could anyone help me out in figuring out how my SQL in the ASP page for this would be written Sorry if this is a little confusing but im having a hard time visualising how to do this.
Help with MS SQL Server - updating data from 2 tables   (424 Views)
Hi all, Please forgive me, but I'm new to MS SQL Server and I have few questions. First of all I'd like to know if there is a way to update one table with the data from another. Let's say I have 2 tables. TableA table contains the voucher numbers; TableB table contains the image numbers. Is there a way to merge Voucher numbers from TableA table to Image numbers in TableB table if we assume that there is a primary key Voucher Number in both tables If yes- what would be the query structure for that Please forgive me if you think that this question is silly, I have to say I'm not just new to SQL I'm VERY new to it Thank you in advance.
problem w/ linked table permissions   (409 Views)
This question involves SQL server as well as Access, so I hope that someone can follow. I'm trying to give someone read and write access to a table in SQL server through a linked table scenario in Access. I set up a new user account with datareader and datawriter permissions and made sure it went into the particular table as well. I also re-created the DSN on the user's local machine using this new login information. However, each time you open up the table after logging in using this info and try to edit a field, it gives a "Write Conflict" error and gives three choices: Save Changes, Copy to Clipboard, Drop Changes and of course, Save Changes is disabled. We also tried logging in using the db admin account and it won't work. Anyone have similar experiences with this If so, is there a work-around so that you can edit data through Access
two select statements on one table   (400 Views)
Im trying to perform the following two select statements on the one table. I have been trying innerjoins etc but keep getting errors. The basis of what im trying to do is this. SELECT column1 FROM table1 WHERE column2 = (select column2 from table1 where column3 = 14) Any ideas greatly appreciated.
Open table in Query Analyzer   (383 Views)
In query Analyzer you can right click on a table and select open. When you do it opens the table as if you were in Enterprise Manager(you can edit the data). Does anyone know the syntax of how to write that in a query so you do not have to right click and select open
Classic ASP AddNew record to MsSQL table   (177 Views)
Having trouble with a classic asp page, that gives a HTTP 500 - Internal server error when I try to add a new record to a table. I'm guessing the formatting needs to be changed. It was working fine when I was using in a .mdb database Code: rsTicketReviewUpdate.Open "SNA_Ticket_Reviews", adoCon rsTicketReviewUpdate.AddNew rsTicketReviewUpdate.Fields("MAIN_TICKET_ID") = Request.Form("MainTicketID") rsTicketReviewUpdate.Fields("MTTR_Drivers") = Request.Form("MTTR_Drivers") rsTicketReviewUpdate.Fields("MTTR_Actions") = Request.Form("MTTR_Actions") rsTicketReviewUpdate.Fields("OTR_Drivers") = Request.Form("OTR_Drivers") rsTicketReviewUpdate.Fields("OTR_Actions") = Request.Form("OTR_Actions") rsTicketReviewUpdate.Fields("Misc_Notes") = Request.Form("Misc_Notes") rsTicketReviewUpdate.Fields("AdjRpt") = Request.Form("AdjRpt") rsTicketReviewUpdate.Fields("RptCauseInfo") = Request.Form("RptCauseInfo") rsTicketReviewUpdate.Fields("AdjZ_Location") = Request.Form("AdjZLocation") rsTicketReviewUpdate.Fields("AdjXO_CIRCUIT_ID") = Request.Form("AdjXO_CIRCUIT_ID") rsTicketReviewUpdate.Fields("AdjMTTR") = FormatNumber((Request.Form("AdjMTTR")), 2) rsTicketReviewUpdate.Fields("AdjMTTR_Reason") = Request.Form("AdjMTTR_Reason") rsTicketReviewUpdate.Fields("AdjOTR") = FormatNumber((Request.Form("AdjOTR")), 2) rsTicketReviewUpdate.Fields("AdjOTR_Reason") = Request.Form("AdjOTR_Reason") rsTicketReviewUpdate.Fields("AdjPRIORITY") = Request.Form("AdjPRIORITY") rsTicketReviewUpdate.Fields("AdjPRIORITY_Reason") = Request.Form("AdjPRIORITY_Reason") rsTicketReviewUpdate.Update rsTicketReviewUpdate.Close
Transfer data between two tables in a database   (279 Views)
Hi all, I am using MsSQL 5.0 server database. I need to transfer the data from one table to another within a SQL database based on the particular time interval. Is it possible to transfer data among the tables a database automatically. Please help me.
creating a SQL Query   (226 Views)
Hi friends! I am facing a difficulty in creating a query in SQL. I have a table name as master which has fields ------------------------------------------------------------------ pid | pretailPrice | pourPrice | cat ------------------------------------------------------------------ 1 10 8 1 2 8 7 1 3 7 5 1 ------------------------------------------------------------------ I am trying to create a query, which calculates discount between pretailprice and pourprice and the output should give the maximum discount from all the records for a particular category i.e 1. Please help Thank you.
I need a good tutorial/book to learn creating a secure/concise database.   (267 Views)
, I'm a software developer for a fairly large company, and I've worked with various languages including C#, Java, PowerBuilder and others. However, as a software developer my skills and experience have been limited to such. I'm interested in creating some websites in my spare time in the hopes of making a little passive income on the side. I'm curious if there are any really good tutorials or books out there on how to properly and concisely create databases. As a software developer my knowledge of DB's is extended to submitting DB Mods to our DBA's. The DB Mods I would typically write would be regular DDL stuff; creating tables, adding columns, adding data, creating stored procs, etc. And then of course using DML from the code itself. However, I want to know the things I don't know (I don't even really know what that is... which is why I want a book/tutorial). I'm assuming I'm going to need things like security/roles/access-control/password-encryption/backups/indexing etc etc. What would be a great tutorial-series or book for me. Preferably something that will contain all the information I need and nothing more. I'd hope not to need to read a 1000 page book on only a few topics, or have to buy multiple books. Concise and effective is what I'm looking for here. Maybe something that is about Databases strictly related to web development P.S. I believe I would like to use whatever free service SQL Server offers.
Help with creating procedures   (408 Views)
I have to create 5 procedures and the study material I have dont explaine procedures enough. My 5 procedures are as follows: *sp_ProductInsert - ows the user to add a record to the PRODUCT and PRICE tables. *sp_PriceUpdate - ows the user to change the price of a specified product. The start and end dates (columns) of the price must also be updated. Arguments: ProductID, new price, start date, end date. *sp_DeleteProduct - ows the user to delete a specified product. Records related to the product must be removed from the PRICE table but if the product appears on an invoice that is not more than 60days old, it may not be deleted. Argument: Product ID. *sp_DeleteClient - ows the user to delete a specified client. Argument: ClientID. *sp_displayInvoice - Displays the details and the total cost of a specific invoice. **************************************** Please id appreciate any help!! my tables that I have: CLIENT with id, name, address, tel INVOICE with id, date, clientID PRODUCT with code, description PRICE with productCode, startDate, endDate, price ********* I will also be greatful for extra reading regarding procedures.
Ideas on creating ARchive Table   (325 Views)
I need some ideas on how to archive some of the data that I am capturing in a table. I have this table that has the following columns. KPI ID, KPiNAME, KPITYPE, WEEK1, WEEK2, WEEK3, WEEK4. My table displays last four weeks of data. What I want to do is to create a sub page for this main page where users can go and produce archive reports. Any ideas on how I can archive them to display the report.
need help creating stored procedure   (382 Views)
hi , i nid to create a stored procedure which clears the database every 3 months for example on June 1 [sep 1,dec 1, etc] the stored procedure will delete all records dated b4 june 1. i have browse thru different tutorials on the web and have read abt cursors, but i do not know how to use it. could someone kindly give me a head start thanx