getNasisString.cc [tools/Rusle2SoilsXMLCreator/pg/rusle2_from_ssurgo_build_newbackup] Revision:   Date:
#include <iostream>
#include <string>
#include "libpq-fe.h"

using namespace std;


/*
*
*/
bool
GetNasisString (string& sData, const char* pszNasisName, PGresult* pRS, int row)
{

	int col = PQfnumber(pRS, pszNasisName);

	if( PQfformat(pRS, col) == 0 ){
		sData = PQgetvalue ( pRS, row, col );
		return true;
	}

	return false;
}


/*
*
*/
string 
GetNasisString (const char* pszNasisName, PGresult* pRS, int row )
{

	string sData;
	return GetNasisString(sData, pszNasisName, pRS, row) ? sData : "" ;
	
}