If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Temporary table question

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-19-06, 01:57
macjoubert macjoubert is offline
Registered User
 
Join Date: Oct 2003
Location: Rhodesia
Posts: 28
Temporary table question

I have this table that is basically a replication of a raw text file which is pipe delimited.

e.g. COLUMN1
A|B|C|D|
A|B|C|D|
A|B|C|D|
...etc.

I now want to create a temp table with new columns A, B, C and D from my raw table.
Can someone pls help?
thanks
Reply With Quote
  #2 (permalink)  
Old 02-19-06, 07:32
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
why would you not use a load utility which would delimit the columns by the pipe character?
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 02-19-06, 07:35
macjoubert macjoubert is offline
Registered User
 
Join Date: Oct 2003
Location: Rhodesia
Posts: 28
Quote:
Originally Posted by r937
why would you not use a load utility which would delimit the columns by the pipe character?
That is because the raw file isnt standard, so I want to be able to import any raw file and by the delimiter assign columns.
e.g. one file might have 1|2|3|4| and another a|b|c

In the first case the temp table will have 4 columns and the second 3.
Reply With Quote
  #4 (permalink)  
Old 02-19-06, 07:38
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
yes, but you can load each raw file into a separate table, yes?
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #5 (permalink)  
Old 02-19-06, 07:40
macjoubert macjoubert is offline
Registered User
 
Join Date: Oct 2003
Location: Rhodesia
Posts: 28
Quote:
Originally Posted by r937
yes, but you can load each raw file into a separate table, yes?
Yes but I dont want to do that.
Im writing 1 procedure for everything and all sorts of files.
1 table for per procedure isnt optimal.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On