执行不同任务的存储过程?(Stored procedure to perform different tasks?)
我有一张客户表。
我创建了可用于将新数据插入表中的存储过程。 但是,如果我想使用相同的过程来更新或删除该表中的数据,该怎么办? 我可以轻松地做到这一点,还是我必须为每个功能使用单独的功能/程序?
create or replace procedure add_customer(custid in table.id%type, name table.name%type) is begin insert into table(id, name) values(id, name); commit; end; /
I have a customer table.
I have created stored procedure I can use to insert new data into the table. But what if I wanted to use the same procedure to update OR delete data from that table. Could I do this easily or do I have to use a separate function/procedure for each function?
create or replace procedure add_customer(custid in table.id%type, name table.name%type) is begin insert into table(id, name) values(id, name); commit; end; /
原文:https://stackoverflow.com/questions/29333379
最满意答案
不,这是不可能的。
MFMessageComposeViewController
的接口不提供任何属性或功能来影响其呈现消息的方式。 因为MFMessageComposeViewController
不公开其任何视图组件,所以子类化是不可替代的。(只要100%正确:你当然可以展示
MFMessageComposeViewController
,然后一旦它可见,遍历它的整个视图层次结构,直到找到类UITextView
的视图,其text
或attributedText
text
attributedText
等于您提供的body
文本,然后将该文本视图的我们完全不鼓励你这样做。封装是有原因的,如果MFMessageComposeViewController
没有提供一个接口来选择它的文本视图中的文本,那么MFMessageComposeViewController
可以工作(→未经测试)意味着你不应该那样做。)No. This is not possible.
The interface for
MFMessageComposeViewController
does not provide any properties or functions to influence the way it presents the message. Subclassing is no alternative either as theMFMessageComposeViewController
doesn't expose any of its view components.(Just to be 100% correct: You could of course present the
MFMessageComposeViewController
, then once it's visible traverse its whole view hierarchy until you find a view of classUITextView
whosetext
orattributedText
property equals thebody
text you provided and then set that text view'sselectedRange
to the full range of the text. While this will probably work (→ untested) I totally discourage you to do that. Encapsulation is there for a reason and if theMFMessageComposeViewController
doesn't provide an interface to select text inside its text view it means that you're not supposed to do that.)
相关问答
更多-
你绝对不能(读我的嘴唇:永远,永远,永远)改变RichtTextBox Text或Lines属性,否则你将丢失/搞乱所有以前的格式。 所以你需要改变这个: richTextBox1.Text = richTextBox1.Text.Remove(richTextBox1.Text.Length - 1, 1); 按此顺序: 首先以某种方式选择要更改的Text部分: richTextBox1.SelectionStart = richTextBox1.Text.Length - 1; richTextBox ...
-
不,这是不可能的。 MFMessageComposeViewController的接口不提供任何属性或功能来影响其呈现消息的方式。 因为MFMessageComposeViewController不公开其任何视图组件,所以子类化是不可替代的。 (只要100%正确:你当然可以展示MFMessageComposeViewController ,然后一旦它可见,遍历它的整个视图层次结构,直到找到类UITextView的视图,其text或attributedText text attributedText等于您提供 ...
-
MFMessageComposeViewController后没有显示键盘(Keyboard not showing after MFMessageComposeViewController)[2021-08-16]
我有同样的问题,并且已经拒绝接受fabian的解决方案,但是通过调用[self dismissModalViewControllerAnimated:NO] ,然后调用[textView becomeFirstResponder] ,我可以使键盘重新出现。 关于动画的一些事情是搞砸了键盘; 看起来像iOS 4.2中的一个错误。 I had the same issue, and was resigned to accepting fabian's solution, but found that by ca ... -
MFMessageComposeViewController中的接口语言(Interface language in MFMessageComposeViewController)[2023-01-20]
您需要将您的应用本地化为俄语,以便显示您要求的本地化控件。 您需要做的就是将一个ru.lproj文件夹添加到您的项目中(如果您的应用需要,可以在此处包含Localizable.strings文件)让Xcode知道您正在积极支持该语言。 对于您添加为language-code.lproj的每种语言,如果在设备上设置为local,则每个本机控件(MFMessageComposeViewController,MFMailComposeViewController)都应考虑使用该语言。 You need to lo ... -
UITableView(Swift)中的MFMessageComposeViewController(MFMessageComposeViewController in a UITableView (Swift))[2022-07-29]
你确实需要一个UIViewController来呈现一个MFMessageComposeViewController 。 为了解决你的问题,你可以添加一个属性到你的TableViewCell : var viewController: UIViewController? 您需要在cellForRowAtIndexPath函数中分配当前视图控制器 - 如果视图控制器是表视图的数据源,那么这将只是cell.viewController = self 。 然后,在textButton函数中,可以显示消息编辑器: ... -
MFMessageComposeViewController不发送消息(MFMessageComposeViewController doesn't send out the message)[2021-11-16]
尝试以下代码 NSArray *arrPhoneNumbers = [NSArray arrayWithObjects:@"1234567890", nil]; MFMessageComposeViewController *controller = [[MFMessageComposeViewController alloc] init]; if([MFMessageComposeViewController canSendText]) { controller.bod ... -
MFMessageComposeViewController第一个alloc需要几秒钟(MFMessageComposeViewController first alloc takes seconds)[2023-07-25]
那么,你在做什么似乎是正确的。 你没有做错任何事。 检查一下 - 无法设置MFMessageComposeViewController的收件人? &答案中附带的链接 Well, what you are doing seems about right. You are not doing anything wrong. Check this - Can't set recipients of MFMessageComposeViewController? & the link attached in the ... -
您正在使用presentViewController:animated:completion:呈现消息presentViewController:animated:completion: 当以这种方式呈现视图控制器时,必须使用dismissViewControllerAnimated:completion:来解除视图控制器dismissViewControllerAnimated:completion: 。 但是您使用的是popViewControllerAnimated:它告诉导航控制器关闭导航堆栈顶部的 ...
-
无法知道消息是从消息应用程序发送还是失败。 我们在messageComposeViewController:didFinishWithResult:得到一个结果messageComposeViewController:didFinishWithResult:一旦消息成功排队等待发送。 It's not possible to know if the message is Sent or Failed from Messages app. We get a result in messageComposeVi ...
-
据我所知,从iOS 5.0开始,无法检索成功发送消息或成功发送。 这与MFMailComposeViewController相同。 如您所见, MFMailComposeViewController相当稀疏。 To the best of my knowledge, as of iOS 5.0, it is not possible to retrieve a successful send of a message or a successful delivery. This is the same fo ...