Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IvorySQL 3.0 创建 FUNCTION 报specified for unlabeled block错误 #624

Closed
shlei6067 opened this issue Jan 23, 2024 · 2 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@shlei6067
Copy link

Bug Report

创建function 报 specified for unlabeled block

IvorySQL Version

IvorySQL 3.0

OS Version (uname -a)

Centos 7.9

=====具体代码如下
[ivorysql@ivorysqldb ~]$ psql -p 1521 -d postgres
psql (16.0)
Type "help" for help.

postgres=# CREATE TABLE LOGON_LOG_EN
postgres-# (
postgres(# REC_ID NUMBER(20) NOT NULL,
postgres(# COM_ID NUMBER(10) NOT NULL,
postgres(# OPERATOR_NO VARCHAR2(10 CHAR) NOT NULL,
postgres(# LOG_USER_NAME VARCHAR2(255 CHAR) NOT NULL,
postgres(# LAST_LOGON_TIME DATE NOT NULL,
postgres(# LOGON_PAGE VARCHAR2(1500 CHAR),
postgres(# LOGON_IP VARCHAR2(50 CHAR),
postgres(# REP_TIME TIMESTAMP(6) WITH TIME ZONE DEFAULT TO_DATE('1900-01-01 00:00:00','YYYY-MM-DD HH24:MI:SS') NOT NULL,
postgres(# SESSION_ID VARCHAR2(100 CHAR),
postgres(# COOKIE_ID VARCHAR2(100 CHAR),
postgres(# LOGON_TYPE VARCHAR2(2 CHAR),
postgres(# PRE_LOGON_PAGE VARCHAR2(1500 CHAR),
postgres(# LOGON_IN_CODE VARCHAR2(3 CHAR),
postgres(# COOKIE_PID VARCHAR2(100 CHAR)
postgres(# );
CREATE TABLE
postgres=#
postgres=# CREATE OR REPLACE FUNCTION "F_GET_LAST_LOGON_IP" (
postgres(# P_COMID NUMBER,
postgres(# P_OPEARTORNO VARCHAR2
postgres(# )
postgres-# RETURN VARCHAR2
postgres-# IS
postgres-# output_value VARCHAR2 (1000);
postgres-# BEGIN
postgres-# output_value := '';
postgres-# BEGIN
postgres-# SELECT LOGON_IP
postgres-# INTO output_value
postgres-# FROM ( SELECT logon_ip
postgres(# FROM logon_log_en
postgres(# WHERE com_id = P_COMID AND operator_no = P_OPEARTORNO
postgres(# ORDER BY last_logon_time DESC)
postgres-# WHERE ROWNUM = 1;
postgres-# EXCEPTION
postgres-# WHEN OTHERS
postgres-# THEN
postgres-# RETURN ('');
postgres-# END;
postgres-# RETURN (output_value);
postgres-# END F_GET_LAST_LOGON_IP;
postgres-# /
ERROR: end label "f_get_last_logon_ip" specified for unlabeled block
LINE 18: END F_GET_LAST_LOGON_IP
^
QUERY: output_value VARCHAR2 (1000);
BEGIN
output_value := '';
BEGIN
SELECT LOGON_IP
INTO output_value
FROM ( SELECT logon_ip
FROM logon_log_en
WHERE com_id = P_COMID AND operator_no = P_OPEARTORNO
ORDER BY last_logon_time DESC)
WHERE ROWNUM = 1;
EXCEPTION
WHEN OTHERS
THEN
RETURN ('');
END;
RETURN (output_value);
END F_GET_LAST_LOGON_IP
postgres=#

image-20240117234702561

@shlei6067 shlei6067 added the bug Something isn't working label Jan 23, 2024
@gaoxueyu
Copy link
Collaborator

gaoxueyu commented Jan 23, 2024

谢谢反馈,确实是个Bug,我们会在接下来的3.2分支完成fix

@bigplaice
Copy link
Collaborator

This issue has been solved in 3.2, so close it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Status: Done
Development

No branches or pull requests

3 participants