如何获得输出"表创建"使用perl DBI

时间:2015-10-31 08:31:00

标签: perl dbi

有一个代码我希望通过Perl DBI输出"表创建":

sort(copyGameEntry.begin(), copyGameEntry.end(),
     [&game](Entry& l, Entry& r) {
       return game.compareEntry_sumPct_nonMega(l, r);
     });

如何获得此输出"表创建"来自DBI?

2 个答案:

答案 0 :(得分:1)

我认为你不能直接从DBI得到这个答案。 DBI并不关心它正在执行什么,它只是将数据传递给数据库。只有您(或您编写的代码)知道您运行的语句是Exception in MessageQueue callback: handleReceiveCallback java.lang.NullPointerException at android.support.v7.widget.RecyclerView.onInterceptTouchEvent(RecyclerView.java:2022) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1833) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2244) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1907) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2244) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1907) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2244) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1907) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2244) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1907) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2244) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1907) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2244) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1907) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2244) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1907) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2244) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1907) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2244) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1907) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2244) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1907) at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1938) at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1392) at android.app.Activity.dispatchTouchEvent(Activity.java:2408) at android.support.v7.internal.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:59) at android.support.v7.internal.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:59) at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1886) at android.view.View.dispatchPointerEvent(View.java:7323) at android.view.ViewRootImpl.deliverPointerEvent(ViewRootImpl.java:3521) at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:3455) at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:4544) at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:4523) at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:4619) at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:171) at android.os.MessageQueue.nativePollOnce(Native Method) at android.os.MessageQueue.next(MessageQueue.java:125) at android.os.Looper.loop(Looper.java:140) at android.app.ActivityThread.main(ActivityThread.java:5086) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:821) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:584) at dalvik.system.NativeStart.main(Native Method) 语句。

因此,如果您要打印CREATE TABLE,甚至TABLE CREATED,您必须按照此处其他答案的建议检查返回值并自行汇总。

答案 1 :(得分:-1)

如果未成功执行查询,请打印错误消息。

  $Local_Dbh->do($Query) or print " Unable to execute the query $Local_Dbh->errstr";  

如果没有创建表,它将返回undef或-1,否则返回值

     Result : 0E0