How can I define that the value of a column should always be in UPPER case
Hi,
I want to make sure that the value in a column is always in UPPER case.
Can we give this condition while creating or altering a table.
A trigger can do it easily, but I was wondering if we could define a column to have values with upper case all the time, independent of what values are inserted. I mean if we give a lower case value in the insert statement, it should be converted automatically to upper case & stored.
I want something like
Alter table MY_TABLE Modify ( col1_upper varchar2(25) default UPPER(Col1_upper));
But the above statement does not work as it references the col of the table.
Thanks
Sunil
Well, you can put a check constraint on to prevent someone from putting lowercase data in:
alter table my_table add constraint my_table_check_upper check (col1_upper = upper(col1_upper));However, I know of no way to modify the data being inserted/updated in a table without a trigger.
Richard
Similar Messages
-
Hello. I would like to write async tcp client and server. I wrote this code but a have a problem, when I call the disconnect method on client or stop method on server. I can't identify that the client or the server is no longer connected.
I thought I will get an exception if the client or the server is not available but this is not happening.
private async void Process()
try
while (true)
var data = await this.Receive();
this.NewMessage.SafeInvoke(Encoding.ASCII.GetString(data));
catch (Exception exception)
How can I determine that the client or the server is no longer available?
Server
public class Server
private readonly Dictionary<IPEndPoint, TcpClient> clients = new Dictionary<IPEndPoint, TcpClient>();
private readonly List<CancellationTokenSource> cancellationTokens = new List<CancellationTokenSource>();
private TcpListener tcpListener;
private bool isStarted;
public event Action<string> NewMessage;
public async Task Start(int port)
this.tcpListener = TcpListener.Create(port);
this.tcpListener.Start();
this.isStarted = true;
while (this.isStarted)
var tcpClient = await this.tcpListener.AcceptTcpClientAsync();
var cts = new CancellationTokenSource();
this.cancellationTokens.Add(cts);
await Task.Factory.StartNew(() => this.Process(cts.Token, tcpClient), cts.Token, TaskCreationOptions.LongRunning, TaskScheduler.Default);
public void Stop()
this.isStarted = false;
foreach (var cancellationTokenSource in this.cancellationTokens)
cancellationTokenSource.Cancel();
foreach (var tcpClient in this.clients.Values)
tcpClient.GetStream().Close();
tcpClient.Close();
this.clients.Clear();
public async Task SendMessage(string message, IPEndPoint endPoint)
try
var tcpClient = this.clients[endPoint];
await this.Send(tcpClient.GetStream(), Encoding.ASCII.GetBytes(message));
catch (Exception exception)
private async Task Process(CancellationToken cancellationToken, TcpClient tcpClient)
try
var stream = tcpClient.GetStream();
this.clients.Add((IPEndPoint)tcpClient.Client.RemoteEndPoint, tcpClient);
while (!cancellationToken.IsCancellationRequested)
var data = await this.Receive(stream);
this.NewMessage.SafeInvoke(Encoding.ASCII.GetString(data));
catch (Exception exception)
private async Task Send(NetworkStream stream, byte[] buf)
await stream.WriteAsync(BitConverter.GetBytes(buf.Length), 0, 4);
await stream.WriteAsync(buf, 0, buf.Length);
private async Task<byte[]> Receive(NetworkStream stream)
var lengthBytes = new byte[4];
await stream.ReadAsync(lengthBytes, 0, 4);
var length = BitConverter.ToInt32(lengthBytes, 0);
var buf = new byte[length];
await stream.ReadAsync(buf, 0, buf.Length);
return buf;
Client
public class Client
private TcpClient tcpClient;
private NetworkStream stream;
public event Action<string> NewMessage;
public async void Connect(string host, int port)
try
this.tcpClient = new TcpClient();
await this.tcpClient.ConnectAsync(host, port);
this.stream = this.tcpClient.GetStream();
this.Process();
catch (Exception exception)
public void Disconnect()
try
this.stream.Close();
this.tcpClient.Close();
catch (Exception exception)
public async void SendMessage(string message)
try
await this.Send(Encoding.ASCII.GetBytes(message));
catch (Exception exception)
private async void Process()
try
while (true)
var data = await this.Receive();
this.NewMessage.SafeInvoke(Encoding.ASCII.GetString(data));
catch (Exception exception)
private async Task Send(byte[] buf)
await this.stream.WriteAsync(BitConverter.GetBytes(buf.Length), 0, 4);
await this.stream.WriteAsync(buf, 0, buf.Length);
private async Task<byte[]> Receive()
var lengthBytes = new byte[4];
await this.stream.ReadAsync(lengthBytes, 0, 4);
var length = BitConverter.ToInt32(lengthBytes, 0);
var buf = new byte[length];
await this.stream.ReadAsync(buf, 0, buf.Length);
return buf;Hi,
Have you debug these two applications? Does it go into the catch exception block when you close the client or the server?
According to my test, it will throw an exception when the client or the server is closed, just log the exception message in the catch block and then you'll get it:
private async void Process()
try
while (true)
var data = await this.Receive();
this.NewMessage.Invoke(Encoding.ASCII.GetString(data));
catch (Exception exception)
Console.WriteLine(exception.Message);
Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
By the way, I don't know what the SafeInvoke method is, it may be an extension method, right? I used Invoke instead to test it.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
How can I test that the ITS is setup right and working?.
How can I test that the ITS is setup right and working?.
At present when calling a CRM transaction (BOR object) via the Nav Bar of the Webclient IC I am getting a message box with the title of 'Message from Webpage' and the content saying 'Object expected'.
I have re-checked the transaction launcher and navigation bar profile setting and these look okay, hence my question regarding the ITS and how we might test that its functional.
JasonI assume that as I also have a call to a URL (website), which is working fine, then the ITS servicer is also working fine.
That just leads me to know identify why my BOR object is not being called correctly.
Within the Transaction launcher I have the following settings:
Entries
Launch Trans ID: ZZIC1_LT01
Component set: ALL
Technical details
Description: xxxxx
Class name: ZCL_ZZIC1_LT01
Statefull: X
Further Technical details
Transaction type: BOR Transaction
Logical system: CMDCLNT600
BOR Object type: TSTC_UIF
Method name: EXECUTE
Transaction Parameters
Parameter: Object_key
Value: CRMD_BUS2000115
Can anyone see any problems with these entries?.
what's the best way to ensure that 'CRMD_BUS2000115' is a BOR object?. I can run it as a transaction.
Jason -
How can I make that the cursor of a table ...
Hello,
how can I make that the cursor of a table (on the frontpanel) go to the starting position? I have placed a table that give back the number of the row if I doubleclick a row on the frontpanel, but when I restart the vi the cursor of the table is on this position. If I have many informations in the table and after restarting there are just one or two, I can`t see this information without scrolling to the top of the table. I want that the cursor (that I see) is at the first row. How can I make it?
thankyou
SchwedeHello,
Sorry, I forgot to attach it in the previous post.
Regards,
Paulo
Attachments:
EditPos.vi 16 KB -
I am selling my Mac Mini. I recently purchased OS X Lion. When I restore to factory settings, how can I ensure that the operating system will still be Lion, and not the original operating system, which I believe was Snow Leopard?
If you bought Lion from the App Store, you can't legally or practically transfer it, because it's tied to your Apple ID. Reinstall the original software from the discs that came with the machine.
-
HT3576 how can i verify that the network or firewall is not blocking access to port 5223.
how can i verify that the network or firewall is not blocking access to port 5223?
Talk to someone who knows something about networking and/or firewalls on an appropriate forum.
Configuring your network and/or firewall is beyond the scope of this forum, which is devoted to issues using the iPhone. -
How can I do that the background appears through the person who is on the pic
how can I do that the background appears through the person who is on the pic
Hi
just decrease the opacity of the layer on which you have the person -
How can one accept that the only way to sync with OSX 10.9 is through I cloud?
How can one accept that the only way to sync with OSX 10.9 is through I cloud?
One is now obliged to send private information to an external server...Thank you for the link but what a waist of time.
Who is the idiot that decided to drop manual syncing of contacts and calendars?
I am on the point of dropping all APPLE machines!
I am looking to sync without having to worry about security issues, keeping my files and passwords locally on my machines, and not an external server such as a cloud drive.
Do you know if Outlook syncs also over an external server?
Do you know of this solution? http://www.codetwo.com/public-folders/share-windows-files-securely/ -
Using an own function in a select how can i set that the function run once?
Hi
Using an own function in a select how can i set that the function run once, not in every row?
Please help me
Thanks
ViktorSomething like this ?
SQL> select * from dept;
DEPTNO DNAME LOC
10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON
SQL> create or replace function ret_name (deptnum in number) return varchar2
2 is
3 name varchar2(50);
4 begin
5 select dname into name
6 from dept
7 where deptno=deptnum;
8 return name;
9 exception
10 when no_data_found then
11 return('Not existent deptno');
12* end;
SQL> /
Function created.
SQL> select deptno, decode(rownum,1,ret_name(deptno),null) dname from dept;
DEPTNO DNAME
10 ACCOUNTING
20
30
40
SQL> -
How can i ensure that the time capsule back up all my data?
how can i ensure that the time capsule back up all my data and no any data missed during the back up? becz i was backing up my mac to time capsule for the first time and it takes only 5 hourse for 279GB which is doesnt make sense
any idea, how to ensure that all my data been backed upwell this tells you why you are having issues.. since you have a filevault and unless you are logged on as that user TM has no way to backup the vault.
so that is why the backup is so small.
And you cannot remove the file vault because the disk is too small.. you are in catch 22..
You cannot backup and you cannot remove the vault..
Login as the user who has the file vault and copy the files off the computer to a directory on the TC.. Then just delete the files on the computer.. that will then allow you to remove the file vault.
But never will I ever use file vaults so I am being theoretical .. please read it up yourself.
http://pondini.org/TM/25.html
You are not doing the background reading you need to understand what you are doing..
read the whole of pondini's info.. or at least skim it so you know what is there.
Avoid like the plague file vaults..
When disks go belly up, as they always do.. your files will be lost. Somewhere they need to be stored in the clear.. so why bother .. put better security on the computer and forget vaults. -
How can i indicate that the table columns have different size?
How can i indicate that the table columns have different size?
It is because i have a table that has several columns....but i would like to have the possibility to indicate the size for every column....could somebody help me please?
Thanks,
MaryHi,
don't know as much as I should about JTable, but it seems that using yourTable.getDefaultRenderer() could help you: if I clearly understood the javadoc notes, it returns an object inheriting from JLabel, so you should be able to use setHorizontalAlignment(int align) on it... no time to verify this, but I'd be thankfull if you tell me the results !!!
Regards -
How can i know that the application is written in a correct way???
Dear sirs...
it seems a little silly, but assume that i wrote an applicaion, how can i
1- be sure that its performance is good, i.e. did i designed the application to be fast?
2- if it is using SSL, how can i make sure the performance is high?
3- before the applicaion is installed should i use any specific tuning?
4- should i do some tuning to the database,& as? i know how to install the AS, & DB, and how to make the application work, but i want it to work as good as possible
thanks for any help & happy new year
regardsyou need load testing tool for that...
you can test your application with "Web Performance Trainer".. it supports ssl, multiple users (up to 5000 simultaneous), etc...
i use it and it is very good... anyway i havent try it with UIX only plain JSP but i think it shoud work with UIX too...
ofcourse you have to load database with lots of dummy records to have valid results...
my expirience is that for single standallone oc4j instance on heavy load maximum is 50-100 simultaneous users over ssl aes-256 (but load testing tool, oc4j and db are on the same computer which have only 2 GB of ram, and DB is only light loaded with with several hundred records, and each of those 50-100 concurent users have its own login name, each on its own separate SSL chanel.. so encryption load is really really heavy) on real deplyment system performance should be much much gerater, because DB, AS, and OC4J's should be on diferent machines each... -
How Can I get all the values of a DBMS package?
Hi all
I'm using this "dbms_output.put_line(DBMS_DB_VERSION.VERSION || '.' ||DBMS_DB_VERSION.RELEASE);" to show the version. But how Can I get the all the values from DBMS_DB_VERSION ? Is there a common way ?
Thanks .
Best
LaurenceHi,
Don't think that's possible. Even if it were, you wouldn't be able to use/display BOOLEAN type in SQL.
If you just aim to see what they are, you could do something like this
select text
from all_source
where owner = 'SYS'
and name = 'DBMS_DB_VERSION'
and type = 'PACKAGE';Or even
select dbms_metadata.get_ddl('PACKAGE', 'DBMS_DB_VERSION', 'SYS') from dual;My version is:
SQL> select * from v$version where rownum = 1;
BANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
1 row selectedIn 11g you also have [PL/SCOPE|http://download.oracle.com/docs/cd/E11882_01/appdev.112/e10471/adfns_plscope.htm#ADFNS02203] which might help you even more.
Regards
Peter -
How can i know that the material already deleted ?
Hello,
I'm new in SAP and need a help. In PP if an material is deleted or changed, it is marked as X in the xloek field of the RESB table. And when the order is TECO'd all the materials X'ed as weel. So how can i distinguish a deleted material in the order from the others? Please help.
Thanks in advance.
EmreHi,
I think I've found the answer and i want to share.
First i take the object number of the material from the RESB table with the objnr field.
Then look the JCDS table with that value. If an object exist with I0013 status and inact field
is not X, it is really deleted.
My query is
select single * from JCDS where objnr = resb-objnr
and stat = 'I0013'
and inact <> 'X'.
The statues can be seen the transaction bs22. -
How can I know that the listener is starting up?
Hi,
I follow the instruction in ACS Oracle Installation guide. I believe that many of you use the document to install oracle. I have a question when I try to start the listener. when I execute ./listener8i stop or ./listener8i start I got the same message, which is different from the message in the ACS document.
Here is the message:
Oracle 8i listener start/stop
Startting the Listener for 8i:
LSNRCTL for Linux: Version 8.1.6.0.0 - Production on 31-AUG-2000 14:00:00
(c) Copyright 1998, 1999, Oracle Corporation. All rights reserved.
TNS-01106: Listener using listener name LISTNENER has already been startd.
Is the message above correct? How can I know the listener is started up?
TIA,
Tonytry "lsnrctl status" on the linux command line.
for further info use "lsnrctl help"
Maybe you are looking for
-
Can't convert PPT to PDF using File- Print
Before downloading Leopard, I used to be able to convert my powerpoint slides to PDF handouts, either as 2 slides per page, 3 slides per page, etc. I no longer have a prompt to do that. The IT dept at my institution told me that Leopard removed that
-
Can't stop Pop up ads on yahoo home page
Hi, I have 3GS with latest 4.3.3 os. Last couple of days, every time I open yahoo home page (uk.m.yahoo.com) I get pop up ad at bottom of the page. Clicking on the close button only removes it to a tap that appears at edge of screen. If I open the a
-
Problem with the HDMI cable.
Hi folks. I was living in another country where I have had my TV and MacBook Pro Retina there with the Samsung TV via HDMI cable I was watching movies. Everything was perfect. Recently moved to another country, I brought with my of course my MacBook
-
I have this weird problem, I have EOS 400D camera, it always used to work fine with Aperture 2, but when I click IMPORT on 3.x, only "MacBook Pro" is shown, no camera. I always have to turn it on/off to finally get it shown on list and be able to imp
-
hi Gurus pls i was getting this error message while tring to create delivery for one of our new plants created "material not define for sales org ARM1 DIST CHAN. lang..E... after going into the error msg it say i should check the following" .The co