Home » U++ Library support » U++ SQL » SQL - option for real case of column/table/database names
SQL - option for real case of column/table/database names [message #57936] |
Wed, 29 December 2021 11:04  |
mezise
Messages: 54 Registered: April 2006
|
Member |
|
|
Hi,
I decided to write database management app in Upp but the requirement is to have real case names of columns, tables and databases.
Subject of not forced uppercase names in SQL was already mentioned in several posts but without any action for implementation.
Easy way to implement this is to add global option to SQL session.
Mirek, can you suggest the name for that option, where and how it should be assigned and accessed following your coding standards.
Thanks,
Michael
[Updated on: Wed, 29 December 2021 12:17] Report message to a moderator
|
|
|
Re: SQL - option for real case of column/table/database names [message #57937 is a reply to message #57936] |
Wed, 29 December 2021 21:47   |
mezise
Messages: 54 Registered: April 2006
|
Member |
|
|
Guys, could you apply those changes?
Example usage:
MySqlSession session;
session.UseRealcase();
Diff:
diff -r old_ver15947/uppsrc/Sql/Sql.cpp new/uppsrc/Sql/Sql.cpp
151,152c151,153
< for(int i = 0; i < cn->info.GetCount(); i++)
< cn->info[i].name = ToUpper(cn->info[i].name);
---
> if(!session.IsUseRealcase())
> for(int i = 0; i < cn->info.GetCount(); i++)
> cn->info[i].name = ToUpper(cn->info[i].name);
347c348,349
< s = ToUpper(s);
---
> if(!GetSession().IsUseRealcase())
> s = ToUpper(s);
364c366,367
< s = ToUpper(s);
---
> if(!GetSession().IsUseRealcase())
> s = ToUpper(s);
diff -r old_ver15947/uppsrc/Sql/Sqls.h new/uppsrc/Sql/Sqls.h
320a321
> bool use_realcase = false;
376a378,379
> bool IsUseRealcase() const { return use_realcase; }
> void UseRealcase() { use_realcase = true; }
[Updated on: Thu, 30 December 2021 14:41] Report message to a moderator
|
|
|
|
|
Goto Forum:
Current Time: Mon Apr 28 18:14:00 CEST 2025
Total time taken to generate the page: 0.02224 seconds
|