in reply to Re: parse array to replace specific spaces with pipes
in thread parse array to replace specific spaces with pipes

That was my original plan, but I wasn't able to figure out how to set that in the SQL query. I'll check the docs. Thanks for you help, I sincerely appreciate it.

-Neurotoxx
  • Comment on Re^2: parse array to replace specific spaces with pipes

Replies are listed 'Best First'.
Re^3: parse array to replace specific spaces with pipes
by Bloodnok (Vicar) on Jul 10, 2009 at 23:40 UTC
    The simplest approach is to specify the list of columns concatenated with the '|' character - something like (I can't remember the exact syntax):
    SELECT id + '|' + FirstName + '|' + Surname FROM some_table WHERE ....

    Otherwise, IIRC, you need to issue a set command (to set the column separator) prior to running the query - RTFM for further details.

    A user level that continues to overstate my experience :-))

      I whish I had time to RTFMFM. ;) All the manuals and tutorials work with small array examples and don't seem to teach much about moving data across scalar, arrays, or hashes...or, perhaps I'm reading the wrong books.

      The original sql+ query had a select statement that didn't work through the DBI interface. I think the DBI only uses standard SQL?

      SQL statement SET HEADING OFF SPOOL file.txt SELECT 'NUMBER|FIRST|LAST|ID' FROM DUAL; SELECT EMPLID ||'|'|| FIRST_NAME || '|' || LAST_NAME || '|' || ID FRO +M db.VIEW WHERE (length(AS_UNIV_ID)>1) and (length(EMPLID)=9) and (le +ngth(FIRST_NAME)>1) and (length(LAST_NAME)>1); SPOOL OFF

      Best advise...kis. thx N