From 22415f5ec7d53fbad4818ac31a42d6e623b8afa9 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 10 Sep 2013 14:02:24 +0200 Subject: Provide quoted versions of view statement --- common/view/test.hxx | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'common') diff --git a/common/view/test.hxx b/common/view/test.hxx index e543466..ae30e25 100644 --- a/common/view/test.hxx +++ b/common/view/test.hxx @@ -391,14 +391,22 @@ struct view6b // The same using tables. // -#ifndef ODB_DATABASE_ORACLE -# pragma db view table("t_view_person" = "p") \ - table("t_view_employer_employees" = "ee": "ee.value = p.id") \ - table("t_view_employer" = "e": "\"ee\".\"object_id\" = e.name") -#else -# pragma db view table("t_view_person" = "p") \ +#if defined(ODB_DATABASE_ORACLE) +#pragma db view table("t_view_person" = "p") \ table("t_view_employer_employees" = "ee": "\"ee\".\"value\" = \"p\".\"id\"")\ table("t_view_employer" = "e": "\"ee\".\"object_id\" = \"e\".\"name\"") +#elif defined(ODB_DATABASE_MSSQL) +#pragma db view table("t_view_person" = "p") \ + table("t_view_employer_employees" = "ee": "ee.value = p.id") \ + table("t_view_employer" = "e": "[ee].[object_id] = e.name") +#elif defined(ODB_DATABASE_MYSQL) +#pragma db view table("t_view_person" = "p") \ + table("t_view_employer_employees" = "ee": "ee.value = p.id") \ + table("t_view_employer" = "e": "`ee`.`object_id` = e.name") +#else +#pragma db view table("t_view_person" = "p") \ + table("t_view_employer_employees" = "ee": "ee.value = p.id") \ + table("t_view_employer" = "e": "\"ee\".\"object_id\" = e.name") #endif struct view6c { -- cgit v1.1