Home » SQL & PL/SQL » SQL & PL/SQL » Advice for procedure (oracle ,10.2,windows95)
Advice for procedure [message #594739] Mon, 02 September 2013 05:23 Go to next message
krajasekhar.v
Messages: 36
Registered: May 2007
Location: bangalore
Member
Hi ,
Below piece of code in my procedure for generating the csv report.
As per DBA character set may change in future ,hence character set conversion write in separate proc/function.

Please advice for below code whether i need to move entire line in separate proc/function or only convert part alone (BOLD) can be moved?.(CONVERT(v_data_line,'WE8MSWIN1252','UTF8')).

I'm not sure whether convert part alone can be move since function return value again again either varchar2 or some other data type.

Please give some solution



 utl_file.put_line(v_csv_file,CONVERT(v_data_line,'WE8MSWIN1252','UTF8'));

[Updated on: Mon, 02 September 2013 05:26]

Report message to a moderator

Re: Advice for procedure [message #594742 is a reply to message #594739] Mon, 02 September 2013 05:44 Go to previous messageGo to next message
Michel Cadot
Messages: 59136
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
If you mean database character set may change then just omit the last parameter of CONVERT, if the data are stored in the database character set.
If you mean destination character set (which is something DBA has not to care about), just take this character set as a parameter of your procedure.

Please specify your question.

Regards
Michel
Re: Advice for procedure [message #594746 is a reply to message #594742] Mon, 02 September 2013 05:58 Go to previous messageGo to next message
krajasekhar.v
Messages: 36
Registered: May 2007
Location: bangalore
Member
Hi,
Here last but one('WE8MSWIN1252') may change .
I think convert will convertthe character set from last one to last but one.
here UTF8 to WE8MSWIN1252.

There is a chance to change in future both(may be UTF16).
Hence How i can write function for entire covert?
Re: Advice for procedure [message #594749 is a reply to message #594746] Mon, 02 September 2013 06:07 Go to previous message
Michel Cadot
Messages: 59136
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
If you mean destination character set (which is something DBA has not to care about), just take this character set as a parameter of your procedure.


And use "CONVERT(v_data_line,<parameter name>,'UTF8')"

Regards
Michel
Previous Topic: simple problem of creating a table inside execute immediate, but can not debug the error
Next Topic: Locking and foreign key indexes
Goto Forum:
  


Current Time: Thu Sep 18 14:52:18 CDT 2014

Total time taken to generate the page: 0.10053 seconds