Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8230625
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T17:11:47+00:00 2026-06-07T17:11:47+00:00

I was trying to explore the semantic features of Oracle Database by running a

  • 0

I was trying to explore the semantic features of Oracle Database by running a semantic related sql on a semantic model I created in Oracle. But I can’t make it work, and there are little information about this.

The function of the procedure is simple, to get the result set from the sparql query.

CREATE OR REPLACE PROCEDURE PROC_MERGE_PATHWAY_SEM AS 
TYPE c_type IS REF CURSOR;
semCursor c_type;
p1 VARCHAR2(40);
p2 VARCHAR2(40);
interCount INTEGER;

BEGIN
OPEN semCursor FOR
 'SELECT p1, p2, COUNT(g) as interCount
  FROM TABLE (sem_match (
                  "{?p1 <http://example.com/test.owl#relates_to> ?g .  ?p2              <http://example.com/test.owl#relates_to> ?g }",
                      sem_models("pathway"),
                      null,
                      null,
                      null))';

LOOP
FETCH semCursor INTO p1, p2, interCount;
EXIT WHEN semCursor%NOTFOUND;
DBMS_OUTPUT.PUT_LINE(p1||','||p2||','||interCount);
END LOOP; 

/*
FOR records IN semCursor LOOP
 DBMS_OUTPUT.PUT_LINE('test'); 
END LOOP; */
END PROC_MERGE_PATHWAY_SEM;

Compiling errors are as follow:

ORA-00972: identifier is too long

ORA-06512: at “SYSTEM.PROC_MERGE_PATHWAY_SEM”, line 9

ORA-06512: at line 2

I’m not sure if it is caused by sem_match syntax error wrapped by cursor statement, or a bug in Oracle 11g2? Could someone help me with this? Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T17:11:49+00:00Added an answer on June 7, 2026 at 5:11 pm

    You appear to be using double quotes (") in the sem_match call, where I think you should be using two single quotes (''); which you need because it’s already inside single quotes from the open ... for.

    (I should maybe note that I’ve never used semantics, but the docs indicate single quotes).

    The double quotes are causing the whole string within them to be treated as a literal identifier, hence the error message.

    But as Mat commented, you don’t need the single quotes around the select, so you don’t need to escape those in the sem_match.

    Updated following comments: Assuming you do need the whole select wrapped in single quotes as the article you linked to suggests, the single quotes that were already inside the command need to be escaped, which in Oracle is done by using two single quotes together (''); in the article that looked rather like a double quote (") instead so I can understand your confusion. Based on the code you put in paste bin:

    create or replace
    PROCEDURE PROC_MERGE_PATHWAY_SEM AS 
    TYPE c_type IS REF CURSOR;
    semCursor c_type;
    p1 VARCHAR2(40);
    p2 VARCHAR2(40);
    interCount INTEGER;
    
    BEGIN
      OPEN semCursor FOR
         'SELECT p1, p2, COUNT(g) as interCount
          FROM TABLE (sem_match (
                          ''{?p1 <http://example.com/test.owl#relates_to> ?g .  ?p2 <http://example.com/test.owl#relates_to> ?g }'',
                              sem_models(''pathway''),
                              null,
                              null,
                              null))';
    
       LOOP
       FETCH semCursor INTO p1, p2, interCount;
       EXIT WHEN semCursor%NOTFOUND;
        DBMS_OUTPUT.PUT_LINE(p1||','||p2||','||interCount); 
       END LOOP; 
    
     /*
      FOR records IN semCursor LOOP
        DBMS_OUTPUT.PUT_LINE('test'); 
      END LOOP; */
    END PROC_MERGE_PATHWAY_SEM;
    

    Each of the " you had in your query in the original question is replaced by two single quotes, so sem_models("pathway") becomes sem_models(''pathway'').

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to explore KDE a bit, but many of the tools I
I am trying to explore any possible coding option that I can use to
I am trying to explore a graph here but I am not sure what
I am trying to make a horizontal nav that can contain multi-line content in
I'm trying to explore Behavior Driven Design and Domain Driven Design. I'm getting that
I am trying to explore OOP in C. I am however a C n00b
I asked this question earlier and am now trying to explore the idea of
Im trying to replicate an effect as seen on http://www.fiat.co.uk/Showroom/#showroom/punto_evo/explore . I have made
I'm trying to use JQuery's autocomplete plug-in but for some reasons Internet Explorer is
I am trying to explore the Azure Connect service provided by Windows Azure. So

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.