Skip to content

Instantly share code, notes, and snippets.

@alexandruc
Created October 31, 2017 09:50
Show Gist options
  • Save alexandruc/542f39a9f752bb1812a6a6353267d00a to your computer and use it in GitHub Desktop.
Save alexandruc/542f39a9f752bb1812a6a6353267d00a to your computer and use it in GitHub Desktop.
Readable sql string
#include <iostream>
#include <string>
#define SQL(...) #__VA_ARGS__
int main(int argc, char *argv[])
{
std::string strDynSql = "dynparam";
std::string strSql( SQL(
SELECT id
FROM lst_quotes
WHERE route_id = strDynSql
AND lst_request_id = $2
AND quote_id = $3;
));
std::cout << strSql << std::endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment