logparser TO_TIME输出与sql时间数据类型不匹配(logparser TO_TIME output not matching the sql time datatype)
以下是logparser的QUERY:
logparser -i:Textline "SELECT TO_DATE(TO_TIMESTAMP(TRIM(EXTRACT_SUFFIX(text,0,'TIMESTAMP')),'M/d/yyyy'))AS DATE, TO_TIME(TO_TIMESTAMP(TRIM(EXTRACT_TOKEN(text,0,'(')),'H:mm:ss')) as TIME from 'C:\xxxx.log' where text like '%OUT:%' OR text like '%IN:%' OR text like '%TIMESTAMP%' OR text like '%DENIED%'" -o:datagrid
输出的查询是:
DATE TIME NULL 03:09:49 NULL 03:09:49 NULL 03:10:44 NULL 03:11:52 2015-02-06 03:12:40 NULL 03:13:37 NULL 03:18:22 NULL 03:21:18 NULL 03:21:32 NULL 03:24:19 NULL 03:26:02
当我希望这些数据流入SQL表时,我收到以下错误:
QUERY:
logparser -i:Textline "select TO_DATE(TO_TIMESTAMP(TRIM(EXTRACT_SUFFIX(text,0,'TIMESTAMP')),'M/d/yyyy'))AS DATE, TO_TIME(TO_TIMESTAMP(TRIM(EXTRACT_TOKEN(text,0,'(')),'H:mm:ss')) as TIME INTO Ptclog from 'C:\ptclmgrd.log' where text like '%OUT:%' OR text like '%IN:%' OR text like '%TIMESTAMP%' OR text like '%DENIED%'" -o:SQL -server:KANNA\SQLEXPRESS -database:Flex -driver:"SQL Server Native Client 11.0" -username:sa -password:XXXXXX
错误:
任务中止。 SQL表列“Time”数据类型与SELECT子句项“TIME”(类型TIMESTAMP)不兼容
在SQLEXPRESS中选择的数据类型是
时间(0)。
如果我选择数据类型,数据将流向列:
“约会时间”
但这会在时间前添加一个令人讨厌的默认日期。 例如,时间显示为:
DATE TIME 2015-02-06 2015-01-01 03:12:40.000 NULL 2015-01-01 07:55:49.000 NULL 2015-01-01 06:46:50.000 NULL 2015-01-01 06:55:40.000 NULL 2015-01-01 01:57:25.000 NULL 2015-01-01 02:36:41.000
有没有办法在sql express 2014 DB中以hh:mm:ss格式表示时间?
以下是正在查询的日志文件中的示例条目:
3:12:40 (lmgrd) TIMESTAMP 2/6/2015 3:13:37 (ptc_d) OUT: "PROE_Flex3CG" e1cx@D43F2STC 3:18:22 (ptc_d) OUT: "PROE_Flex3C" u234566@D5712Sf8 3:21:18 (ptc_d) OUT: "PROE_Flex3C" u234566@D5712Sf8 3:21:32 (ptc_d) OUT: "PROE_Flex3C" U524863@D9NR972S 3:24:19 (ptc_d) IN: "PROE_Flex3CG" e1cx@D43F2STC 3:26:02 (ptc_d) OUT: "PROE_Flex3C" m0ax@2SD3TC3F 3:26:46 (ptc_d) OUT: "PROE_Flex3C" 06u1015@03tjn-proe 3:26:48 (ptc_d) OUT: "26" 06u1015@03tjn-proe 3:26:48 (ptc_d) OUT: "10114" 06u1015@03tjn-proe 4:34:39 (ptc_d) DENIED: "26" 74U1027@MZBOXSGH61108 (Licensed number of users already reached. (-4,342:10054 ""))
Following is the QUERY from logparser :
logparser -i:Textline "SELECT TO_DATE(TO_TIMESTAMP(TRIM(EXTRACT_SUFFIX(text,0,'TIMESTAMP')),'M/d/yyyy'))AS DATE, TO_TIME(TO_TIMESTAMP(TRIM(EXTRACT_TOKEN(text,0,'(')),'H:mm:ss')) as TIME from 'C:\xxxx.log' where text like '%OUT:%' OR text like '%IN:%' OR text like '%TIMESTAMP%' OR text like '%DENIED%'" -o:datagrid
Output of the query is :
DATE TIME NULL 03:09:49 NULL 03:09:49 NULL 03:10:44 NULL 03:11:52 2015-02-06 03:12:40 NULL 03:13:37 NULL 03:18:22 NULL 03:21:18 NULL 03:21:32 NULL 03:24:19 NULL 03:26:02
When i want this data to flow into SQL table I get the following error:
QUERY :
logparser -i:Textline "select TO_DATE(TO_TIMESTAMP(TRIM(EXTRACT_SUFFIX(text,0,'TIMESTAMP')),'M/d/yyyy'))AS DATE, TO_TIME(TO_TIMESTAMP(TRIM(EXTRACT_TOKEN(text,0,'(')),'H:mm:ss')) as TIME INTO Ptclog from 'C:\ptclmgrd.log' where text like '%OUT:%' OR text like '%IN:%' OR text like '%TIMESTAMP%' OR text like '%DENIED%'" -o:SQL -server:KANNA\SQLEXPRESS -database:Flex -driver:"SQL Server Native Client 11.0" -username:sa -password:XXXXXX
ERROR:
Task aborted. SQL table column "Time" data type is not compatible with SELECT clause item "TIME" (type TIMESTAMP)
The data type selected in SQLEXPRESS is
time(0).
The data flows to the column if i select the datatype as :
"datetime"
But this adds a default date in front of time which is nuisance. e.g the time is shown as :
DATE TIME 2015-02-06 2015-01-01 03:12:40.000 NULL 2015-01-01 07:55:49.000 NULL 2015-01-01 06:46:50.000 NULL 2015-01-01 06:55:40.000 NULL 2015-01-01 01:57:25.000 NULL 2015-01-01 02:36:41.000
Is there a way the time can be represented in hh:mm:ss format in sql express 2014 DB ?
Following are sample entries in the log file that is being queried:
3:12:40 (lmgrd) TIMESTAMP 2/6/2015 3:13:37 (ptc_d) OUT: "PROE_Flex3CG" e1cx@D43F2STC 3:18:22 (ptc_d) OUT: "PROE_Flex3C" u234566@D5712Sf8 3:21:18 (ptc_d) OUT: "PROE_Flex3C" u234566@D5712Sf8 3:21:32 (ptc_d) OUT: "PROE_Flex3C" U524863@D9NR972S 3:24:19 (ptc_d) IN: "PROE_Flex3CG" e1cx@D43F2STC 3:26:02 (ptc_d) OUT: "PROE_Flex3C" m0ax@2SD3TC3F 3:26:46 (ptc_d) OUT: "PROE_Flex3C" 06u1015@03tjn-proe 3:26:48 (ptc_d) OUT: "26" 06u1015@03tjn-proe 3:26:48 (ptc_d) OUT: "10114" 06u1015@03tjn-proe 4:34:39 (ptc_d) DENIED: "26" 74U1027@MZBOXSGH61108 (Licensed number of users already reached. (-4,342:10054 ""))
原文:https://stackoverflow.com/questions/29144624
最满意答案
JavaFX 2.2中没有标准的水平方向TitledPane。
您可以在JavaFX问题跟踪器中为其创建功能请求。
实现自己的水平TitledPane非常简单。
所涉及技术的进一步解释在Sai的博客文章中: 在JavaFX中滑动(这完全是关于剪辑) 。
/** Animates a node on and off screen to the left. */ class SideBar extends VBox { /** @return a control button to hide and show the sidebar */ public Button getControlButton() { return controlButton; } private final Button controlButton; /** creates a sidebar containing a vertical alignment of the given nodes */ SideBar(final double expandedWidth, Node... nodes) { getStyleClass().add("sidebar"); this.setPrefWidth(expandedWidth); // create a bar to hide and show. setAlignment(Pos.CENTER); getChildren().addAll(nodes); // create a button to hide and show the sidebar. controlButton = new Button("Collapse"); controlButton.getStyleClass().add("hide-left"); // apply the animations when the button is pressed. controlButton.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent actionEvent) { // create an animation to hide sidebar. final Animation hideSidebar = new Transition() { { setCycleDuration(Duration.millis(250)); } protected void interpolate(double frac) { final double curWidth = expandedWidth * (1.0 - frac); setPrefWidth(curWidth); setTranslateX(-expandedWidth + curWidth); } }; hideSidebar.onFinishedProperty().set(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent actionEvent) { setVisible(false); controlButton.setText("Show"); controlButton.getStyleClass().remove("hide-left"); controlButton.getStyleClass().add("show-right"); } }); // create an animation to show a sidebar. final Animation showSidebar = new Transition() { { setCycleDuration(Duration.millis(250)); } protected void interpolate(double frac) { final double curWidth = expandedWidth * frac; setPrefWidth(curWidth); setTranslateX(-expandedWidth + curWidth); } }; showSidebar.onFinishedProperty().set(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent actionEvent) { controlButton.setText("Collapse"); controlButton.getStyleClass().add("hide-left"); controlButton.getStyleClass().remove("show-right"); } }); if (showSidebar.statusProperty().get() == Animation.Status.STOPPED && hideSidebar.statusProperty().get() == Animation.Status.STOPPED) { if (isVisible()) { hideSidebar.play(); } else { setVisible(true); showSidebar.play(); } } } }); } }
There is no standard horizontal orientation TitledPane in JavaFX 2.2.
You can create a feature request for one in the JavaFX issue tracker.
Implementing your own horizontal TitledPane is pretty easy.
Here is a demo of a similar thing just using animation on a standard Pane.
Further explanations of the techniques involved are in Sai's blog post: Sliding in JavaFX (It’s all about clipping).
/** Animates a node on and off screen to the left. */ class SideBar extends VBox { /** @return a control button to hide and show the sidebar */ public Button getControlButton() { return controlButton; } private final Button controlButton; /** creates a sidebar containing a vertical alignment of the given nodes */ SideBar(final double expandedWidth, Node... nodes) { getStyleClass().add("sidebar"); this.setPrefWidth(expandedWidth); // create a bar to hide and show. setAlignment(Pos.CENTER); getChildren().addAll(nodes); // create a button to hide and show the sidebar. controlButton = new Button("Collapse"); controlButton.getStyleClass().add("hide-left"); // apply the animations when the button is pressed. controlButton.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent actionEvent) { // create an animation to hide sidebar. final Animation hideSidebar = new Transition() { { setCycleDuration(Duration.millis(250)); } protected void interpolate(double frac) { final double curWidth = expandedWidth * (1.0 - frac); setPrefWidth(curWidth); setTranslateX(-expandedWidth + curWidth); } }; hideSidebar.onFinishedProperty().set(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent actionEvent) { setVisible(false); controlButton.setText("Show"); controlButton.getStyleClass().remove("hide-left"); controlButton.getStyleClass().add("show-right"); } }); // create an animation to show a sidebar. final Animation showSidebar = new Transition() { { setCycleDuration(Duration.millis(250)); } protected void interpolate(double frac) { final double curWidth = expandedWidth * frac; setPrefWidth(curWidth); setTranslateX(-expandedWidth + curWidth); } }; showSidebar.onFinishedProperty().set(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent actionEvent) { controlButton.setText("Collapse"); controlButton.getStyleClass().add("hide-left"); controlButton.getStyleClass().remove("show-right"); } }); if (showSidebar.statusProperty().get() == Animation.Status.STOPPED && hideSidebar.statusProperty().get() == Animation.Status.STOPPED) { if (isVisible()) { hideSidebar.play(); } else { setVisible(true); showSidebar.play(); } } } }); } }
相关问答
更多-
TitledPane是一个标签,因此您可以在侦听器中设置一个图形或绑定到扩展属性。 更改背景颜色等(包括重写:聚焦伪类的样式)是可以通过css完成的(例如,参考jfxrt.jar中caspian.css样式表的TitledPane部分)。 如果您需要基于代码访问TitledPane的子组件,则可以在将TitledPane添加到舞台上显示的场景后使用查找功能。 adminPane.lookup(".arrow").setVisible(false); 我建议在尝试查找之前尝试基于图形/ css样式表的方法。 ...
-
使用CSS无法正常删除JavaFX TitledPane中的insets(Remove insets in JavaFX TitledPane with CSS not working)[2022-11-22]
在以下样式类上将-fx-padding设置为0。 .titled-pane .content AnchorPane { -fx-padding: 0px; } Set the -fx-padding to 0 on the following style classes. .titled-pane .content AnchorPane { -fx-padding: 0px; } -
我不认为有一个公共的API来检测鼠标点击标题区域,但是可以这样做: titledPane.setOnMouseClicked(new EventHandler
() { @Override public void handle(MouseEvent event) { EventTarget target = event.getTarget(); String clazz = "class com.sun.javafx.scene.cont ... -
不要在标题窗格上设置文本,而是创建标签并将其设置为标题窗格的图形。 然后,您可以使用标签注册鼠标处理程序: private TitledPane createClickableTitledPane(String text) { Label label = new Label(text); label.setOnMouseClicked(e -> System.out.println("Click on "+text)); TitledPane titledPane = new Tit ...
-
JavaFX 2.2中没有标准的水平方向TitledPane。 您可以在JavaFX问题跟踪器中为其创建功能请求。 实现自己的水平TitledPane非常简单。 这是一个类似的东西的演示,只是在标准窗格上使用动画。 所涉及技术的进一步解释在Sai的博客文章中: 在JavaFX中滑动(这完全是关于剪辑) 。 /** Animates a node on and off screen to the left. */ class SideBar extends VBox { /** @return a con ...
-
在javaFX中单击grapich时阻止TitledPane打开(Prevent TitledPane from opening when the grapich is clicked, in javaFX)[2021-12-17]
我找到了解决方案: 我只是在使用MOUSE_CLICKED事件,而TitledPane也在处理MOUSE_PRESSED / MOUSE_RELEASED事件。 I found a solution: I was just consuming the MOUSE_CLICKED event, and the TitledPane is also handling MOUSE_PRESSED/MOUSE_RELEASED events. -
...
-
使用每个标题窗格的expandedProperty注册一个侦听器: @Override public void initialize(URL url, ResourceBundle rb) { titlePane1.expandedProperty().addListener((obs, wasExpanded, isNowExpanded) -> { if (isNowExpanded) { textArea1.appendText("Titled Pane ...
-
窗格使用舞台调整大小,但VBox的宽度不超过1000px。 捕获阶段的宽度约为1010像素。 你应该可以免除窗格 :不幸的是,用这种布局层次结构想要实现的目标还不是很清楚。 无论如何,只需移除AnchorPane锚点或将它们设置为0.5就像下面一样。 AnchorPane.bottomAnchor="0.5" AnchorPane.rightAnchor="0.5" AnchorPane.topAnchor="0.5" I have found the reason, i am using ScrollPane in ChildPane.fxml, the scroll bar will zoom the screen ...
相关文章
更多- The Log: What every software engineer should know about real-time data's unifying abstraction
- Real-Time Rendering 笔记 --- 1-4章
- sql 语句
- POJ 3620 Avoid The Lakes【DFS水题练格式Avoid The Lakes Time Limit: 1000MS Memory Limit: 65536K Total Sub】
- Sql Support within Solr-类Sql的solr搜索实现(1)
- SQL Server 压力测试
- Hadoop Hive SQL语法详解
- sql问题
- SQL的一个简单问题
- 如何优化这个sql语句
最新问答
更多- 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
- 如何通过引用返回对象?(How is returning an object by reference possible?)
- 矩阵如何存储在内存中?(How are matrices stored in memory?)
- 每个请求的Java新会话?(Java New Session For Each Request?)
- css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
- 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
- xcode语法颜色编码解释?(xcode syntax color coding explained?)
- 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
- 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
- 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
- 西安哪有PLC可控制编程的培训
- 在Entity Framework中选择基类(Select base class in Entity Framework)
- 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
- 电脑二级VF有什么用
- Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
- 金华英语角.
- 手机软件如何制作
- 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
- 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
- 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
- Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
- 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
- python的访问器方法有哪些
- DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
- 在Ruby中对组合进行排序(Sorting a combination in Ruby)
- 网站开发的流程?
- 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
- 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
- 透明度错误IE11(Transparency bug IE11)
- linux的基本操作命令。。。