0

I have a table in which there is a column called XML of type ntext in that I am storing XML string.

When I read that column with Perl script and print it then whole XML string is not printing.

Instead of printing whole XML it only prints

< T u m o r > < p e r s o n U p i > 1 0 1 0 8 1 0 4 3 5 1 6 0 7 < / p e

Below is the script part.

$get_xml_from_log_table = "SELECT XML FROM TR_MIGRATION_LOG WHERE MRN=123";
$xml_from_log_table = $dbh_sql_server->selectrow_array($get_xml_from_log_table);
print $xml_from_log_table ;

I am using SQL Server database.

Anybody please help me to get rid of this?

thatisvivek
  • 875
  • 1
  • 12
  • 30
  • 1
    What Perl module are you using? That code is wrong for a program using `DBI`. – Borodin Jan 07 '13 at 14:52
  • I am using DBI module. How this can be wrong when I am able to fetch other data. I am facing problem only when I try to fetch the xml string. – thatisvivek Jan 08 '13 at 17:48

1 Answers1

0

That code doesn't look like it will run, so it's difficult to diagnose what the problem is. It does look like you're evaluating selectrow_array to scalar context, which won't help things.

Instead you should use:

my($xml_from_log_table) = $dbh_sql_server->selectrow_array($get_xml_from_log_table);
robert_b_clarke
  • 1,463
  • 10
  • 13