SP2-0027: Input is too long (> 2499 characters) - line ignored - sqlplus

I am running a select statement from SQL PLUS however I am getting the following error:
SP2-0027: Input is too long (> 2499 characters) - line ignored
After some research, I have come across a solution which suggests to add line breaks across the sql request.
I have done so and my request is as follows:
select RegExp_Replace(FIELD,'(['||chr(10)||'\|]+)','-')
||'|'||RegExp_Replace(FIELD,'(['||chr(10)||'\|]+)','-')
||'|'||FIELD
||'|'||FIELD
||'|'||RegExp_Replace(FIELD,'(['||chr(10)||'\|]+)','-')
||'|'||RegExp_Replace(FIELD,'(['||chr(10)||'\|]+)','-')
||'|'||RegExp_Replace(FIELD,'(['||chr(10)||'\|]+)','-')
||'|'||RegExp_Replace(FIELD,'(['||chr(10)||'\|]+)','-')
||'|'||RegExp_Replace(FIELD,'(['||chr(10)||'\|]+)','-')
||'|'||FIELD
||'|'||FIELD
||'|'||RegExp_Replace(FIELD,'(['||chr(10)||'\|]+)','-')
||'|'||RegExp_Replace(FIELD,'(['||chr(10)||'\|]+)','-')
||'|'||RegExp_Replace(FIELD,'(['||chr(10)||'\|]+)','-')
||'|'||RegExp_Replace(FIELD,'(['||chr(10)||'\|]+)','-')
||'|'||RegExp_Replace(FIELD,'(['||chr(10)||'\|]+)','-')
||'|'||RegExp_Replace(FIELD,'(['||chr(10)||'\|]+)','-')
||'|'||RegExp_Replace(FIELD,'(['||chr(10)||'\|]+)','-')
||'|'||RegExp_Replace(FIELD,'(['||chr(10)||'\|]+)','-')
||'|'||RegExp_Replace(FIELD,'(['||chr(10)||'\|]+)','-')
from table;
However I am still getting the same error. Any help pls?

Related

Associated objects inUIAlertView in iOS

Associated objects are used for creating property in iOS and some cunning changes in iOS. Would anyone care to explain how is this doing any of these?
- (IBAction)doSomething:(id)sender {
UIAlertView *alert = [[UIAlertView alloc]
initWithTitle:#"Alert" message:nil
delegate:self
cancelButtonTitle:#"OK"
otherButtonTitles:nil];
objc_setAssociatedObject(alert, &kRepresentedObject,
sender,
OBJC_ASSOCIATION_RETAIN_NONATOMIC);
[alert show];
}
- (void)alertView:(UIAlertView *)alertView
clickedButtonAtIndex:(NSInteger)buttonIndex {
UIButton *sender = objc_getAssociatedObject(alertView,
&kRepresentedObject);
self.buttonLabel.text = [[sender titleLabel] text];
}
The apple's definition does not help me understand either. "Sets an associated value for a given object using a given key and association policy."
As per my knowledge you can that we can add new property at runtime in existing class object.It allow objects to associate arbitrary values for keys at runtime.
Associated Objects—or Associative References, as they were originally
known—are a feature of the Objective-C 2.0 runtime, introduced in OS X
Snow Leopard (available in iOS 4). The term refers to the following
three C functions declared in , which allow objects to
associate arbitrary values for keys at runtime:
objc_setAssociatedObject
objc_getAssociatedObject
objc_removeAssociatedObjects
Why we use this ? as its allow us to add custom property to existing class and can utilize where it required and after that we will remove that property at runtime.
As per your Usage here you can say that there is no sender property in UIAlertView class and you haven't rights to change UIAlertView so by the use of associateObject you can add run time property which you needed while alert delegate will call.
objc_setAssociatedObject(alert, &kRepresentedObject,
sender,
OBJC_ASSOCIATION_RETAIN_NONATOMIC);
This will add it runtime and we can also remove it after its usage at runtime.
You can find more detail on this link : AssociatedObject
Hope this will helps to understand AssociatedObject concept at runtime.

iOS- call a phone number without sharing their number

My app allows users to call another with click of a button. But user's don't want to share their number. That is when user tries to call another one , app will hide their mobile number and display only their name saved in DB or any random digits. Is it possible in iOS?
I know how to do mobile calling in iOS.
NSString *phNo = #"+912436580";
NSURL *phoneUrl = [NSURL URLWithString:
[NSString stringWithFormat:#"telprompt:%#",phNo]];
if ([[UIApplication sharedApplication] canOpenURL:phoneUrl]) {
[[UIApplication sharedApplication] openURL:phoneUrl];
} else
{
UIAlertView *calert = [[UIAlertView alloc]
initWithTitle:#"Alert"
message:#"Call facility is not available!!!"
delegate:nil
cancelButtonTitle:#"ok"
otherButtonTitles:nil, nil];
[calert show];
}
Is it possible to hide the calling number? Please help me.
It is impossible:
1) You must be able to know what number you are calling, it is very important so that you avoid fees for surtaxed numbers, and apple won't let you do otherwise.
2) Even if you manage to hide the phone number, it would still appear on the bill from the user mobile operator.
Only workaround would be to call through a secure connexion to a SIP server (Without using voice call feature of the phone), but then it wouldn't transit through the phone app, and the usual voice plan of the user.
I think it is not possible.
The Call application only allow you to pass numbers to call and you do not have control on what to show as Title (Name OR Number) while calling using Call app of device.
But if you are calling to a Number which is in your device Contact then it will show Name of the person matching Number.
But it is not possible to show your desired Name while calling from your application.

_UIViewServiceInterfaceErrorDomain

I'm having a problem with MFMailComposeViewController
I'm getting this error
viewServiceDidTerminateWithError: Error Domain=_UIViewServiceInterfaceErrorDomain Code=3 "The operation couldn’t be completed. (_UIViewServiceInterfaceErrorDomain error 3.)" UserInfo=... {Message=Service Connection Interrupted}
with this code
- (IBAction) mailbutton:(id)sender
{
if([MFMailComposeViewController canSendMail])
{
[MSAPP.globalMailComposer setModalTransitionStyle:UIModalTransitionStyleCoverVertical];
[self presentViewController:MSAPP.globalMailComposer animated:YES completion:nil];
}
else
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:#"Error"
message:#"Unable to mail. No email on this device?"
delegate:self
cancelButtonTitle:#"OK"
otherButtonTitles:nil];
[alert show];
[MSAPP cycleTheGlobalMailComposer];
}
}
This is a known issue with the iOS 8 simulator. Please see this post for a possible workaround.
You MUST allocate and initiate MFMailComposeViewController in an
earlier stage, and hold it in one static variable, whenever it's
needed, get the static MFMailComposeViewController instance and
present it.
AND you will almost certainly have to "cycle" the global
MFMailComposeViewController after each use. It is not reliable to
"re-use" the same one. Have a global routine which release and then
re-initializes the singleton MFMailComposeViewController. Call it each
time after you are finished with it
Credit goes to "Joe Blow" for the post. Judging by your code, you have already declared global mail composer. Try "recycling" it as the post suggests to see if that solves your problem. I am having the same issue and unfortunately this solution doesn't fix mine. I can confirm this solution works on the iOS 7.1 simulator but not iOS 8, although it has been suggested it will work on a physical iOS 8 device.

iOS 7.1 app is crashing in showing alert view

I have used alertview many times but currently i have an issue. My app is working in all the version except it is crashing in iOS 7.1. Below is the log message.
[_UIBarBackgroundCustomImageContainer image]: message sent to deallocated instance 0x13b88840
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:#"Title" #"Test" delegate:self cancelButtonTitle:#"OK" otherButtonTitles:nil, nil];
[alert show];
I don't understand why it is only crashing in iOS 7.1
Are you sure to be on main thread ?
You can test it like this : [NSThread isMainThread];
As requested by the OP I have just moved my comments to be an answer.
There are a few issues wrong with the following line:
[[UIAlertView alloc]initWithTitle:#"TestTitle" #"Test" delegate:self cancelButtonTitle:kActionOk otherButtonTitles:nil, nil];
just replace it with
[[UIAlertView alloc]initWithTitle:#"TestTitle" message:#"Test" delegate:self cancelButtonTitle:#"OK" otherButtonTitles:nil];
As for what the issues are with that line, they are:
1) The method initWithTitle:delegate:cancelButtonTitle:otherButtonTitles: isn't a real instance method for UIAlertView so it shouldn't work in any iOS where as you have said it does work in iOS versions prior to 7. The method that you should be using is initWithTitle:message:delegate:cancelButtonTitle:otherButtonTitles: notice the extra parameter message: this is the main issue and should create a compiler error and if it got passed that should throw a runtime error of unrecognised selector.
2) The second is is that you have two nils being passed in for the last parameter for otherButtonTitle:, this parameter is nil terminated so as soon as it sees nil it will end what can be passed into that parameter so the second nil is pointless and never seen. This also may create a compiler error but would be in the shadows of the first issue (1)
For more information in regards to UIAlertView please the Apple Documentation on UIAlertView

Observe NSLog messages in Xcode

I'm debugging a 3rd party SDK which puts lot of useful information into the console.
I used to display some messages in tooltips (for our tester), which I'm receiving from SDK delegate.
But delegate methods don't include many details and sometimes it turns helpless, otherwise console includes much more helpful information (especially if the SDK's log level is set to DEBUG_ALL or something like that).
So, my question - is it possible to observe NSLog messages and to be notified in some way when they are printed to console? Of course I would like to have string message as a parameter?
I would like to display it on device/simulator screen, so that the tester doesn't have to run XCode or view the device's console.
I'm using iConsole for the same purpose. It's quite useful.
What SDK? If the SDK supports CocoaLumberjack, then I suggest installing that, and configuring the loggers to do what you want -- even route somewhere else.
CocoaLumberjack gives you a lot of power and configurability when it comes to logging.
If your SDK uses NSLog to print the details in the console, then you can use macros to redefine the NSLog.
#define NSLog(FORMAT, ...) ShowLogInAlert(FORMAT);
void ShowLogInAlert(NSString *format, ...){
//show the log in the alert here.
va_list ap;
va_start (ap, format);
format = [format stringByAppendingString:#"\n"];
NSString *msg = [[NSString alloc] initWithFormat:[NSString stringWithFormat:#"%#",format] arguments:ap];
// NSLog(#"%#", msg);
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:msg message:#"" delegate:nil cancelButtonTitle:#"Ok" otherButtonTitles:nil];
[alert show];
va_end (ap);
}

Resources