小编Eli*_*elo的帖子

将第一个单词提取到第一个空格 - POSTGRES

我只想将第一个单词提取到第一个空格。

\n

我使用了以下查询:

\n
select upper(substring(substring(descripcion,28),0,length(substring(descripcion,28))-position(' ' in reverse(substring(descripcion,28)))+1)) from evento where descripcion ~ 'Act. datos:Actualizaci\xc3\xb3n';\n
Run Code Online (Sandbox Code Playgroud)\n

但它给了我所有的东西,而不仅仅是第一个空格之前的第一个单词。

\n

我怎样才能得到以下结果

\n
    \n
  1. 约翰
  2. \n
  3. 埃琳娜
  4. \n
  5. 玛丽亚
  6. \n
  7. 马库斯
  8. \n
  9. 马里奥
  10. \n
  11. 安娜
  12. \n
  13. 佩德罗
  14. \n
\n

ETC。

\n

sql postgresql

5
推荐指数
1
解决办法
1922
查看次数

如何在邮递员中以@RequestPart形式发送数据

我刚刚加入一个新项目,但在创建控制器中具有 @RequestPart 注释的对象时遇到问题

以下是模型的图像: 在此输入图像描述

这是控制器:

在此输入图像描述

和服务:

在此输入图像描述

我应该如何发送创建可交付对象的请求?

我尝试了几种方法,但总是收到错误:请求不包含多部分/表单数据或多部分/混合流,内容类型标头是 application/json

感谢您的帮助!

编辑:

以下是邮递员配置的图像

在此输入图像描述

在此输入图像描述

在此输入图像描述

2021-09-27 10:57:11.279 ERROR 148 --- [nio-8050-exec-5] o.a.c.c.C.[.[.[.[dispatcherServlet]      : Servlet.service() for servlet [dispatcherServlet] in context with path [/portal-cliente-api] threw exception [Request processing failed; nested exception is java.util.NoSuchElementException: No value present] with root cause
Run Code Online (Sandbox Code Playgroud)

java.util.NoSuchElementException:在 security.innotec.portalcliente.service.impl.DeliverableServiceImpl.insert(DeliverableServiceImpl.java) 的 java.util.Optional.get(Optional.java:135) ~[?:1.8.0_201] 处没有值:78) ~[classes/:?] at security.innotec.portalcliente.service.impl.DeliverableServiceImpl$$FastClassBySpringCGLIB$$b02f851b.invoke() ~[classes/:?] at org.springframework.cglib.proxy.MethodProxy。调用(MethodProxy.java:218)〜[spring-core-5.2.8.RELEASE.jar:5.2.8.RELEASE]在org.springframework.aop.framework.CglibAopProxy $ CglibMethodInitation.invokeJoinpoint(CglibAopProxy.java:771)〜 [spring-aop-5.2.8.RELEASE.jar:5.2.8.RELEASE] 位于 org.springframework.aop.framework.ReflectiveMethodInspiration.proceed(ReflectiveMethodInitation.java:163) ~[spring-aop-5.2.8.RELEASE。 jar:5.2.8.RELEASE] 在 org.springframework.aop.framework.CglibAopProxy$CglibMethodInspiration.proceed(CglibAopProxy.java:749) ~[spring-aop-5.2.8.RELEASE.jar:5.2.8.RELEASE] 在org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:367) ~[spring-tx-5.2.8.RELEASE.jar:5.2.8.RELEASE] 在 org.springframework.transaction.interceptor.TransactionInterceptor.invoke (TransactionInterceptor.java:118) ~[spring-tx-5.2.8.RELEASE.jar:5.2.8.RELEASE] 在 org.springframework.aop.framework.ReflectiveMethodInitation.proceed(ReflectiveMethodInitation.java:186) ~[spring- aop-5.2.8.RELEASE.jar:5.2.8.RELEASE] 在 org.springframework.aop.framework.CglibAopProxy$CglibMethodInitation.proceed(CglibAopProxy.java:749) ~[spring-aop-5.2.8.RELEASE.jar :5.2.8.RELEASE] …

java spring-boot postman

2
推荐指数
1
解决办法
9311
查看次数

标签 统计

java ×1

postgresql ×1

postman ×1

spring-boot ×1

sql ×1