Exporting data

2003-12-15 Thread Roberts, Mark (Tulsa)
I have an order taking system where the tables are store in a MySql database. I need 
to develop a select statement to output all new orders to a .csv formatted file.
 
Is this possible to do in MySql. I would try looking this up, however, I am not even 
sure what to look for in the documentation. Any help that I could get to lead me in 
the right direction would be appreciated.  Thanks.
 
Mark Roberts 



SQL Syntax question

2003-08-27 Thread Roberts, Mark (Tulsa)
These are tables that I did not design (and would not have in this fashion), but I 
have to make do with them
 
Table 1 structure:
id_num number,
descr1 varchar(30),
descr2 varchar(30),
descr3 varchr(30)
 
Table 2 structure
id_name varchar(15),
ext_descr varchar(30)
 
Table 2 is a child of table 1 (sort of) id_name in table 2 = id_num from table 1, 
preceeded by zero fill, superceeded by a three digit number (1 - 999).
For example if id_num = 1234567, id_name might be 01234567001 and there might also 
be a 01234567002, etc.
 
I need to produce a query (so that I can do a report) that has the following result:
 
id_num
descr1
descr2
   descr3
ext_descr
ext_descr
ext_descr
...ETC...
 
The bottom line here is that I need to get a select on the id_num in table 1 and all 
corresponding records in table 2. I know I build the first 12 characters of the 
id_name by using the id_num, zero filling and inquiring on substr(id_name,1,12). 
However, I am having a little trouble building the sql statement itself.
 
Any thoughts would be appreciated. Thanks.
 

Mark Roberts 
Sr. Systems Analyst 
Corporate Compliance  Governance Applications