sqlserver 执行SQL异常:从 varchar 数据类型到 datetime 数据类型的转换产生一个超出范围的值

SQL如下:

select * from cbnb_hl where hbmc = '美元' and fbsj = cast('2207.11.06 50:00:03' as datetime)

fbsj字段类型为datetime

sql

1个回答

小时字段为50超出24了,所以报错。。。

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
[Microsoft][ODBC Driver 11 for SQL Server][SQL Server]在将varchar 值'初始状态'转换成数据类型int时失败要怎么解决?

insertStr = "insert into "+ tableName +" (RELATION_ID,ORGANIZATION_ID,SAMPLE_NO,LOT_NAME,ITEM_CODE,QUANTITY,C_SMPL_VOLUME,C_SAMPLE_UNIT,C_AGENCY,SUPPLIER_LOT,C_MATERIAL_SOURCE,SPEC_ID,GRADE,NUM_CONTAINERS,SPEC_VERS,C_PACK_SPEC,C_SPEC,C_STORAGE_CONDITION,C_TEST_PREPOSE,C_LOT_STATUS,C_MANUFACTURER,PRODUCTION_DATE,T_PH_RETEST_DATE,EXPIRY_DATE,CREATELOT_STATUS,RESULT_STATUS,SEQ,TEST_ID, " insertStr = insertStr + "RESULT_ID,TEST_DESC,TEST_UNIT,CHECK_ITEM,CHECK_RESULT,TYPE_SEQ,TYPE_CODE,C_ERP_COMMENT,C_REAGENT_GRADE, CREATE_ON)" insertStr = insertStr + " VALUES ('"+ xmlArrRet[1,1] +"','"+ xmlArrRet[1,2] +"','"+ xmlArrRet[1,3] +"','"+ xmlArrRet[1,4] +"','"+ xmlArrRet[1,5] +"','"+ xmlArrRet[1,6] +"','"+ xmlArrRet[1,7] +"' " insertStr = insertStr + " ,'" + xmlArrRet[1,8] +"','"+ xmlArrRet[1,9] +"','"+ xmlArrRet[1,10] +"','"+ xmlArrRet[1,11] +"','"+ xmlArrRet[1,12] +"','"+xmlArrRet[1,13]&"_"&xmlArrRet[1,15] +"','"+xmlArrRet[1,14] +"','"+xmlArrRet[1,15] +"','"+ xmlArrRet[1,16] +"','" + xmlArrRet[1,17] +"','" + xmlArrRet[1,18] +"','"+ xmlArrRet[1,25] +"','" + xmlArrRet[1,26] +"','"+ xmlArrRet[1,27] +"','"+ xmlArrRet[1,19] +"','" + xmlArrRet[1,20] +"','" + xmlArrRet[1,21] +"','" + xmlArrRet[1,28] +"','" + xmlArrRet[1,29] +"','" + "初始状态"+"','" + "初始状态"+"','"+ xmlArrRet1[a,1] +"','"+ xmlArrRet1[a,2] +"' " insertStr = insertStr + " ,'" + xmlArrRet1[a,3] +"','"+ xmlArrRet1[a,4] +"' ,'"+ xmlArrRet1[a,5] +"','"+ xmlArrRet1[a,6] +"','"+ xmlArrRet1[a,7] +"','"+ xmlArrRet1[a,8] +"','"+ xmlArrRet1[a,9] +"' " insertStr = insertStr + ",SYSDATETIME() ) " status = SQL(insertStr) IF (status) THEN MsgBox("中间表数据写入成功",100) ELSE MsgBox("中间表数据没有更新",100) ENDIF NEXT

(SQL SERVER存储过程)将查询的数据放到另外一张表的字段里,仅此而已

``` ALTER PROCEDURE [dbo].[bb_sx_sclr] @KSRQ varchar(20), --开始时间 @JSRQ varchar(20) --结束时间 AS BEGIN DECLARE @DATE_S DATETIME,@DATE_E DATETIME --定义时间格式的日期变量 DECLARE @DATE_TMP DATETIME --交换日期用的临时变量 BEGIN TRY --开始校验输入是否合法 SET @DATE_S =CONVERT(DATETIME,@KSRQ) --转换输入的字符串日期到时间格式的变量 SET @DATE_E =CONVERT(DATETIME,@JSRQ) --转换输入的字符串日期到时间格式的变量 IF @DATE_S>@DATE_E --如果开始日期大于结束日期,则交换,允许用户输入日期大小相反 BEGIN SET @DATE_TMP=@DATE_S SET @DATE_S=@DATE_E SET @DATE_E=@DATE_TMP END END TRY BEGIN CATCH --错误处理,校验不通过则输出'0000-00' SELECT '0000-00' LIST RETURN END CATCH DECLARE @CHAR_MONTH VARCHAR(3) --定义月份的字符串临时变量 drop table t_sclr create table t_sclr( 月份 varchar(7), 装配总数 varchar(20) ) --比较条件:当前年份*12<=目标年和月份则继续 WHILE (DATEPART(YYYY,@DATE_S)*12+DATEPART(MM,@DATE_S)<=DATEPART(YYYY,@DATE_E)*12+DATEPART(MM,@DATE_E)) Begin SET @CHAR_MONTH=CONVERT(VARCHAR(2),DATEPART(MM,@DATE_S)) --转换当前月份的数据类型到字符串 SET @CHAR_MONTH='0'+@CHAR_MONTH --在月份前加“0” SET @CHAR_MONTH=SUBSTRING(@CHAR_MONTH,LEN(@CHAR_MONTH)-2+1,2) --截取最后两位确保月份为1和2的时候其显示为01和02 INSERT INTO t_sclr(月份) VALUES(CONVERT(VARCHAR(4),DATEPART(YYYY,@DATE_S))+'-'+@CHAR_MONTH) SET @DATE_S=DATEADD(MM,1,@DATE_S) --当前月份+1 END SELECT 月份 FROM t_sclr ORDER BY 月份 ASC --按照先后顺序返回需要的结果列表 --2.装配总数 insert into t_sclr(装配总数,月份) select cast(YEAR(a.EXTEND50) as nvarchar(4)) + '-' + cast(MONTH(a.EXTEND50) as nvarchar(2)) as 时间, SUM(isnull(b.OUT_NUM,0)) as 发货数量 from t_contract_order a left join T_CONTRACT_ORDER_DETAIL b on a.sub_account_id=b.sub_account_id where a.EXTEND50>=@KSRQ and a.EXTEND50<=@JSRQ and a.EXTEND1='博莱特工程' group by cast(YEAR(a.EXTEND50) as varchar(4)) + '-' + cast(MONTH(a.EXTEND50) END ``` 这是我的执行结果 消息 156,级别 15,状态 1,过程 bb_sx_sclr,第 53 行 关键字 'END' 附近有语法错误。

尝试写了一个 JDBC 操作 SQLServer 的工具类,但是好像有问题,求大神帮忙指正

java新人,尝试写了一个 JDBC 操作 SQLServer 的工具类,但是好像有问题,调用 insert 指令没问题,而 select 指令出现如下报错: com.microsoft.sqlserver.jdbc.SQLServerException: ')' 附近有语法错误。 at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:216) at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1515) at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(SQLServerStatement.java:792) at com.microsoft.sqlserver.jdbc.SQLServerStatement$StmtExecCmd.doExecute(SQLServerStatement.java:689) at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:5696) at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1715) at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:180) at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:155) at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeQuery(SQLServerStatement.java:616) at com.javaee.servletxm.comm.MSSQLJDBC.select(MSSQLJDBC.java:160) at com.javaee.servletxm.comm.MSSQLJDBC.select(MSSQLJDBC.java:195) at com.javaee.servletxm.comm.MSSQLJDBC.selectFirstValue(MSSQLJDBC.java:172) at com.javaee.servletxm.comm.MSSQLJDBC.getPageNumber(MSSQLJDBC.java:221) at com.javaee.servletxm.comm.MSSQLJDBC.selectByFY(MSSQLJDBC.java:259) at com.javaee.servletxm.kqgl.KqManager.getAllKqxx(KqManager.java:38) at com.javaee.servletxm.kqgl.Kqwh.doGet(Kqwh.java:47) at javax.servlet.http.HttpServlet.service(HttpServlet.java:617) at javax.servlet.http.HttpServlet.service(HttpServlet.java:723) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:879) at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:617) at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1760) at java.lang.Thread.run(Thread.java:724) 这是具体的代码,求大神帮忙指正 package com.javaee.servletxm.comm; /** * jdbc下 SQL Server 2005 数据库的封装类 */ import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.sql.CallableStatement; import java.sql.Connection; import java.sql.Date; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.ResultSetMetaData; import java.sql.SQLException; import java.sql.Statement; import java.sql.Timestamp; import java.text.SimpleDateFormat; import java.util.List; import java.util.Properties; public class MSSQLJDBC { // 配置文件名称 private String iniFileName = MSSQLJDBC.class.getClassLoader().getResource("/com/javaee/servletxm/comm").getPath()+ "mssql.properties"; // 连接数据库 private String driver = "com.microsoft.sqlserver.jdbc.SQLServerDriver"; private String url = "jdbc:sqlserver://localhost;DatabaseName=jdms"; private String user = "sa"; private String password = ""; // 定义连接属性 private Connection connect = null; // 与连接有关三个通道 private Statement stmt = null; private PreparedStatement pstmt = null; private CallableStatement cstmt = null; public static final String stmtType = "stmt"; public static final String pstmtType = "pstmt"; public static final String cstmtType = "cstmt"; // 定义参数类型的静态常量值 public static final String varCharType = "varchar"; public static final String intType = "int"; public static final String doubleType = "decimal"; public static final String dateType = "datetime"; public static final String timeType = "timestamp"; // 定义全局的结果集 private ResultSet rs = null; // 在构造方法中对属性进行初始化赋值操作 public MSSQLJDBC() { // 读取配置文件 readIni(); // 初始化连接 initConnect(); } // 可配置文件 .properties // 读取配置文件 private void readIni() { File file = new File(iniFileName); if (!file.exists()) { // 创建一个文件 try { file.createNewFile(); } catch (IOException e) { e.printStackTrace(); } } // 判断文件是否有值 if (file.length() == 0) {// 说明是一个空文件 // 初始化值 try { Properties p = new Properties(); p.put("driver", driver); p.put("url", url); p.put("user", user); p.put("password", password); FileOutputStream fos = new FileOutputStream(file); p.store(fos, "配置文件信息"); fos.close(); } catch (IOException e) { e.printStackTrace(); } } else {// 如果有值 // 将信息读取出来 try { FileInputStream fis = new FileInputStream(file); Properties p = new Properties(); p.load(fis); this.driver = p.getProperty("driver"); this.url = p.getProperty("url"); this.user = p.getProperty("user"); this.password = p.getProperty("password"); fis.close(); } catch (IOException e) { e.printStackTrace(); } } } // 建立连接 private void initConnect() { try { Class.forName(driver); this.connect = DriverManager.getConnection(url, user, password); this.connect.setAutoCommit(false);// 设置手动提交事务 this.stmt = connect.createStatement(); } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (SQLException e) { e.printStackTrace(); } } /*/ 从tomcat缓冲池获取连接 private void initConnectFromDataSource() { try { InitialContext ic = new InitialContext(); DataSource ds = (DataSource) ic.lookup("java:comp/env/jdbc/oracleds"); this.connect = ds.getConnection(); this.connect.setAutoCommit(false); this.stmt = connect.createStatement(); } catch (NamingException e) { e.printStackTrace(); } catch (SQLException e) { e.printStackTrace(); } }*/ // 需要调用者控制事务的两个方法 // 提交方法 private void commit() { try { this.connect.commit(); } catch (SQLException e) { e.printStackTrace(); } } // 回滚事务 private void rollBack() { try { this.connect.rollback(); } catch (SQLException e) { e.printStackTrace(); } } // 定义一组与操作有关的方法 // 使用普通通道执行的select public ResultSet select(String sql) { ResultSet prs = null; if (stmt != null) { try { prs = stmt.executeQuery(sql); } catch (SQLException e) { e.printStackTrace(); } } return prs; } // 根据传入的sql直接获取单一值 // 使用此方法的时候sql语句返回的单一的值 public String selectFirstValue(String sql, String type, List<String> csList) { String rstr = ""; rs = select(sql, type, csList);// 确定此结果集只有一条记录 if (rs != null) {// 说明结果集有值,且只有一条记录 try { ResultSetMetaData rsmd = rs.getMetaData(); if (rs.next()) { // 移动到第一条记录 String p_type = rsmd.getColumnTypeName(1); rstr = getResultSetValue(rs, 1, p_type); } } catch (SQLException e) { e.printStackTrace(); } } return rstr; } // 使用普通通道执行的select /** * sql 参数 type 使用通道的类型 stmt pstmt cstmt List<String> csList 预编通道执行的参数队列 * String 最少必须满足如下条件的字符串 数据类型 ,数据值 数据类型定义说明 字符串 数字(整数、小数) 日期(DATE、TIMESTAMP) */ public ResultSet select(String sql, String type, List<String> csList) { ResultSet prs = null; if (type.equals(stmtType)) {// 说明使用普通通道来执行 prs = select(sql); } else if (type.equals(pstmtType)) {// 说明使用预编译通道来执行 if (connect != null) { try { pstmt = connect.prepareStatement(sql); // 验证传入的参数和sql中的参数个数一致 setPrepareStatement(pstmt, csList);// 将参数设置进当前的预编译通道 prs = pstmt.executeQuery(); } catch (Exception e) { e.printStackTrace(); } } } return prs; } // 获取 总页数 public int getPageNumber(String sql, String type, List<String> csList, int pageSize) { // 处理总页数 int pageNumber = 0; // 第一步获取sql总记录数 String psql = "select count(*) from (" + sql + ")"; String result = selectFirstValue(psql, type, csList); int rows = 0; if (result != null && result.trim() != "") { rows = Integer.valueOf(result); } if (rows % pageSize == 0) { pageNumber = rows / pageSize; } else { pageNumber = rows / pageSize + 1; } return pageNumber; } /** * 自动添加分页查询方法 * * @param sql * 要执行的sql * @param type * 执行方式 * @param csList * 参数列表 * @param curPage * 当前页数 * @param pageSize * 每页记录数 默认为10 * @return */ public ResultSet selectByFY(String sql, String type, List<String> csList, int curPage, int pageSize) { ResultSet prs = null; // 处理 每页记录数 if (pageSize <= 0) { pageSize = 10;// 默认页面10条记录 } int pageNumber = getPageNumber(sql, type, csList, pageSize); // 处理当前页数 if (curPage < 0) { curPage = 1;// 默认第一页 } if (curPage > pageNumber) { curPage = pageNumber; } String psql = "select tmpaa.* from (select tmpa.*,(select (ROW_NUMBER() over (order by id))) as rn from (" + sql + ") tmpa where (select (ROW_NUMBER() over (order by id))) <= " + (curPage * pageSize) + ") tmpaa where tmpaa.rn >= " + ((curPage - 1) * pageSize + 1); prs = select(psql, type, csList); return prs; } // 将预编通道执行的参数队列按照指定规则设置进通道中 private void setPrepareStatement(PreparedStatement p, List<String> csList) throws Exception { if (csList != null && csList.size() > 0) { for (int i = 0; i < csList.size(); i++) { // 此处的str是数据类型 ,数据值 // 解析出数据类型和数据值 String[] s = csList.get(i).split(","); String sType = s[0]; String sData = s[1]; if (varCharType.equals(sType)) { p.setString(i + 1, sData); } else if (intType.equals(sType)) { p.setInt(i + 1, Integer.valueOf(sData)); } else if(doubleType.equals(sType)){ p.setDouble(i+1, Double.valueOf(sData)); } else if (dateType.equals(sType)) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-mm-dd"); java.util.Date d = sdf.parse(sData); p.setDate(i + 1, new Date(d.getTime())); } else if (timeType.equals(sType)) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-mm-dd"); java.util.Date d = sdf.parse(sData); p.setTimestamp(i + 1, new Timestamp(d.getTime())); } } } } // 定义一个执行insert update delete的方法 public int iudSql(String sql) { int ri = -1; if (stmt != null) { try { ri = stmt.executeUpdate(sql); commit(); } catch (SQLException e) { e.printStackTrace(); rollBack(); } } return ri; } public int iudSql(String sql, String type, List<String> csList) { int ri = -1; if (stmtType.equals(type)) { ri = iudSql(sql); } else if (pstmtType.equals(type)) { if (connect != null) { try { pstmt = connect.prepareStatement(sql); setPrepareStatement(pstmt, csList); ri = pstmt.executeUpdate(); commit(); } catch (Exception e) { e.printStackTrace(); rollBack(); } } } return ri; } /** * 编写一个通用的遍历ResultSet结果集的方法 */ public void iteratorResultSet(ResultSet rs) { try { if (rs != null) {// 说明有值 // ResultSetMetaData 此对象里封装了与结果集有关所有信息 // 此结果有几列组成,每列的列名,每列的数据类型 ResultSetMetaData rsmd = rs.getMetaData(); // 得到结果集列数 int columnCount = rsmd.getColumnCount(); // 输出此结果集的所有列名 for (int i = 1; i <= columnCount; i++) { System.out.print(rsmd.getColumnName(i) + "\t"); } System.out.println(""); // 遍历输出所有的数据 while (rs.next()) { // 如何在获取rs中的数据? for (int i = 1; i <= columnCount; i++) { String type = rsmd.getColumnTypeName(i); System.out.print(getResultSetValue(rs, i, type) + "\t"); } System.out.println(""); } } } catch (SQLException e) { e.printStackTrace(); } } // 从ResultSet中根据数据类型来得到数据值的方法 // 先处理常用的sqlserver的数据类型的对应 private String getResultSetValue(ResultSet rs, int index, String type) { String rstr = ""; try { if (rs != null && !"".equals(type) && index > 0) { if ("char".equals(type.trim()) || "varchar".equals(type.trim())) { if (rs.getString(index) != null) { rstr = rs.getString(index); } } else if ("int".equals(type.trim())) { rstr = rs.getInt(index) + ""; } else if ("decimal".equals(type.trim())) { rstr = String.valueOf(rs.getDouble(index)); } else if ("date".equals(type.trim())) { Date date = rs.getDate(index); if (date != null) { rstr = new SimpleDateFormat("yyyy年MM月dd日").format(date); } } else if ("timestamp".equals(type.trim()) || "datetime".equals(type.trim())) { Timestamp tt = rs.getTimestamp(index); if (tt != null) { rstr = new SimpleDateFormat("yyyy年MM月dd日 HH时mm分ss秒").format(tt); } } } } catch (SQLException e) { e.printStackTrace(); } return rstr; } /* //统一事务管理的批量sql的封装 public boolean iudSql(List<String> sqlList){ int ri = -1; if(stmt!=null){ try { ri = stmt.executeUpdate(sql); commit(); } catch (SQLException e) { e.printStackTrace(); rollBack(); } } return ri; }*/ // 关闭连接 public void close() { try { // 关闭所有的与数据库有关的对象 if (rs != null) { rs.close(); rs = null; } if (stmt != null) { stmt.close(); stmt = null; } if (pstmt != null) { pstmt.close(); pstmt = null; } if (cstmt != null) { cstmt.close(); cstmt = null; } if (connect != null) { connect.close(); connect = null; } } catch (SQLException e) { e.printStackTrace(); } } }

从PHP执行时SQL Server查询不起作用

<div class="post-text" itemprop="text"> <p>I've got a set of <code>triggers</code> in my table in <code>SQL Server</code> and when I execute the queries in <code>SQL Server Management Studio</code> they work fine. But when they're executed from my <code>php</code> files they doesn't take effect. I used <code>SQL Server Profiler</code> and the trigger gets to the last line of execution that is the insert in my log table but then after this I get an <code>Attention</code> error. Here's my trigger for a delete statement:</p> <pre><code>SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO -- Batch submitted through debugger: SQLQuery25.sql|7|0|C:\Users\ADMINI~1\AppData\Local\Temp\3\~vsB4EE.sql ALTER TRIGGER [dbo].[OperationStructureFields_delete] ON [dbo].[OperationStructureFields] FOR DELETE AS BEGIN DECLARE @id INT, @result varchar(MAX), @user varchar(MAX), @LoopCounter INT = 1, @MAX INT, @Column NVARCHAR(100), @Type NVARCHAR(100), @Value NVARCHAR(100), @ValueXML xml, @Sql NVARCHAR(MAX), @Tmp NVARCHAR(MAX), @LoopCounter2 INT = 1, @MAX2 INT, @Message nvarchar(2048) SELECT @user = system_user SELECT @MAX = MAX(ORDINAL_POSITION) FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'OperationStructureFields' SELECT @MAX2 = MAX(ID) FROM deleted SELECT @LoopCounter2 = MIN(ID) FROM deleted Select * into #deleted from deleted WHILE(@LoopCounter2 &lt;= @MAX2) BEGIN SET @LoopCounter = 1 SET @result = '{' WHILE(@LoopCounter &lt;= @MAX) BEGIN SELECT @Column = COLUMN_NAME, @Type = DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE ORDINAL_POSITION = @LoopCounter and TABLE_NAME = 'OperationStructureFields' if (@Type = 'xml') BEGIN SET @Sql = 'SELECT @ValueXML = ' + @Column + ' FROM #deleted where ID=' + CONVERT(varchar(200),@LoopCounter2,0) exec sp_executesql @Sql, N'@ValueXML xml out', @ValueXML out SET @Value = CONVERT(VARCHAR(MAX),@ValueXML,0) END ELSE BEGIN SET @Sql = 'SELECT @Value = ' + @Column + ' FROM #deleted where ID=' + CONVERT(varchar(200),@LoopCounter2,0) exec sp_executesql @Sql, N'@Value varchar(MAX) out', @Value out END IF (@Value is not null or @Value != '') and (@Type = 'datetime2' or @Type = 'datetime' or @Type = 'date') BEGIN IF @result = '{' BEGIN SET @result = @result + ' "' + @Column + '":"' + CONVERT(VARCHAR(20),@Value,120) + '"' END ELSE BEGIN SET @result = @result + ', "' + @Column + '":"' + CONVERT(VARCHAR(20),@Value,120) + '"' END END ELSE IF (@Value is not null or @Value != '') BEGIN IF @result = '{' BEGIN SET @result = @result + ' "' + @Column + '":"' + @Value + '"' END ELSE BEGIN SET @result = @result + ', "' + @Column + '":"' + @Value + '"' END END SET @LoopCounter = @LoopCounter + 1 END SET @result = @result + '}' INSERT INTO sys_logs (username,datahora,tabela,[object_id],[action],oldvalue) values (@user,GETDATE(),'OperationStructureFields',@LoopCounter2,'DELETE',@result) delete from #deleted where ID = @LoopCounter2 select @LoopCounter2 = MIN(ID) from #deleted where ID &gt; @LoopCounter2 END END </code></pre> <p>And a print of my SQL Server Profiler:</p> <p><a href="https://i.stack.imgur.com/X9Mjb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/X9Mjb.png" alt="Prt Screen do SQL Server Profiler"></a></p> <p>The PHP code is:</p> <pre><code>$res = sqlsrv_query($connection, $_sql, array(), array('Scrollable' =&gt; 'buffered')); </code></pre> <p>and the variable <code>$_sql</code> has the following value:</p> <pre><code>DELETE FROM OperationStructureFields WHERE ID= '66817' </code></pre> <p>And it doesn't return any errors.</p> <p>The PHP version is <code>5.5.16</code>.</p> <p>I executed the <code>SELECT @@OPTIONS</code> inside my php file and got the following options:</p> <pre><code>ANSI_WARNINGS ANSI_PADDING ANSI_NULLS QUOTED_IDENTIFIER ANSI_NULL_DFLT_ON CONCAT_NULL_YIELDS_NULL </code></pre> <p>The only difference to the SQL Server Management Studio is the option <code>ARITHABORT</code> that is <code>ON</code> in the SQL Server Management Studio.</p> <p>Do you have any ideia what may be causing this?</p> <p>UPDATES:</p> <p>I believe it may be something on my PHP settings. In my <code>phpinfo()</code> I've got the following settings for <code>sqlsrv</code>:</p> <p><a href="https://i.stack.imgur.com/n6Y8Z.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/n6Y8Z.png" alt="phpinfo();"></a></p> <p>Also in <code>SQL Server Profiler</code> I've got the following definitions in <code>Audit Login</code>:</p> <pre><code>-- network protocol: LPC set quoted_identifier on set arithabort off set numeric_roundabort off set ansi_warnings on set ansi_padding on set ansi_nulls on set concat_null_yields_null on set cursor_close_on_commit off set implicit_transactions off set language us_english set dateformat mdy set datefirst 7 set transaction isolation level read committed </code></pre> </div>

如何在NULL字段中插入VARCHAR数据

<div class="post-text" itemprop="text"> <p>I have a database in which there are <code>NOT NULL</code> and <code>NULL</code> fields (the <code>NULL</code>s are of the <code>VARCHAR</code> type).<br> When I try to enter data in the <code>NULL</code> fields via my query, it does not insert them.<br> The data isn't entered all at the same time: </p> <ul> <li>with a form I insert the data in the <code>NOT NULL</code> fields </li> <li>with another form insert the data in the <code>NULL</code> fields.</li> </ul> <p>Why doesn't the query for entering data in the <code>NULL</code> fields sork?   I tried to find an answer to similar questions, but they don't work or are not suitable for my problem:</p> <ol> <li><p><a href="https://stackoverflow.com/questions/20671853/mysql-insert-select-not-null-fields">MySQL Insert Select - NOT NULL fields</a></p></li> <li><p><a href="https://stackoverflow.com/questions/24391566/insert-null-into-date-field-mysql-5-6">Insert NULL into DATE field MySQL 5.6</a></p></li> </ol> <p>FIRST FORM register.php</p> <pre><code>&lt;?php if($_SERVER['REQUEST_METHOD']=='POST'){ // echo $_SERVER["DOCUMENT_ROOT"]; // /home1/demonuts/public_html //including the database connection file include_once("config.php"); $id_akR = $_POST['id_akR']; $numero_telefonoR = $_POST['numero_telefonoR']; if($id_akR == '' || $numero_telefonoR == '' ){ echo json_encode(array( "status" =&gt; "false","message" =&gt; "Parameter missing!") ); }else{ $query= "SELECT * FROM RistoratoreAK WHERE id_akR='$id_akR' OR numero_telefonoR ='$numero_telefonoR' "; $result= mysqli_query($con, $query); $query2 = "SELECT ak_id, numero_telefono FROM AccountKit WHERE ak_id = '$id_akR' OR numero_telefono = '$numero_telefonoR'"; $result2= mysqli_query($con, $query2); if(mysqli_num_rows($result) &gt; 0){ echo json_encode(array( "status" =&gt; "false","message" =&gt; "User already exist in Ristoratore!") ); }else if(mysqli_num_rows($result2) &gt; 0) { echo json_encode(array( "status" =&gt; "false","message" =&gt; "User already exist in Cliente!") ); }else{ $query = "INSERT INTO RistoratoreAK (id_akR, numero_telefonoR) VALUES ('$id_akR','$numero_telefonoR')"; if(mysqli_query($con,$query)){ $query= "SELECT * FROM RistoratoreAK WHERE numero_telefonoR ='$numero_telefonoR'"; $result= mysqli_query($con, $query); $emparray = array(); if(mysqli_num_rows($result) &gt; 0){ while ($row = mysqli_fetch_assoc($result)) { $emparray[] = $row; } } echo json_encode(array( "status" =&gt; "true","message" =&gt; "Successfully registered!" , "data" =&gt; $emparray) ); }else{ echo json_encode(array( "status" =&gt; "false","message" =&gt; "Error occured, please try again!") ); } } mysqli_close($con); } } else{ echo json_encode(array( "status" =&gt; "false","message" =&gt; "Error occured, please try again!") ); } ?&gt; </code></pre> <p><em>SECOND FORM register2.php</em></p> <pre><code>&lt;?php if($_SERVER['REQUEST_METHOD']=='POST'){ include 'config2R.php'; $con = mysqli_connect($HostName,$HostUser,$HostPass,$DatabaseName); $nome = $_POST['nomeR']; $cognome = $_POST['cognomeR']; $data_nascita = $_POST['data_nascitaR']; $sesso = $_POST['sessoR']; $nome_ristorante = $_POST['nome_ristoranteR']; $CheckSQL = "SELECT nome_ristorante FROM RistoratoreAK WHERE nome_ristorante='$nome_ristorante'"; $check = mysqli_fetch_array(mysqli_query($con,$CheckSQL)); if(isset($check)){ echo 'Ristorante già registrato'; } else{ $Sql_Query = "INSERT INTO RistoratoreAK (nomeR,cognomeR,data_nascitaR,sessoR,nome_ristorante) values ('$nome','$cognome','$data_nascita','$sesso','$nome_ristorante')"; if(mysqli_query($con,$Sql_Query)) { echo 'Registration Successfully'; } else { echo 'Something went wrong'; } } } mysqli_close($con); ?&gt; </code></pre> <p>My DB contains a table called "RistoratoreAK", the fields are :</p> <pre><code> id INT PrimaryKey id_ak VARCHAR NOT NULL number VARCHAR NOT NULL nomeR VARCHAR NULL cognomeR VARCHAR NULL sessoR VARCHAR NULL data_nascitaR VARCHAR NULL nome_ristorante VARCHAR NULL </code></pre> <p><em>note: Excuse me if the code isn't secure (I didn't use PDO), this code is just a test to learn how to upload data to the database.</em> </p> </div>

在SQL Server中将datetime列的默认值设置为24h格式

<div class="post-text" itemprop="text"> <p>I want to set the default value of my "Date" column (using getdate() by exemple) to be stored in 24h and not in 12h format.</p> <p>In my SQL Server database I set the default value to be : getdate(). In the database it displays like I want it in 24h format : <code>22/06/2016 10:46:00</code></p> <p>But when I get this value in my php website I get the following value : <code>Jun 22 2016 10:46:00:000AM</code></p> <p>I know that there are ways to convert for what I want like : <code>SELECT CONVERT(VARCHAR(24), GETDATE(), 113)</code></p> <p>But I can't set this query to be the default value of my "Date" column.</p> </div>

SQL中,添加一个条件后,执行效率瞬间下降,怎么优化

此SQL语句为查询数据库中,当前月,前一月,前两月数据,但是where中加了一个条件后,查找时间从2秒延长至50秒左右,请问造成这种状况的原因是什么?以及有什么优化方法? SELECT TR.RC_NO, TR.FEE_TYPE, TR.FISCAL_PERIOD,--月份 MIN (DATE_START) CUR_DATE_START, MAX (DATE_END) CUR_DATE_END, CONVERT(VARCHAR(30),CAST(SUM(ISNULL(FEE_ACTUAL,0))/ 10000 AS decimal(18,2)),1) AS CUR_FEE_ACTUAL, replace(SUBSTRING ( CAST (DATEADD(m ,- 1, CAST (TR.FISCAL_PERIOD + '01' AS DATE)) AS VARCHAR),1,7),'-','') AS PRE_FISCAL_PERIOD, PRE.PRE_DATE_START, PRE.PRE_DATE_END, PRE.PRE_FEE_ACTUAL, replace(SUBSTRING ( CAST (dateadd(m ,- 2, CAST (TR.FISCAL_PERIOD + '01' AS DATE)) AS VARCHAR),1,7),'-','') AS BEF_FISCAL_PERIOD, BEF.BEF_DATE_START, BEF.BEF_DATE_END, BEF.BEF_FEE_ACTUAL FROM T_AP_PAYMENT_REQUEST TR LEFT JOIN ( SELECT TP.RC_NO,TP.FEE_TYPE, TP.FISCAL_PERIOD, MIN (DATE_START) PRE_DATE_START, MAX (DATE_END) PRE_DATE_END, CONVERT(VARCHAR(30),CAST(SUM(ISNULL(FEE_ACTUAL,0))/ 10000 AS decimal(18,2)),1) AS PRE_FEE_ACTUAL FROM T_AP_PAYMENT_REQUEST TP WHERE IS_DELETE = '0' AND IS_AUTO_PAY = 'D00002' AND ISNULL(IS_FIRST_PAY, '') != 'D00002' AND PR_STATUS != 'L04301' GROUP BY TP.RC_NO, TP.FEE_TYPE, TP.FISCAL_PERIOD ) PRE ON PRE.RC_NO = TR.RC_NO AND PRE.FEE_TYPE=TR.FEE_TYPE LEFT JOIN ( SELECT TA.RC_NO,TA.FEE_TYPE, TA.FISCAL_PERIOD, MIN (DATE_START) BEF_DATE_START, MAX (DATE_END) BEF_DATE_END, CONVERT(VARCHAR(30),CAST(SUM(ISNULL(FEE_ACTUAL,0))/ 10000 AS decimal(18,2)),1) AS BEF_FEE_ACTUAL FROM T_AP_PAYMENT_REQUEST TA WHERE IS_DELETE = '0' AND IS_AUTO_PAY = 'D00002' AND ISNULL(IS_FIRST_PAY, '') != 'D00002' AND PR_STATUS != 'L04301' GROUP BY TA.RC_NO, TA.FEE_TYPE, TA.FISCAL_PERIOD ) BEF ON BEF.RC_NO = TR.RC_NO AND BEF.FEE_TYPE=TR.FEE_TYPE WHERE TR.FISCAL_PERIOD='201701' --此语句为添加的条件 AND PRE.FISCAL_PERIOD = replace(SUBSTRING (CAST (dateadd(m ,- 1,CAST (TR.FISCAL_PERIOD + '01' AS DATE)) AS VARCHAR),1,7),'-','') AND BEF.FISCAL_PERIOD = replace(SUBSTRING (CAST (dateadd(m ,- 2,CAST (TR.FISCAL_PERIOD + '01' AS DATE)) AS VARCHAR),1,7),'-','') AND TR.IS_DELETE = '0' AND TR.IS_AUTO_PAY = 'D00002' AND ISNULL(TR.IS_FIRST_PAY, '') != 'D00002' AND TR.PR_STATUS != 'L04301' GROUP BY TR.RC_NO, TR.FEE_TYPE, TR.FISCAL_PERIOD, PRE.PRE_DATE_START, PRE.PRE_DATE_END, PRE.PRE_FEE_ACTUAL, BEF.BEF_DATE_START, BEF.BEF_DATE_END, BEF.BEF_FEE_ACTUAL ORDER BY TR.RC_NO, TR.FEE_TYPE, TR.FISCAL_PERIOD 代码需要注释的,直接问就可以了

SQL插入日期始终为NULL

<div class="post-text" itemprop="text"> <p>I'm trying to use an upload page to insert into my database with the following code:</p> <pre><code>if($file!=="") { echo "&lt;br/&gt;".$file; $handle = fopen($file, "r"); $row = 0; $delete_records = mysql_query("DELETE FROM affiliationagreements"); $delete_records = mysql_query("DELETE FROM college"); $delete_records = mysql_query("DELETE FROM program"); $delete_records = mysql_query("DELETE FROM facility"); $delete_records = mysql_query("DELETE FROM submitor"); $delete_records = mysql_query("DELETE FROM location"); //will loop each record in the CSV file while(($fileop = fgetcsv($handle,1000,",")) !== false ) { //columns names of the CSV file are not needed if($row==0) { $row++; } else { //accept apostrophes in the strings $fileop = array_map("mysql_real_escape_string",$fileop); $sql = mysql_query("INSERT INTO affiliationagreements(id, AANumber, Facility, Submitor, Program, Location, College, SubmissionDate, Action, EffectiveDate, Status, ExpirationDate) VALUES('', '$fileop[0]', '$fileop[1]', '$fileop[2]', '$fileop[3]', '$fileop[4]', '$fileop[5]', '$fileop[11]', '$fileop[23]', '$fileop[24]', '$fileop[25]', '$fileop[26]') ")or die(mysql_error()); </code></pre> <p>To just give a sample, and when I upload my CSV file to add the values, I print them out in the console and see that the values are being read correctly and they are. But, once my php script ends and I return to the main page, my dates are all null. None of them are the values what are reflected in the csv file. Here is the schema for my database:</p> <pre><code>CREATE TABLE `affiliationagreements` ( `id` int(11) NOT NULL AUTO_INCREMENT, `AANumber` varchar(20) DEFAULT NULL, `Facility` varchar(150) DEFAULT NULL, `Submitor` varchar(50) DEFAULT NULL, `Program` varchar(60) DEFAULT NULL, `Location` varchar(50) DEFAULT NULL, `College` varchar(50) DEFAULT NULL, `SubmissionDate` date DEFAULT NULL, `Action` varchar(50) DEFAULT NULL, `EffectiveDate` date DEFAULT NULL, `Status` varchar(50) DEFAULT NULL, `ExpirationDate` date DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; </code></pre> <p>If I change SubmissionDate, EffectiveDate, and ExpirationDate to a varchar, they insert correctly but I can't use varchar because I am comparing date values. And Advice?</p> <p>***Update. In the CSV file, the format is MM/DD/YYYY. I didn't think this would be a problem. Would it be better to change this? And I'm deleting records because my boss wanted the DB cleared before a file was reuploaded since the uploaded file was an update of the previously uploaded one. ****</p> </div>

sqlserver数据库怎样优化代码

select c.participant_name, c.login_id, @year as y, datepart(MONTH,receive_date) as m, b.phase_name as lc, m.manu_number as gh, max(datediff(day, m.submit_date, a.submit_date)) as t from manuflow a left join review_phase b on a.phase_id=b.phase_id left join participant c on a.submitter_id=c.participant_id,manuscript m where (@editor='' or c.participant_name=@editor) and receive_date>=(@year+'-1-1') and receive_date<( cast(cast(@year as int)+1 as varchar(4))+'-1-1' ) and not c.login_id is null and not c.participant_name is null and a.submit_date >= (@year+'-1-1') and a.submit_date<( cast(cast(@year as int)+1 as varchar(4))+'-1-1' ) and m.submit_date >= (@year+'-1-1') and m.submit_date<( cast(cast(@year as int)+1 as varchar(4))+'-1-1' ) and m.submit_date <= a.submit_date and b.phase_name = 'szs' and m.manu_number in(select manu_number from #GH) group by b.phase_name,m.manu_number,c.participant_name,c.login_id,datepart(MONTH,receive_date) order by c.participant_name,c.login_id,datepart(MONTH,receive_date),b.phase_name,m.manu_number,max(datediff(day, m.submit_date, a.submit_date)) **怎么能让它运行的更快一些**

Mysql建表显示错误,Error : You have an error in your SQL syntax;(急!!!)

create TABLE ProductIns (product_id char(4) NOT FULL, product_name VARCHAR(100) NOT FULL, product_type varchar(32) NOT FULL, sale_price INTEGER DEFAULT 0, purchase_price INTEGER , regist_date INTEGER , PRIMARY KEY (product_id)); 在mysql创建上面这么一个表格显示错误: Error : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FULL, product_name VARCHAR(100) NOT FULL, product_type varchar(32) NOT ' at line 2 请问问题是出在哪里了

查询SQL数据只显示第一条不能全部显示

<!--#include file="conn.asp"--> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>现住客人房费一表</title> <base target="main"> </head> <body> <% DataServer = "lx" DataUser = "sa" DataBaseName = "hy2006qt" DataBasePsw = "" Set conn = Server.CreateObject("ADODB.Connection") ConnStr="driver={SQL Server};server="&dataserver&";UID="&datauser&";PWD="&databasepsw&";Database="&databasename conn.open ConnStr Set rs=Server.CreateObject("ADODB.RecordSet") dim rs,sql,scount //sql="select * from Trans WHERE (YEAR([Date]) = YEAR({ fn NOW() })) AND (MONTH([Date]) = MONTH({ fn NOW() })) AND (DAY([Date]) = DAY({ fn NOW() }))" sql="select * from Trans WHERE (Room > 301) AND (Room < 711)" //sql="select * from Trans WHERE (TransCode <= 2)" //sql="select * from Trans WHERE (Amount < 80)" //sql="select * from Trans WHERE (Amount > 500)" //sql="SELECT m.* FROM Trans m INNER JOIN (SELECT date, room, amount, transcode, COUNT(*) cnt FROM trans WHERE date = CONVERT(varchar(100), GETDATE(), 23) AND transcode <= 2 GROUP BY date, room, amount, transcode) t ON m.Room = t.room AND m.Amount = t.amount AND m.TransCode = t.transcode AND m.[Date] = t.[date] WHERE (t.cnt > 1)" //BOF 或 EOF 中有一个是“真”,或者当前的记录已被删除,所需的操作要求一个当前的记录。/hycom/hyquery/foom.asp,行 0 //sql="select distinct(trans),date,room,transcode,amount feom indent where room=0 order by id desc" rs.Open sql,conn,1,1 scount = rs.recordcount set aa=conn.execute(sql) set bb=conn.execute(sql) set cc=conn.execute(sql) set dd=conn.execute(sql) set ee=conn.execute(sql) set ff=conn.execute(sql) response.write "<table border="&chr(34)&"1"&chr(34)&" width="&chr(34)&"980"&chr(34)&" heifgt="&chr(34)&"46"&chr(34)&" id="&chr(34)&"table1"&chr(34)&">" response.write "<tr>" response.write "<td width="&chr(34)&"150"&chr(34)&" height="&chr(34)&"14"&chr(34)&" align="&chr(34)&"center"&chr(34)&">日期</td>" response.write "<td width="&chr(34)&"150"&chr(34)&" height="&chr(34)&"14"&chr(34)&" align="&chr(34)&"center"&chr(34)&">房号</td>" response.write "<td width="&chr(34)&"150"&chr(34)&" height="&chr(34)&"14"&chr(34)&" align="&chr(34)&"center"&chr(34)&">账项</td>" response.write "<td width="&chr(34)&"150"&chr(34)&" height="&chr(34)&"14"&chr(34)&" align="&chr(34)&"center"&chr(34)&">房费小于80</td>" response.write "<td width="&chr(34)&"150"&chr(34)&" height="&chr(34)&"14"&chr(34)&" align="&chr(34)&"center"&chr(34)&">房费大于500</td>" response.write "</tr>" %> //<%do while not rs.eof%> <% response.write "<tr>" response.write "<td height="&chr(34)&"14"&chr(34)&" width="&chr(34)&"150"&chr(34)&">"&aa("date")&"</td>" response.write "<td height="&chr(34)&"14"&chr(34)&" width="&chr(34)&"150"&chr(34)&">"&bb("room")&"</td>" response.write "<td height="&chr(34)&"14"&chr(34)&" width="&chr(34)&"150"&chr(34)&">"&cc("transcode")&"</td>" response.write "<td height="&chr(34)&"14"&chr(34)&" width="&chr(34)&"150"&chr(34)&">"&dd("amount")&"</td>" response.write "<td height="&chr(34)&"14"&chr(34)&" width="&chr(34)&"150"&chr(34)&">"&scount&"</td>" response.write "<tr/>" rs.movenext loop rs.close set rs=nothing %> <% response.write "</table>" %> </body> </html> 注:sql="select * from Trans WHERE (Room > 301) AND (Room < 711)" 这个查询的结果只显示第一条,怎么修改才能全部显示。

错误代码: 1064 You have an error in your SQL syntax;

求高手指点 语法哪里有问题啊 DELIMITER $$ CREATE /*[DEFINER = { user | CURRENT_USER }]*/ PROCEDURE `x_similarity`.`CovarianceEngine`() /*LANGUAGE SQL | [NOT] DETERMINISTIC | { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA } | SQL SECURITY { DEFINER | INVOKER } | COMMENT 'string'*/ BEGIN /* 定义变量一 */ DECLARE done, done2 INT DEFAULT 0; DECLARE stockNo_a VARCHAR(6); DECLARE coefficient DOUBLE(16,14); /* 定义光标 */ DECLARE _Cur CURSOR FOR SELECT DISTINCT stock_no FROM history_day; DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET done = 1;#错误定义,标记循环结束 /* 打开光标 */ OPEN _Cur; /* 循环执行 */ REPEAT FETCH _Cur INTO stockNo_a; IF NOT done THEN BEGIN /* 定义变量一 */ DECLARE stockNo_b VARCHAR(6); /* 定义光标 */ DECLARE _CurInner CURSOR FOR SELECT DISTINCT stock_no FROM history_day; OPEN _CurInner; REPEAT FETCH _CurInner INTO stockNo_b; IF NOT done2 THEN SELECT ( AVG(a. CLOSE * b. CLOSE) - AVG(a. CLOSE) * AVG(b. CLOSE) ) / SQRT( ( AVG(a. CLOSE * a. CLOSE) - AVG(a. CLOSE) * AVG(a. CLOSE) ) * ( AVG(b. CLOSE * b. CLOSE) - AVG(b. CLOSE) * AVG(b. CLOSE) ) ) INTO coefficient FROM history_day a, history_day b WHERE a.date = b.date AND a.date >= '2015-08-05' AND a.date <= '2015-08-11' AND a.stock_no = stockNo_a AND b.stock_no = stockNo_b; IF coefficient > 0.5 OR coefficient < -0.5 THEN INSERT INTO correlationanalysis (stock_no_f, stock_no_r, coefficient) VALUES(stockNo_a, stockNo_b, coefficient); COMMIT; END IF; END IF; UNTIL done2 END REPEAT; CLOSE _CurInner; SET done2 = 0; END END IF; UNTIL done END REPEAT; CLOSE _Cur; END$$ DELIMITER ; 错误代码: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'END IF; UNTIL done END REPEAT; CLOSE _Cur; END' at line 65

PDO ODBC为列值返回null,但odbc_conect不返回

<div class="post-text" itemprop="text"> <p>For some weird reason, my PDO keeps returning NULL when it should return a string/integer. I've tried to use the <code>odbc_conect</code> and it works fine.</p> <p>Context:</p> <ul> <li>CentOS 7</li> <li>PHP 7.1.13 </li> <li>unixODBC 2.3.1 (x86_64 . 11.el7)</li> <li>ODCB Driver: SAP HANA ODBC v2.2.36.1512099132 64 bits</li> </ul> <p>When it's happening? Until now, I detected few:</p> <ul> <li>Function returns: <code>SELECT id,GEO.ST_Asgeojson() FROM DEV.GEOMETRIES</code></li> <li>Using CAST: <code>SELECT id, CAST(GEO.ST_AsText() AS VARCHAR) FROM DEV.GEOMETRIES</code> or <code>SELECT CAST(1 AS INTEGER) AS "int" FROM DUMMY</code> </li> <li>Any blob column : <code>SELECT id,GEO FROM DEV.GEOMETRIES</code></li> <li>Date Types: <code>SELECT insertdate FROM DEV.GEOMETRIES</code></li> </ul> <p>I also tried to use <a href="http://php.net/manual/en/pdostatement.bindcolumn.php" rel="nofollow noreferrer">PDOStatement::bindColumn</a> to force data types but was unsuccessful</p> <p>Where the code :</p> <pre><code>&lt;?php try{ ini_set('memory_limit','256M'); //odbc_fetch_array is hungry // $sql = 'SELECT NOW() AS "now" FROM DUMMY'; $sql = "SELECT id,GEO.ST_Asgeojson(),GEO.ST_AsText(),insertdate FROM DEV.geometries limit 1"; //$sql = "SELECT * FROM DEV.geometries limit 1"; // $sql = "SELECT CAST(GEO.ST_AsText() AS VARCHAR) from geometries"; // $sql = "SELECT CAST(10 AS VARCHAR) from DUMMY"; // $sql = "SELECT CAST(10 AS INTEGER) from DUMMY"; echo "SQL: ",$sql,PHP_EOL; $DSN = "DRIVER=HANADB;UID=DEV;PWD=DEV@pwd;SERVERNODE=192.168.1.163:39013;DATABASENAME=SYSTEMDB"; $options = [ \PDO::ATTR_ERRMODE =&gt; \PDO::ERRMODE_EXCEPTION, \PDO::ATTR_CASE =&gt;\PDO::CASE_LOWER, //Compatibility with mysql case \PDO::ATTR_DEFAULT_FETCH_MODE =&gt; \PDO::FETCH_ASSOC, \PDO::ATTR_EMULATE_PREPARES, true //With or without ]; echo "############# Using PDO:ODBC:",PHP_EOL; $DB = new \PDO("odbc:".$DSN,'DEV','DEV@pwd',$options); echo "Driver: ",$DB-&gt;getAttribute(\PDO::ATTR_CLIENT_VERSION),PHP_EOL; echo "Using Prepared Statement:",PHP_EOL; $stmt = $DB-&gt;prepare($sql); // bindColumn Also doesn't work //$stmt-&gt;bindColumn('id', $id, \PDO::PARAM_INT); //$stmt-&gt;bindColumn('geojson', $geometry, \PDO::PARAM_STR); $stmt-&gt;execute(); /*while ($row = $stmt-&gt;fetch(\PDO::FETCH_BOUND)) { var_dump($row); var_dump($id, $geometry); }*/ //var_dump($ret,$stmt); var_export($stmt-&gt;fetchAll()); $stmt-&gt;closeCursor(); echo PHP_EOL,"Using Query:",PHP_EOL; $qR = $DB-&gt;query($sql); foreach($qR as $row){ var_export($row); } echo PHP_EOL,PHP_EOL,"############# Using odbc_*( ) Functions",PHP_EOL; $conn = odbc_connect($DSN,'DEV','DEV@pwd'); $rs = odbc_exec($conn,$sql); while($row = odbc_fetch_array($rs)){ var_export($row); } }catch(\Exception $e){ echo $e-&gt;getMessage(),PHP_EOL,$e-&gt;getTraceAsString(); } </code></pre> <p>Output:</p> <pre><code>############# Using PDO:ODBC: Using Prepared Statement: array ( 0 =&gt; array ( 'id' =&gt; '363491', 'geojson' =&gt; NULL, 'geotext' =&gt; NULL, '__dateinsert' =&gt; NULL, 'info' =&gt; NULL, ), ) Using Query: array ( 'id' =&gt; '363491', 'geojson' =&gt; NULL, 'geotext' =&gt; NULL, 'insertdate' =&gt; NULL, 'info' =&gt; NULL, ) ############# Using odbc_*( ) Functions array ( 'id' =&gt; '363491', 'geojson' =&gt; '{"type": "Point", "coordinates": [16.352878, 48.225628]}', 'geotext' =&gt; 'POINT (16.352878 48.225628)', 'insertdate ' =&gt; '2018-02-06 15:08:19.414000000', 'info' =&gt; NULL, ) </code></pre> <p>I'm not sure if it's a Drive problem because it works with <code>odbc_*</code> functions, maybe it's a PDO BUG. </p> </div>

SQL-JOIN错误=>多个表中的相同列名

<div class="post-text" itemprop="text"> <p>I have some trouble trying to join a couple of tables for a time-booking system.</p> <p>The database look like this:</p> <h2><strong>Database tables:</strong></h2> <p>tbl_events</p> <pre><code>- int_eventID (INT) - int_serviceID (INT) - date_eventDueDate (DATETIME) - date_eventCreationDate (DATETIME) - int_userID (INT) - int_customerID (INT) - int_eventOnlineBooked (INT) </code></pre> <p>tbl_customers</p> <pre><code>- int_customerID (INT) &gt;&gt;&gt; - int_userID (INT) &lt;= this one gives me headache &lt;&lt; - str_customerFirstName (VARCHAR) - str_customerLastName (VARCHAR) - str_customerEmail (VARCHAR) - str_customerPassword (VARCHAR) - str_customerCellPhone (VARCHAR) - str_customerHomePhone (VARCHAR) - str_customerAddress (VARCHAR) </code></pre> <p>tbl_services</p> <pre><code>int_serviceID (INT) str_serviceName (VARCHAR) str_serviceDescription (VARCHAR) int_servicePrice (INT) int_serviceTimescale (TIME) </code></pre> <p>tbl_users</p> <pre><code>int_userID (INT) str_userFirstName (VARCHAR) str_userLastName (VARCHAR) str_userEmail (VARCHAR) str_userPassword (VARCHAR) str_userCellPhone (VARCHAR) </code></pre> <hr> <p>I've got everything to work as expected by the SQL-query (see below). It gives me all events for a specific "user" during a specific week.</p> <h2><strong>SQL query:</strong></h2> <pre><code>SELECT int_customerID as customerID, int_serviceID as serviceID, int_eventID as eventID, date_eventDueDate as eventDueDate, date_eventCreationDate as eventCreationDate, int_eventOnlineBooked as eventOnlineBooked, str_serviceName as serviceName, int_serviceTimescale as serviceTimescale, str_customerFirstName as customerFirstName, str_customerLastName as customerLastName, str_customerCellPhone as customerCellPhone, str_customerHomePhone as customerHomePhone FROM tbl_events JOIN tbl_services USING (int_serviceID) JOIN tbl_customers USING (int_customerID) WHERE int_userID = 1 AND YEARWEEK(date_eventDueDate,1) = 201219 </code></pre> <hr> <p>The problem is, I didn't had a column in the tbl_customers table that specified which user that customer belongs to. When I added "int_userID" to tbl_customers the SQL-stopped working and gave me the error message:</p> <pre><code>&lt;b&gt;Warning&lt;/b&gt;: mysql_num_rows() expects parameter 1 to be resource, boolean given in &lt;b&gt;/Library/WebServer/Documents/calendar/api/calender_getWeekGetEvents.php&lt;/b&gt; on line &lt;b&gt;46&lt;/b&gt;&lt;br /&gt; </code></pre> <p>Line 46:</p> <pre><code>if(mysql_num_rows($result)) { while($event = mysql_fetch_assoc($result)) { $events[] = $event; } } </code></pre> <p>Any ideas? :)</p> <p>Thanks / L</p> </div>

PHP SQL Server查询运行不在PHP中工作

<div class="post-text" itemprop="text"> <p>I currently have a query that is working in MS SQL Server Management studio, without any problems, when i run the query in php it just doesn't return anything. </p> <p>Here is the query and PHP code </p> <pre><code> Public function GetClockedHours() { $conn = odbc_connect('easydo', '', ''); if (!$conn) { exit("Connection Failed: " . $conn); } var_dump($conn); $sql = " WITH ByDays AS ( SELECT CHINA_VISION_DorEvents.EventTm AS T, CONVERT(VARCHAR(10),CHINA_VISION_DorEvents.EventTm,102) AS Day, FLOOR(CONVERT(FLOAT,CHINA_VISION_DorEvents.EventTm)) DayNumber, ROW_NUMBER() OVER(PARTITION BY FLOOR(CONVERT(FLOAT,CHINA_VISION_DorEvents.EventTm)) ORDER BY CHINA_VISION_DorEvents.EventTm) InDay FROM CHINA_VISION_DorEvents Where CHINA_VISION_DorEvents.DorCtrls_Ref = '16' AND CHINA_VISION_DorEvents.CardCode = '000006f1' AND CONVERT(Date,CHINA_VISION_DorEvents.EventTm) &gt; dateadd(day, -7, getdate()) ) ,Diffs AS ( SELECT E.Day, E.T ET, O.T OT, O.T-E.T Diff, DATEDIFF(S,E.T,O.T) DiffSeconds -- difference in seconds FROM (SELECT BE.T, BE.Day, BE.InDay FROM ByDays BE WHERE BE.InDay % 2 = 1) E -- Even rows INNER JOIN (SELECT BO.T, BO.Day, BO.InDay FROM ByDays BO WHERE BO.InDay % 2 = 0) O -- Odd rows ON E.InDay + 1 = O.InDay -- Join rows (1,2), (3,4) and so on AND E.Day = O.Day -- in the same day ) SELECT Day, SUM(DiffSeconds) Seconds, CONVERT(VARCHAR(8), (DATEADD(S, SUM(DiffSeconds), '1900-01-01T00:00:00')), 108) TotalHHMMSS -- The same, formatted as HH:MM:SS FROM Diffs GROUP BY Day ORDER BY Day desc "; $rs = odbc_exec($conn, $sql); if (!$rs) { exit("Error in SQL"); }else{ echo "Get Connection"; } var_dump($rs); var_dump($sql); $array = array(); $i = 1; var_dump(odbc_fetch_array($rs, $i)); while ($row = odbc_fetch_array($rs, $i)) { foreach ($row AS $key =&gt; $value) { $array[$i][$key] = $row[$key]; } $i++; } var_dump($row); var_dump($array); return $array; } </code></pre> <p>The PHP Part of this code work, even though it's not the best way to connect to the database, however looking at what is returned at each stage there is just nothing being returned.</p> <p>When i cut the query down to just the first select. </p> <pre><code>SELECT CHINA_VISION_DorEvents.EventTm AS T, CONVERT(VARCHAR(10),CHINA_VISION_DorEvents.EventTm,102) AS Day, FLOOR(CONVERT(FLOAT,CHINA_VISION_DorEvents.EventTm)) DayNumber, ROW_NUMBER() OVER(PARTITION BY FLOOR(CONVERT(FLOAT,CHINA_VISION_DorEvents.EventTm)) ORDER BY CHINA_VISION_DorEvents.EventTm) InDay FROM CHINA_VISION_DorEvents Where CHINA_VISION_DorEvents.DorCtrls_Ref = '16' AND CHINA_VISION_DorEvents.CardCode = '000006f1' AND CONVERT(Date,CHINA_VISION_DorEvents.EventTm) &gt; dateadd(day, -7, getdate()) </code></pre> <p>Without the WITH ByDays part the query actually returned what i would expect it to return at that point of the query, so with the "WITH ByDays AS (" section and everything that follows on the query won't work in php why is this and how can i fix this</p> </div>

使用PHP创建数据库表 - SQLSTATE [42000]:语法错误或访问冲突:1064

<div class="post-text" itemprop="text"> <p><strong>SOLVED</strong></p> <p>Hi I'm having trouble creating tables due to this syntax error: </p> <blockquote> <p>SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 11</p> </blockquote> <p>I've checked the other solutions for this error, but i have yet to resolve it. I'm wondering if anyone can spot the problem. My code looks like this:</p> <pre><code>&lt;?php $servername = "localhost"; $username = "root"; $password = ""; $dbname = "myDB"; try { $conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password); // set the PDO error mode to exception $conn-&gt;setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); // sql to create table $sql = "CREATE TABLE users ( id INT(6) UNSIGNED AUTO_INCREMENT, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, email VARCHAR(50), password VARCHAR(256), reg_date TIMESTAMP, is_author INT(6), is_admin INT(6), )"; echo "&lt;/br&gt;"; // use exec() because no results are returned $conn-&gt;exec($sql); echo "Table created successfully"; } catch(PDOException $e) { echo $sql . "&lt;br&gt;" . $e-&gt;getMessage(); } $conn = null; ?&gt; </code></pre> </div>

错误源:.Net SqlClient Data Provider 错误信息:对象名“***”无效 请问怎么解决呢

错误源:.Net SqlClient Data Provider 错误信息:对象名“***”无效 请问怎么解决呢 应该是已经连接了数据库,但是出现表的无效,初学,望高手予以解答 SqlConnection conn = new SqlConnection(@"server = .\sqlexpress; integrated security = true; database = AdventureWorks"); string sql = @"select count(*) from Production.Product"; SqlCommand cmd = new SqlCommand(sql, conn); txtScalar.AppendText("Command created and connected.\n"); try { conn.Open(); txtScalar.AppendText("Number of Product is :"); txtScalar.AppendText(cmd.ExecuteScalar().ToString()); txtScalar.AppendText("\n"); } catch (SqlException ex) { MessageBox.Show(ex.ToString()); } finally { conn.Close(); txtScalar.AppendText("Connection Closed"); } http://img.blog.csdn.net/20140207204330390?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQva2lzc19vZl9kZWF0aA==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast

出现错误说=号附近有语法错误 SQL语句没错呀

private void button1_Click(object sender, EventArgs e) { try { string sql = string.Format("select uname,password,userrole from tb_userinfo where uname='{0}'", this.tb_name.Text.Trim()); DataSet ds = sqlHple.GetDateSet(sql); if (ds != null && ds.Tables[0].Rows.Count > 0) { //判断当前用户登录进来的密码是否与传进来的密码相等 if (ds.Tables[0].Rows[0]["uname"].ToString().Equals(this.tb_pwd.Text.Trim())) { //对用户名和用户角色进行赋值 Program.username = ds.Tables[0].Rows[0]["uname"].ToString(); Program.userrole = ds.Tables[0].Rows[0]["userrole"].ToString(); //是否显示主窗体 Program.isshowmina = true; this.Close(); } else { MessageBox.Show("用户密码输入错误"); } } else { MessageBox.Show("用户名输入错误"); return; } } catch (Exception ex) { throw ex; } } } } sqlHple.GetDateSet类里面的方法 public static DataSet GetDateSet(string sql) { SqlConnection con = new SqlConnection(strcon); DataSet ds = new DataSet(); SqlDataAdapter sda = new SqlDataAdapter(strcon, con); sda.Fill(ds); return ds; }

使用php提供动态sql数据透视表时出现语法错误

<div class="post-text" itemprop="text"> <p>This dynamic pivot sql runs perfectly in MS Studio, however I can't get it to run with php on the server. I get Incorrect syntax near ','. And Incorrect syntax near 'p'. I've tried every type of "execute" I know, plus all kinds of punctuation. Eight hours is enough. Call in the experts please.</p> <p>SQL:</p> <pre><code>declare @col varchar(8000) declare @sql varchar(8000) if OBJECT_ID('tempdb..#q1') is not null drop table #q1 if OBJECT_ID('tempdb..#q2') is not null drop table #q2 select top 5 row_number() over ( order by PTC_ASSESSMENT.ASSESSMENT_DATE desc ) as row, PTC_ASSESSMENT.ASSESSMENT_ID into #q1 from PTC_ASSESSMENT inner join PT_BASIC on PTC_ASSESSMENT.PATIENT_ID = PT_BASIC.PATIENT_ID inner join SYS_AS_DDF on PTC_ASSESSMENT.AS_DDF_ID = SYS_AS_DDF.AS_DDF_ID and PTC_ASSESSMENT.DISCIPLINE_CODE = SYS_AS_DDF.DISCIPLINE_CODE where (PT_BASIC.PATIENT_CODE = '60085') and (PTC_ASSESSMENT.DISCIPLINE_CODE = 'MD') group by PTC_ASSESSMENT.ASSESSMENT_DATE, PTC_ASSESSMENT.ASSESSMENT_ID select convert(varchar, ASSESSMENT_DATE, 101) as dates, QUESTION_TEXT, case when ENTRY_TEXT is not null then ENTRY_TEXT else ANSWER_TEXT end as ANSWER_TEXT into #q2 from VW_ASSESSMENT_DATA inner join PT_BASIC on VW_ASSESSMENT_DATA.PATIENT_ID = PT_BASIC.PATIENT_ID inner join SYS_AS_DDF on VW_ASSESSMENT_DATA.AS_DDF_ID = SYS_AS_DDF.AS_DDF_ID inner join #q1 on VW_ASSESSMENT_DATA.ASSESSMENT_ID = #q1.ASSESSMENT_ID where (PT_BASIC.PATIENT_CODE = '60085') and (SYS_AS_DDF.DISCIPLINE_CODE = 'MD') and VW_ASSESSMENT_DATA.QUESTION_ID in ( 22222, 22223, 22237, 22238, 22239, 22241, 22242 ) select @col = COALESCE(@col + ',', '') + QUOTENAME(dates) from #q2 group by dates set @sql = 'select QUESTION_TEXT, ' + @col + ' from ( select distinct * from #q2 ) p pivot ( max(ANSWER_TEXT) for dates in (' + @col + ' )) as pvt' execute (@sql) </code></pre> <p>PHP: Use this to fetch it.</p> <pre><code>$result = mssql_query($sql) or exit ("select query failed"); </code></pre> <p>Entire PHP script:</p> <p> </p><pre><code>$sql = "above sql"; $result = mssql_query($sql) or exit ("select query failed"); $numrows = mssql_num_rows($result); echo "&lt;table width='60%' cellpadding='5%'&gt; &lt;tr&gt;"; if ($numrows &gt; 0) { //loop thru the field names to print the correct headers $i = 0; while ($i &lt; mssql_num_fields($result)) { echo "&lt;th&gt;". mssql_field_name($result, $i) . "&lt;/th&gt;"; $i++; } echo "&lt;/tr&gt;"; //display the data while ($rows = mssql_fetch_array($result)) { echo "&lt;tr&gt;"; foreach ($rows as $data) { echo "&lt;td align='left'&gt;". $data . "&lt;/td&gt;"; } } }else{ echo "&lt;tr&gt;&lt;td colspan='" . ($i+1) . "'&gt;No patient medical history found&lt;/td&gt;&lt;/tr&gt;"; } echo "&lt;/table&gt;"; </code></pre> </div>

技术大佬:我去,你写的 switch 语句也太老土了吧

昨天早上通过远程的方式 review 了两名新来同事的代码,大部分代码都写得很漂亮,严谨的同时注释也很到位,这令我非常满意。但当我看到他们当中有一个人写的 switch 语句时,还是忍不住破口大骂:“我擦,小王,你丫写的 switch 语句也太老土了吧!” 来看看小王写的代码吧,看完不要骂我装逼啊。 private static String createPlayer(PlayerTypes p...

副业收入是我做程序媛的3倍,工作外的B面人生是怎样的?

提到“程序员”,多数人脑海里首先想到的大约是:为人木讷、薪水超高、工作枯燥…… 然而,当离开工作岗位,撕去层层标签,脱下“程序员”这身外套,有的人生动又有趣,马上展现出了完全不同的A/B面人生! 不论是简单的爱好,还是正经的副业,他们都干得同样出色。偶尔,还能和程序员的特质结合,产生奇妙的“化学反应”。 @Charlotte:平日素颜示人,周末美妆博主 大家都以为程序媛也个个不修边幅,但我们也许...

我说我不会算法,阿里把我挂了。

不说了,字节跳动也反手把我挂了。

抖音上很火的时钟效果

反正,我的抖音没人看,别人都有几十万个赞什么的。 发到CSDN上来,大家交流下~ 主要用到原生态的 JS+CSS3。 具体不解释了,看注释: &lt;!DOCTYPE html&gt; &lt;html lang="en"&gt; &lt;head&gt; &lt;meta charset="UTF-8"&gt; &lt;title&gt;Title&lt;/tit...

记录下入职中软一个月(外包华为)

我在年前从上一家公司离职,没想到过年期间疫情爆发,我也被困在家里,在家呆着的日子让人很焦躁,于是我疯狂的投简历,看面试题,希望可以进大公司去看看。 我也有幸面试了我觉得还挺大的公司的(虽然不是bat之类的大厂,但是作为一名二本计算机专业刚毕业的大学生bat那些大厂我连投简历的勇气都没有),最后选择了中软,我知道这是一家外包公司,待遇各方面甚至不如我的上一家公司,但是对我而言这可是外包华为,能...

培训班出来的人后来都怎么样了?(二)

接着上回说,培训班学习生涯结束了。后面每天就是无休止的背面试题,不是没有头脑的背,培训公司还是有方法的,现在回想当时背的面试题好像都用上了,也被问到了。回头找找面试题,当时都是打印下来天天看,天天背。 不理解呢也要背,面试造飞机,上班拧螺丝。班里的同学开始四处投简历面试了,很快就有面试成功的,刚开始一个,然后越来越多。不知道是什么原因,尝到胜利果实的童鞋,不满足于自己通过的公司,嫌薪水要少了,选择...

面试了一个 31 岁程序员,让我有所触动,30岁以上的程序员该何去何从?

最近面试了一个31岁8年经验的程序猿,让我有点感慨,大龄程序猿该何去何从。

大三实习生,字节跳动面经分享,已拿Offer

说实话,自己的算法,我一个不会,太难了吧

程序员垃圾简历长什么样?

已经连续五年参加大厂校招、社招的技术面试工作,简历看的不下于万份 这篇文章会用实例告诉你,什么是差的程序员简历! 疫情快要结束了,各个公司也都开始春招了,作为即将红遍大江南北的新晋UP主,那当然要为小伙伴们做点事(手动狗头)。 就在公众号里公开征简历,义务帮大家看,并一一点评。《启舰:春招在即,义务帮大家看看简历吧》 一石激起千层浪,三天收到两百多封简历。 花光了两个星期的所有空闲时...

推荐9个能让你看一天的网站

分享的这9个保证另你意外的网站,每个都非常实用!非常干货!毫不客气的说,这些网站最少值10万块钱。 利用好这些网站,会让你各方面的技能都得到成长,不说让你走上人生巅峰,但对比现在的你,在眼界、学识、技能方面都有质的飞跃。 一、AIRPANO 传送门:https://www.airpano.com/360photo_list.php 这是一个可以躺在家里,就能环游世界的神奇网站。 世界那么大,绝大多...

大牛都会用的IDEA调试技巧!!!

导读 前天面试了一个985高校的实习生,问了他平时用什么开发工具,他想也没想的说IDEA,于是我抛砖引玉的问了一下IDEA的调试用过吧,你说说怎么设置断点...

都前后端分离了,咱就别做页面跳转了!统统 JSON 交互

文章目录1. 无状态登录1.1 什么是有状态1.2 什么是无状态1.3 如何实现无状态1.4 各自优缺点2. 登录交互2.1 前后端分离的数据交互2.2 登录成功2.3 登录失败3. 未认证处理方案4. 注销登录 这是本系列的第四篇,有小伙伴找不到之前文章,松哥给大家列一个索引出来: 挖一个大坑,Spring Security 开搞! 松哥手把手带你入门 Spring Security,别再问密...

97年世界黑客编程大赛冠军作品(大小仅为16KB),惊艳世界的编程巨作

这是世界编程大赛第一名作品(97年Mekka ’97 4K Intro比赛)汇编语言所写。 整个文件只有4095个字节, 大小仅仅为16KB! 不仅实现了3D动画的效果!还有一段震撼人心的背景音乐!!! 内容无法以言语形容,实在太强大! 下面是代码,具体操作看最后! @echo off more +1 %~s0|debug e100 33 f6 bf 0 20 b5 10 f3 a5...

不要再到处使用 === 了

我们知道现在的开发人员都使用 === 来代替 ==,为什么呢?我在网上看到的大多数教程都认为,要预测 JavaScript 强制转换是如何工作这太复杂了,因此建议总是使用===。这些都...

什么是a站、b站、c站、d站、e站、f站、g站、h站、i站、j站、k站、l站、m站、n站?00后的世界我不懂!

A站 AcFun弹幕视频网,简称“A站”,成立于2007年6月,取意于Anime Comic Fun,是中国大陆第一家弹幕视频网站。A站以视频为载体,逐步发展出基于原生内容二次创作的完整生态,拥有高质量互动弹幕,是中国弹幕文化的发源地;拥有大量超粘性的用户群体,产生输出了金坷垃、鬼畜全明星、我的滑板鞋、小苹果等大量网络流行文化,也是中国二次元文化的发源地。 B站 全称“哔哩哔哩(bilibili...

十个摸鱼,哦,不对,是炫酷(可以玩一整天)的网站!!!

文章目录前言正文**1、Kaspersky Cyberthreat real-time map****2、Finding Home****3、Silk – Interactive Generative Art****4、Liquid Particles 3D****5、WINDOWS93****6、Staggering Beauty****7、Ostagram图片生成器网址****8、全历史网址*...

终于,月薪过5万了!

来看几个问题想不想月薪超过5万?想不想进入公司架构组?想不想成为项目组的负责人?想不想成为spring的高手,超越99%的对手?那么本文内容是你必须要掌握的。本文主要详解bean的生命...

大厂的 404 页面都长啥样?最后一个笑了...

每天浏览各大网站,难免会碰到404页面啊。你注意过404页面么?猿妹搜罗来了下面这些知名网站的404页面,以供大家欣赏,看看哪个网站更有创意: 正在上传…重新上传取消 腾讯 正在上传…重新上传取消 网易 淘宝 百度 新浪微博 正在上传…重新上传取消 新浪 京东 优酷 腾讯视频 搜...

自从喜欢上了B站这12个UP主,我越来越觉得自己是个废柴了!

不怕告诉你,我自从喜欢上了这12个UP主,哔哩哔哩成为了我手机上最耗电的软件,几乎每天都会看,可是吧,看的越多,我就越觉得自己是个废柴,唉,老天不公啊,不信你看看…… 间接性踌躇满志,持续性混吃等死,都是因为你们……但是,自己的学习力在慢慢变强,这是不容忽视的,推荐给你们! 都说B站是个宝,可是有人不会挖啊,没事,今天咱挖好的送你一箩筐,首先啊,我在B站上最喜欢看这个家伙的视频了,为啥 ,咱撇...

代码注释如此沙雕,会玩还是你们程序员!

某站后端代码被“开源”,同时刷遍全网的,还有代码里的那些神注释。 我们这才知道,原来程序员个个都是段子手;这么多年来,我们也走过了他们的无数套路… 首先,产品经理,是永远永远吐槽不完的!网友的评论也非常扎心,说看这些代码就像在阅读程序员的日记,每一页都写满了对产品经理的恨。 然后,也要发出直击灵魂的质问:你是尊贵的付费大会员吗? 这不禁让人想起之前某音乐app的穷逼Vip,果然,穷逼在哪里都是...

一场疫情,炸出了退休的COBOL程序员

COBOL编程语言,估计大多数程序员从没听说过,我这样的编程老司机,也是只闻其名,从未一睹芳容。出门问了问度娘,答案如下:COBOL语言,是一种面向过程的高级程序设计语言,主要用于数据...

爬虫(101)爬点重口味的

小弟最近在学校无聊的很哪,浏览网页突然看到一张图片,都快流鼻血。。。然后小弟冥思苦想,得干一点有趣的事情python 爬虫库安装https://s.taobao.com/api?_ks...

讲真,这两款idea插件,能治愈你英语不好的病

时不时就有小伙伴问我,“二哥,能推荐一款 IDE 吗?”你看这话问的,现在搞 Java 的不都在用 Intellij IDEA 吗,还用得着推荐(我已经和 Eclipse 分手了)。然后小伙伴又说,“二哥,IDEA 支持中文吗?我英语不太好。”你看这话问的,搞编程的,英语不好是硬伤啊! 不过,随着 IDEA 最新版(版本号是 2020.1)的发布,英语不好的病可以彻底治愈了。为什么这么说呢?因为 ...

在拼多多上班,是一种什么样的体验?我心态崩了呀!

之前有很多读者咨询我:武哥,在拼多多上班是一种什么样的体验?由于一直很忙,没抽出时间来和大家分享。上周末特地花点时间来写了一篇文章,跟大家分享一下拼多多的日常。 1. 倒时差的作息 可能很多小伙伴都听说了,拼多多加班很严重。这怎么说呢?作息上确实和其他公司有点区别,大家知道 996,那么自然也就能理解拼多多的“11 11 6”了。 所以当很多小伙伴早上出门时,他们是这样的: 我们是这样的: 当...

又一起程序员被抓事件

就在昨天互联网又发生一起让人心酸的程序员犯罪事件,著名的百度不限速下载软件 Pandownload PC 版作者被警方抓获。案件大致是这样的:软件的作者不仅非法盗取用户数据,还在QQ群进...

瑞德西韦重症用药结果再曝光,上百名重症一周内好转,股价大涨19%

郭一璞 发自 凹非寺量子位 报道 | 公众号 QbitAI期盼已久的瑞德西韦临床数据,现在“偷跑”了。在芝加哥大学医学院的临床试验中,125名病人参与,大部分人都已经出院,其中只有2名病...

应聘3万的职位,有必要这么刁难我么。。。沙雕。。。

又一次被面试官带到坑里面了。面试官:springmvc用过么?我:用过啊,经常用呢面试官:springmvc中为什么需要用父子容器?我:嗯。。。没听明白你说的什么。面试官:就是contr...

Vue商城——详情页功能

详情页实现思路 点击商品进去详情页,根据点击请求更加详细的信息,要传过来goodsItem的iid,根据id去服务器请求更加详细的信息;配置路由映射关系,点击进行跳转,带参数传递跳转 itemClick(){ this.$router.push('/detail/'+this.goodsItem.iid) /* this.$router.push({ ...

太狠了,疫情期间面试,一个问题砍了我5000!

疫情期间找工作确实有点难度,想拿到满意的薪资,确实要点实力啊!面试官:Spring中的@Value用过么,介绍一下我:@Value可以标注在字段上面,可以将外部配置文件中的数据,比如可以...

自学编程的 6 个致命误区

嗨,小伙伴们大家好,我是沉默王二。本篇文章来和大家聊聊自学编程中的一些误区——这是我在 B 站上看了羊哥的一期视频后有感而发的文章。因为确实有很多读者也曾私信问过我这些方面的问题,很有代表性,所以我就结合自己的亲身体会来谈一谈,希望对小伙伴们有所启发。 01、追求时髦 所谓基础不牢,地动山摇啊。可很多小伙伴压根就没注意过这个问题,市面上出什么新鲜的技术就想去尝试,结果把自己学的乱七八糟,心灰意冷...

相关热词 c#跨线程停止timer c#批量写入sql数据库 c# 自动安装浏览器 c#语言基础考试题 c# 偏移量打印是什么 c# 绘制曲线图 c#框体中的退出函数 c# 按钮透明背景 c# idl 混编出错 c#在位置0处没有任何行
立即提问