on 2010 Aug 14 7:08 PM
There's no doubt OPENSTRING is really cool... but how do I preserve the input row/line number ordering?
With LOAD TABLE, this technique works:
DECLARE LOCAL TEMPORARY TABLE raw_text ( line_number BIGINT NOT NULL DEFAULT AUTOINCREMENT PRIMARY KEY CLUSTERED, line_text LONG VARCHAR NOT NULL DEFAULT '' ) NOT TRANSACTIONAL; LOAD TABLE raw_text ( line_text ) USING VALUE @whatever DEFAULTS ON DELIMITED BY '' ESCAPES OFF HEXADECIMAL OFF QUOTES OFF STRIP OFF;
Request clarification before answering.
select rowid( tab ), * from openstring( VALUE @whatever ) WITH( ...schema... ) tab
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
39 | |
15 | |
9 | |
7 | |
5 | |
5 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.