Database query: sequence as a good parent

Hi all

I build very simple sequences that all will follow this architecture:

* MainSequence reminder

* SpecSequence_1

* TestSequence_1

* Step_DoThis

* Step_DoThat

* ...

* TestSequence_2

* Step_DoItBetter

*....

* SpecSequence_2

* TestSequence_3

...

I use standard TS database diagrams for all results in a MySQL database. And I need to create a query that returns a response like this:

SpecSequence | TestSequence | Step_Name | DataSource | CompOperator | High limits. Low Limts. Units | Status

This request allows you to get almost what I want for a specific ID to USE:

SELECT
'step_seqcall '. 'SEQUENCE_NAME' AS 'SEQUENCE_NAME ',.
'step_result '. "STEP_NAME' AS 'STEP_NAME."
'prop_result '. 'DATA' AS 'DATA ',.
'prop_numericlimit '. "COMP_OPERATOR" AS "COMP_OPERATOR."
'prop_numericlimit '. "HIGH_LIMIT" AS "HIGH_LIMIT."
'prop_numericlimit '. "LOW_LIMIT" AS "LOW_LIMIT."
'prop_numericlimit '. 'UNITS' AS 'UNITS ',.
'prop_numericlimit '. 'STATUS' AS 'STATUS '.

Of

((('prop_numericlimit'
JOIN 'prop_result' WE (('prop_numericlimit '. 'PROP_RESULT' = 'prop_result'. 'ID')))
JOIN 'step_result' WE (('prop_result '. 'STEP_RESULT' = step_result of the 'booster_results.' '.' ID')))
JOIN 'uut_result' WE (('step_result '. 'UUT_RESULT' = 'uut_result'. 'ID')))
JOIN 'step_seqcall' WE (('step_seqcall '. 'STEP_RESULT' = 'step_result'. 'STEP_PARENT')))

WHERE
("uut_result". "ID" = "{20537569-ab6c-11e3-a662-f4b7e2f8d8e9}");

The problem is that I can't find a way to add my SpecSequenceName column at the left!

If I don't get a response like this:

TestSequence | Step_Name | DataSource | CompOperator | High limits. Low Limts. Units | Status

 

Maybe some of you are masters of SQL and let me know that I can get the answer I want a single query?

Thank you!

For those interested, I found a solution:

SELECT
'MyDB '. 'step_seqcall '. "SEQUENCE_NAME' AS"TEST_SEQUENCE_NAME. "
(
SELECT 'MyDB '. 'step_seqcall '. 'SEQUENCE_NAME '.
OF 'MyDB '. 'step_seqcall '.
INNER JOIN 'MyDB '. 'step_result' ON 'MyDB '. 'step_result '. 'STEP_PARENT' = 'MyDB '. 'step_seqcall '. 'STEP_RESULT '.
INNER JOIN 'MyDB '. 'uut_result' ON 'MyDB '. 'uut_result '. 'ID' = 'MyDB '. 'step_result '. 'UUT_RESULT '.
WHERE 'MyDB '. 'step_result '. 'STEP_NAME' = 'TEST_SEQUENCE_NAME' AND 'MyDB '. 'uut_result '. 'ID' = '{f241ea4c-b8da-11e3-a4e2-005056c00008} '.
) AS "SPEC_SEQUENCE_NAME."
'MyDB '. 'step_result '. "STEP_NAME' AS 'STEP_NAME."
'MyDB '. 'prop_result '. 'DATA' AS 'DATA ',.
'MyDB '. 'prop_numericlimit '. "COMP_OPERATOR" AS "COMP_OPERATOR."
'MyDB '. 'prop_numericlimit '. "HIGH_LIMIT" AS "HIGH_LIMIT."
'MyDB '. 'prop_numericlimit '. "LOW_LIMIT" AS "LOW_LIMIT."
'MyDB '. 'prop_numericlimit '. 'UNITS' AS 'UNITS ',.
'MyDB '. 'prop_numericlimit '. 'STATUS' AS 'STATUS '.
Of
(((«MyDB'. ')) prop_numericlimit'
JOIN 'MyDB '. "prop_result" ON ((«MyDB'. ')) prop_numericlimit'. 'PROP_RESULT' = 'MyDB'. 'prop_result'. 'ID')))
JOIN 'MyDB '. "step_result" ON ((«MyDB'. ')) prop_result'. 'STEP_RESULT' = 'MyDB'. 'step_result'. 'ID')))
JOIN 'MyDB '. "uut_result" ON ((«MyDB'. ')) step_result'. 'UUT_RESULT' = 'MyDB'. 'uut_result'. 'ID')))
JOIN 'MyDB '. "step_seqcall" ON ((«MyDB'. ')) step_seqcall'. 'STEP_RESULT' = 'MyDB'. 'step_result'. 'STEP_PARENT')))
WHERE
("MyDB". 'uut_result '. "ID" = "{f241ea4c-b8da-11e3-a4e2-005056c00008}");

Of course, for the ID value must be replaced by your own!

Tags: NI Software

Similar Questions

  • Run database query error - help!

    I have a cfquery code that looks like this:

    < CFQUERY DATASOURCE = "MaBase" username = "myuser" PASSWORD = "MonMotpasse" NAME = "codelist" CACHEDWITHIN = "#CreateTimeSpan (0,1,0,0) #" >
    SELECT *.
    OF systemcode
    WHERE (((systemcode) TRIM) LEN = 2 OR LEN (TRIM (systemcode)) = 4)
    < CFSWITCH EXPRESSION = "#CAT #" >
    < CFCASE VALUE = "1" > (MID (systemcode, 1, 2) BETWEEN ' 01 'AND ' 05') AND < / CFCASE >
    < CFCASE VALUE = "2" > AND (MID(systemcode,1,2) BETWEEN ' 06 "AND 15") < / CFCASE >
    < CFCASE VALUE = "3" > AND (MID (systemcode, 1, 2) FROM 16 'TO 24') < / CFCASE >
    < CFCASE VALUE = "4" > AND (MID (systemcode, 1, 2) BETWEEN 25 'AND 27') < / CFCASE >
    < CFCASE VALUE = "5" > (MID (systemcode, 1, 2) FROM 28 "TO 38") AND < / CFCASE >
    < CFCASE VALUE = "6" > AND (MID (systemcode, 1, 2) BETWEEN 39 'AND 40') < / CFCASE >
    < CFCASE VALUE = "7" > (MID (systemcode, 1, 2) 41 "TO 43") AND < / CFCASE >
    < CFCASE VALUE = "8" > AND (MID (systemcode, 1, 2) WITH 44' 49') < / CFCASE >
    < CFCASE VALUE = "9" > (MID (systemcode, 1, 2) FROM 50 "TO 63") AND < / CFCASE >
    < CFCASE VALUE = "10" > AND (MID (systemcode, 1, 2) FROM 64 "TO 67") < / CFCASE >
    < CFCASE VALUE = "11" > AND (MID (systemcode, 1, 2) BETWEEN 68 "AND 71") < / CFCASE >
    < CFCASE VALUE = "12" > AND (MID (systemcode, 1, 2) BETWEEN 72 'AND 83') < / CFCASE >
    < CFCASE VALUE = '13' > AND (MID (systemcode, 1, 2) WITH 84' 85') < / CFCASE >
    < CFCASE VALUE '14' = > (MID (systemcode, 1, 2) BETWEEN 86 'AND 89') AND < / CFCASE >
    < CFCASE VALUE = "15" > AND (MID (systemcode, 1, 2) 90 '-97') < / CFCASE >
    < CFCASE VALUE = "16" > (MID (systemcode, 1, 2) BETWEEN 98 "AND 99") AND < / CFCASE >
    < CFDEFAULTCASE > < CFLOCATION URL = "somewhere.htm" > < / CFDEFAULTCASE >
    < / CFSWITCH >
    ORDER BY systemcode
    < / CFQUERY >

    It works perfectly in CF 5.  However, when running in CF 8 I get the error message:

    Error running Query.FUNCTION of database mydatabase. LEN does not exist the specific sequence of files included or processed is: home/httpd/vhosts/somedomain.com/httpdocs/reference/systemcode.cfm, line: 24

    (which refers to the cfquery above)

    "mydatabase" is the name of the database and LEN is a function.    It checks the length of systemcode to 2 or 4, if they are then check if the value of #CAT # is 1 and the 2 first characters from 01 to 05, then select the line.  I don't know what's wrong with CF5 but CF8?  It's driving me crazy.  Any help is appreciated.

    I don't see why

    all of a sudden it does not work with CF8 and MySQL,

    If you changed databases, which is the source of the problem, do not upgrade CF.  MySQL won't understand specific features of MS Access and vice versa. Don't expect applications written for type of databases operate automatically with another.  Although there are sql standards, each database is different. It is quite common for database providers have names completely different functions, the types of data and same syntax. You'll need for any check your database queries and convert all specific syntax of access, data types, etc. for the MySQL equivalents.

    Is there the equivalent MySQL for these two functions (TRIM and)

    LEN)?

    Yes. See the string functions section in the mySQL online documentation.

    http://dev.MySQL.com/doc/refman/5.0/en/string-functions.html

    I don't know that he had a PLATE and LEN in MS Access

    database.  I guess I mixed them.

    Yes. It's a little confusing because CF and MS Access have these functions.  In this case, you use access functions, not of CF.

    http://www.techonthenet.com/access/functions/index_alpha.php

    > Yes, I put a

    CFLOCATION inside the cfquery.  Never meet that

    scenario, so I did not know if it works.

    Well, if you use code, it should be something that you tested. So, you know how it behaves. But CFLOCATION really does not belong inside a database query.

    `

  • Database Query, network problem runtime error

    I get the following error message when you try to run an Oracle stored procedure that returns a Ref with CF MX 7.0.2.142559 cursor:
    Run database query error.
    [Macromedia] [SequeLink JDBC Driver] Network problem, session aborted due to an error internal in the remote procedure call, the connection closed.

    I connect to the database through ODBC Socket DSN. The CF DSN has been created without error. I checked the ODBC DSN to connect without error.

    I get the following in the application log:
    "Mistake'," jrpp-0 "," 11/09/08 "," 11:25:31 "", "Surplus", "database Query runtime error." [Macromedia] [SequeLink JDBC Driver] Network problem, session aborted due to an error internal in the remote procedure call, the connection closed. «The specific sequence of files included or processed is: C:\Inetpub\wwwroot\assocproducts\ken.cfm, line: 14»

    I get the following in the log of the exception:
    "Mistake'," jrpp-0 "," 11/09/08 "," 11:25:31 "", "Surplus", "database Query runtime error." [Macromedia] [SequeLink JDBC Driver] Network problem, session aborted due to an error internal in the remote procedure call, the connection closed. «The specific sequence of files included or processed is: C:\Inetpub\wwwroot\assocproducts\ken.cfm, line: 14»
    coldfusion.tagext.sql.QueryTag$ DatabaseQueryException: error running query database.
    at coldfusion.tagext.sql.StoredProcTag.doEndTag(StoredProcTag.java:201)
    to cfCategory_Procs2ecfc417114750$ funcGETCATEGORYLIST.runFunction (C:\Inetpub\wwwroot\assocpr oducts\includes\Category_Procs.cfc:14)
    at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:344)
    at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
    to coldfusion.runtime.UDFMethod$ ReturnTypeFilter.invoke (UDFMethod.java:290)
    to coldfusion.runtime.UDFMethod$ ArgumentCollectionFilter.invoke (UDFMethod.java:254)
    at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:56)
    at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:207)
    at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:169)
    at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:1807)
    to cfken2ecfm1820770350.runPage(C:\Inetpub\wwwroot\assocproducts\ken.cfm:14)
    at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:152)
    at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:349)
    at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)
    at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:225)
    at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:51)
    at coldfusion.filter.PathFilter.invoke(PathFilter.java:86)
    at coldfusion.filter.LicenseFilter.invoke(LicenseFilter.java:27)
    at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:69)
    at coldfusion.filter.ClientScopePersistenceFilter.invoke (ClientScopePersistenceFilter.java:2 8)
    at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
    at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
    at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
    at coldfusion.filter.RequestThrottleFilter.invoke(RequestThrottleFilter.java:115)
    to coldfusion. CfmServlet.service (CfmServlet.java:107)
    at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:78)
    at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:91)
    at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
    at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:257)
    at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:541)
    at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:204)
    to jrunx.scheduler.ThreadPool$ DownstreamMetrics.invokeRunnable (ThreadPool.java:318)
    to jrunx.scheduler.ThreadPool$ ThreadThrottle.invokeRunnable (ThreadPool.java:426)
    to jrunx.scheduler.ThreadPool$ UpstreamMetrics.invokeRunnable (ThreadPool.java:264)
    at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)

    I can't find anything on the net that helps me to solve this problem. I tried to use the Oracle JDBC driver as well, but got cryptic errors with that as well.

    Any help on this appreciated.

    Thank you!
    Ken

    I found the solution to my problem. I updated my drivers JDBC ( new drivers) and used the dedicated Oracle CF DSN and everything works fine.

  • How to create a ViewObject attribute where value to get database query

    Hi Expert,

    I have a case for the value of database query. How to create the view additional attribute object where the value get database query?

    parameter binding of attributeId object in view I can do this in ADF with JDeveloper 11.1.1.6.

    Thank you

    Kind regards

    Wade W

    My problem is solved, maybe it's a bug in the JDeveloper 11.1.1.6.0

    I've got error (oracle.jbo.expr.JIEvalException) Houston-25077: name amount not found in the given object: oracle.jbo.server.ViewRowSetImpl@8690e3.

    When I develop by tab Overview (presentation of the business components). It is so strange, because I have an another transient viewAttribute that refer to another object in view and not get an error message like this before I create viewAttribute HeaderAmount.

    Maybe its ridiculous appearance, but when I go to View (lineVO.xml) object and tab to the source xml file, I have edited here. like to write

    <>

    Name = "HeaderAmount".

    IsUpdateable = "false".

    IsSelected = "false".

    IsPersistent = "false".

    PrecisionRule = 'true '.

    Type = "Oracle.jbo.domain.Number"

    ColumnType = 'NUMBER '.

    AliasName = 'VIEW_ATTR. '

    SQLType = 'DIGITAL' >

    <>

    Value = "ActivityHeaderId" / >

    and make sure this xml file are:

    <>

    Name = "ActHeaderView1VO".

    ViewLink = 'model. ActHeaderLineLink ".

    Type = "Oracle.jbo.Row"

    Reversed = 'true '.

    IsUpdateable = "false" / >

    When I try to re-run the application model and it's work...

    Thanks for your help. really appreciate

  • Re-organization of database every week, it is good or bad?

    We use windows 2003 server and oracle 10.2.0.4, having two databases with 38 GB and another 72 GB. And the recommendation of the application team suggested to the reorganization of the database for each week. So, I want to know wheather do re-organization of complete database for each week is good or bad.

    Uwe Hesse wrote:
    It's bad. No sophisticated response required here. No DBA (Oracle) is supposed to do a "database reorganization' - whatever that means in detail - once a week.

    And if it is indeed a requirement of the team of apps: they built a very bad application :-)

    Uwe,

    I know you have read this before, but for reasons of the constant stream of the beginners

    I remember once more the seller make a ground for its product, kept talking about SQL Server. We informed that we were an Oracle shop. He said (and I quote): "we do not recommend running on Oracle, because we found that the Oracle can't handle more than 5 concurrent connections.

    I started my career 30 years ago as a developer. I am constantly amazed at the current generation of developers who seem to not only know nothing about the technology with which they work, but do not yet seem a curiosity about this. They give without thinking at all made to design anything.

    * I predict this thread will be sleeping in the next 48 hours, but 3 years from now, someone will record this with the forum, do some research on... on what? ... and revive this thread with a useless comment as their very first post.

    Kind regards
    Uwe Hesse

    http://uhesse.WordPress.com

  • Run database query error; Help, please

    I had trouble getting this recording to publish on my DB, I have the same shape, put in place to modify an existing record, as well as the addition of a new record. I have 2 errors, can someone help me see what I'm doing wrong? I write the code that I have a problem with and two errors. I'm sorry, this is probably simple. But I looked at this code too long and miss me the problem.

    Code:
    < cfelseif ParameterExists (Form.btnEdit_OK) >

    < ParameterExists (Form.RecordID) cfif >
    < cfset eDate = DateFormat (form.eventDate, "mm/dd/yyyy") >
    "< cfquery datasource =" "#sitedatasource #" username = "#siteUserID #" password = "" #sitePassword # "dbtype ="ODBC">"
    UPDATE SEEevents
    SET SEEevents.display =' #form.display #', SEEevents.title =' #form.title #', SEEevents.eventDate ='#eDate #', SEEevents.eventTime =' #form.eventTime #', SEEevents.location =' #form.location #', SEEevents.contact =' #form.contact #', SEEevents.phone =' #form.phone #', SEEevents.fax =' #form.fax #', SEEevents.email =' #form.email #', SEEevents.URL ='#form. URL #', SEEevents.sponsor =' #form.sponsor #', SEEevents.Body ='#form. "PDSeditor #
    WHERE RecordID = #form. RecordID #.
    < / cfquery >
    < cflocation url = "events_RecordView.cfm? RecordID = #Form.RecordID # ">"
    < cfelse >
    < cfset eDate = DateFormat (form.eventDate, "mm/dd/yyyy") >
    "< cfquery datasource =" "#sitedatasource #" username = "#siteUserID #" password = "" #sitePassword # "dbtype ="ODBC">"
    INSERT INTO SEEevents (display, title, eventDate, eventTime, location, contact, telephone, fax, email, URL, sponsor, body)
    VALUES (' #form.display # "," #form.title # "," # #eDate # "," #form.eventTime # "," #form.location # "," #form.contact # "," #form.phone # "," #form.fax # "," #form.email # ', ' #form.) URL #', ' #form.sponsor # ', ' #form. PDSeditor #')
    < / cfquery >
    < cflocation url = "events_RecordView.cfm? RecordID = #GetNewRecord.ID_Field # ">"
    < / cfif >

    Here are the two errors:
    error when editing an existing record:

    Run database query error.
    [Macromedia] [SequeLink JDBC Driver] [ODBC Socket] [Microsoft] [ODBC Microsoft Access driver] Too few parameters. 1 expected.

    The error occurred in C:\websites\108392zj7\admin\events_RecordAction.cfm: line 70

    68: < cfif ParameterExists (Form.RecordID) >
    69: < cfset eDate = DateFormat (form.eventDate, "mm/dd/yyyy") >
    "70: < cfquery datasource =" "#sitedatasource #" username = "#siteUserID #" password = "" #sitePassword # "dbtype ="ODBC">"
    71: UPDATE SEEevents
    72: SET SEEevents.display =' #form.display #', SEEevents.title =' #form.title #', SEEevents.eventDate ='#eDate #', SEEevents.eventTime =' #form.eventTime #', SEEevents.location =' #form.location #', SEEevents.contact =' #form.contact #', SEEevents.phone =' #form.phone #', SEEevents.fax =' #form.fax #', SEEevents.email =' #form.email #', SEEevents.URL ='#form. URL #', SEEevents.sponsor =' #form.sponsor #', SEEevents.Body ='#form. "PDSeditor #



    --------------------------------------------------------------------------------

    SQL UPDATE SEEevents SET SEEevents.display = '0', SEEevents.title = 'VIP dinner', SEEevents.eventDate='04/13/2007', SEEevents.eventTime =' 8:30 pm - 23:00 ', SEEevents.location = 'person Restaurant', SEEevents.contact = 'person', SEEevents.phone ='(000) 000.6262', SEEevents.fax = ", SEEevents.email ="[email protected]", SEEevents.URL =' http://www.person.com', SEEevents.sponsor =", SEEevents.Body =' < font size = "2" face = "Verdana, Arial, Helvetica, sans serif" > < strong > Notes: facilities > bookings must be confirmed with a great Cardinal < br > < strong credit > price : < Facilities > Advance: $125. per person (including drinks and tips) at the door: $150. per person, < i > Limited places available < /i > < / police > ' WHERE RecordID = 13
    DATASOURCE ETUCE
    VENDORERRORCODE-3010
    SQLSTATE 07002

    This is the error when publishing a new record:

    Run database query error.
    [Macromedia] [SequeLink JDBC Driver] [ODBC Socket] [Microsoft] [ODBC Microsoft Access driver] Type mismatch of data in the expression of the criteria.

    The error occurred in C:\websites\108392zj7\admin\events_RecordAction.cfm: line 78

    76: < cfelse >
    77: < cfset eDate = DateFormat (form.eventDate, "mm/dd/yyyy") >
    "78: < cfquery datasource =" "#sitedatasource #" username = "#siteUserID #" password = "" #sitePassword # "dbtype ="ODBC">"
    79: INSERT IN SEEevents (display, title, eventDate, eventTime, location, contact, telephone, fax, email, URL, sponsor, body)
    80: VALUES ("#form.display #", "#form.title #", "# #eDate #", "#form.eventTime #", "#form.location #", "#form.contact #", "#form.phone #", "#form.fax #", "#form.email # ', ' #form.) URL #', ' #form.sponsor # ', ' #form. PDSeditor #')



    --------------------------------------------------------------------------------

    SQL INSERT INTO SEEevents (display, title, eventDate, eventTime, location, contact, telephone, fax, email, URL, sponsor, body) VALUES ('0 ', 'test', ' # #03/25/2007 ", 12:47 ', 'Home', 'CJD', '' 000-000-0000,", '[email protected]', 'www.saratogaexpo.com', ' ', ' ')
    DATASOURCE ETUCE
    VENDORERRORCODE-3030
    SQLSTATE 22018

    Can someone help me tweek this code? I see double at this stage. Thank you.

    Phoenix

    I thought about it. It's a java tag used by my editor throwing the error in the backup / update of the function.

    Thanks a lot for all the help everyone!
    If I can ever help anyone in any way, feel free to ask.

  • Inconsistent database query error

    I get an error for a simple display query. I use MS Access and CF8. The error is as follows:-

    Run database query error.
    ''

    And to clarify that two single quotes.

    The query I use is as follows: -.

    SELECT *.
    OF tbl_positionRequest
    WHERE position = ' #URL. Position #'
    ORDER BY Position CAD

    He said that the error occurs in the line WHERE.
    The variable is passed correctly, I the debugged in the origin and home page. The funny this is that the output in the debug information is correct when I run it in access and the same query works for another data base (with different domain names).

    In CF Admin I use access Unicode driver and I think that might be the problem.

    Any help would be appreciated.
    See you soon
    David

    Run the query with just the select and from clauses. Do not display the data, just look at the recordcount. I guess a word reserved with position problem.

  • another error executing database query.

    I get this error.
    12:40:54.054 - database Exception: in C:\CFusionMX7\wwwroot\Author\dropdown2\EmployeeAddAction.cfm: line 26
    Run database query error.

    I added additional fields in the mdb and added extra code to the page of the form and action page.
    I still get this error.
    That's how I broke it down.

    If I run my 2 files EmployeeAddForm.cfm and EmployeeAddAction.cfm
    I get this error:


    NOTE: if I take the code comments and ignore the new fields added to the DB it works fine!

    The web site, you access has met an unexpected error.
    Please contact the site administrator.

    The following information is for the creation of Web sites for debugging purposes.

    Error occurred while processing request
    Run database query error.
    [Macromedia] [SequeLink JDBC Driver] [ODBC Socket] [Microsoft] [ODBC Microsoft Access driver] Syntax error in INSERT INTO statement.


    Resources:
    Enable robust Exception information to provide more details about the source of errors. In the administrator, click debugging & logging > debugging settings and select the robust exception information option.
    See the ColdFusion documentation to verify that you are using the correct syntax.
    Search the Knowledge Base to find a solution to your problem.


    Browser Mozilla/4.0 (compatible; INTERNET EXPLORER 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)
    Remote address 127.0.0.1
    Reference http://127.0.0.1:8500/Author/dropdown2/EmployeeAddForm.cfm
    Time June 6 07 12:40

    NOTE: if I take the code comments and ignore the new fields added to the DB it works fine!

    I get this error.
    12:40:54.054 - database Exception: in C:\CFusionMX7\wwwroot\Author\dropdown2\EmployeeAddAction.cfm: line 26
    Run database query error.

    I added additional fields in the mdb and added extra code to the page of the form and action page.
    I still get this error.
    That's how I broke it down.

    If I run my 2 files EmployeeAddForm.cfm and EmployeeAddAction.cfm
    I get this error:

    NOTE: if I take the code comments and ignore the new fields added to the DB it works fine!

    The web site, you access has met an unexpected error.
    Please contact the site administrator.

    The following information is for the creation of Web sites for debugging purposes.

    Error occurred while processing request
    Run database query error.
    [Macromedia] [SequeLink JDBC Driver] [ODBC Socket] [Microsoft] [ODBC Microsoft Access driver] Syntax error in INSERT INTO statement.

    Resources:
    Enable robust Exception information to provide more details about the source of errors. In the administrator, click debugging & logging > debugging settings and select the robust exception information option.
    See the ColdFusion documentation to verify that you are using the correct syntax.
    Search the Knowledge Base to find a solution to your problem.

    Browser Mozilla/4.0 (compatible; INTERNET EXPLORER 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)
    Remote address 127.0.0.1
    Reference http://127.0.0.1:8500/Author/dropdown2/EmployeeAddForm.cfm
    Time June 6 07 12:40

    NOTE: if I take the code comments and ignore the new fields added to the DB it works fine!

  • Run database query, invalid use of the:

    I have a tutorial of ColdfusionMX problem when I get to add tags on the top of the code view. And I write the same thing as the tutorial.
    I get an error message that says:
    Query execution error database.
    error occurred during the processing of the application.
    Invalid use of ',' () in a query expression

    I need help desperately,
    Geordeslys,

    The web site, you access has met an unexpected error.
    Please contact the site administrator.

    The following information is for the creation of Web sites for debugging purposes.

    Error occurred while processing request
    Run database query error.
    Invalid use of '. «, » !', ou « () ». in a query expression ' ARTISTS. ARTISTID = ART. ARTISTID AND ART. MEDIAID = MEDIA. MEDIAID.

    The error occurred in C:\CFusionMX7\wwwroot\CFIDE\gettingstarted\tutorial\TMPhy0vtntf3u.cfm: line 1

    1:
    2: SELECT FIRSTNAME, LASTNAME, ARTNAME, DESCRIPTION, PRICE, LARGEIMAGE, ISSOLD, MEDIATYPE
    3: ART, ARTISTS, MEDIA

    --------------------------------------------------------------------------------
    Dear CF_dev2,

    Is that what you mean by full CF code?

    Georgeslys,
    SQL SELECT FIRSTNAME, LASTNAME, ARTNAME, DESCRIPTION, PRICE, LARGEIMAGE, ISSOLD, MEDIATYPE OF ARTISTS, ART, MEDIA WHERE ARTISTS. ARTISTID = ART. ARTISTID AND ART. MEDIAID = MEDIA. MEDIAID
    Cftutorial DATA source
    VENDORERRORCODE 3092
    SQLSTATE

    Resources:
    See the ColdFusion documentation to verify that you are using the correct syntax.
    Search the Knowledge Base to find a solution to your problem.

    Browser Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.0.3705; .NET CLR 1.1.4322;. PC Media Center 4.0; IEMB3; IEMB3)
    Remote address 127.0.0.1
    Referrer
    Date/time 03-Sep-07 19:11

    Stack trace (click to enlarge)
    at cfTMPhy0vtntf3u2ecfm1461475070.runPage (C:\CFusionMX7\wwwroot\CFIDE\gettingstarted\tutoria l\TMPhy0vtntf3u.cfm:1) at cfTMPhy0vtntf3u2ecfm1461475070.runPage (C:\CFusionMX7\wwwroot\CFIDE\gettingstarted\tutoria l\TMPhy0vtntf3u.cfm:1)

    com.inzoom.adojni.ComException: invalid use of '. «, » !', ou « () ». in a query expression ' ARTISTS. ARTISTID = ART. ARTISTID
    AND ART. MEDIAID = MEDIA. MEDIAID. in the Microsoft JET Database Engine = 3092 code Type = 1
    at com.inzoom.ado.Command.jniExecute (Native Method)
    at com.inzoom.ado.Command.execute(Command.java:40)
    at com.inzoom.jdbcado.Statement.exec(Statement.java:34)
    at com.inzoom.jdbcado.Statement.execute(Statement.java:107)
    at coldfusion.server.j2ee.sql.JRunStatement.execute(JRunStatement.java:212)
    at coldfusion.sql.Executive.executeQuery(Executive.java:753)
    at coldfusion.sql.Executive.executeQuery(Executive.java:675)
    at coldfusion.sql.Executive.executeQuery(Executive.java:636)
    at coldfusion.sql.SqlImpl.execute(SqlImpl.java:236)
    at coldfusion.tagext.sql.QueryTag.doEndTag(QueryTag.java:500)
    at cfTMPhy0vtntf3u2ecfm1461475070.runPage (C:\CFusionMX7\wwwroot\CFIDE\gettingstarted\tutoria l\TMPhy0vtntf3u.cfm:1)
    at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:152)
    at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:349)
    at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)
    at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:225)
    at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:51)
    at coldfusion.filter.PathFilter.invoke(PathFilter.java:86)
    at coldfusion.filter.LicenseFilter.invoke(LicenseFilter.java:27)
    at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:69)
    at coldfusion.filter.ClientScopePersistenceFilter.invoke (ClientScopePersistenceFilter.java:2 8)
    at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
    at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
    at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
    at coldfusion.filter.RequestThrottleFilter.invoke(RequestThrottleFilter.java:115)
    to coldfusion. CfmServlet.service (CfmServlet.java:107)
    at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:78)
    at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:91)
    at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
    at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:257)
    at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:541)
    at jrun.servlet.http.WebService.invokeRunnable(WebService.java:172)
    to jrunx.scheduler.ThreadPool$ DownstreamMetrics.invokeRunnable (ThreadPool.java:318)
    to jrunx.scheduler.ThreadPool$ ThreadThrottle.invokeRunnable (ThreadPool.java:426)
    to jrunx.scheduler.ThreadPool$ UpstreamMetrics.invokeRunnable (ThreadPool.java:264)
    at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)

  • Helps air: Error executing database query

    I get the message 'Error executing database query' whenever I click on the 'Préférences' button in the help air (if model Classic or cross-tab Malaccaaccordian). I can reject the message and the Preferences dialog box is displayed, but while the content tab seems to work the comments tab seems to be ignored.

    I get the same message when I try to add a comment to a topic.

    Any ideas?

    EDIT: I should mention that I'm on Vista Home Premium.

    UPDATE: seems to only affect projects upgraded X 5; the native projects v7 are have (so far).

    No worries. I need this only for demo AIR help anyway - so the project used native v7 exclusively.

  • Smartphones from blackBerry app JAVA database query

    I want to develop a simple application for blackberry that allows me to send and receive data from a MySQL server. I don't know if Java Mobile Programming, but know that I need some kind of web service/servlet.  I tried to find out how I can do this in tutorials and forums of blackberry, but without success. Basically I want to query a MySQL database from a blackberry and want to the returned result. Is this possible? Can someone point me in the right direction of any tutorials/sample code? Or offer easier alternatives?

    Hi and welcome to the Forums!

    You'll probably have more luck down in the development forums:

    This section is generally direct device support on how it works already.

    Good luck!

  • the variable name of database query to SQL Server using the Oracle database link

    Hi all

    I have an ApEx 4.1 application running on x 64 (11.2.0.1) 11g on Windows Server 2008 x 64, and I have a few points of data integration with SQL (2005 and 2008) server that I need to create. I have configured the database with dg4odbc link and it works perfectly... I can run queries on the SQL Server database without any problem using the database link.

    However, there is a scenario where the SQL Server database name is dynamic, and I need to generate on the fly in a PL/SQL block and then use it in a query dynamic SQL (all this in the ApEx). It of wherever I meet problems... when I asked the default database that is based on the ODBC connection and I don't have to specify the name of the database, no problem. But when I need access to one of the several other databases by default, I received the error "invalid table.

    It works well:* (note that 'fv' is the name of my database link)

    v_query1: = "select 'Release Date' from dbo." Schedules@FV where dbo. Annexes. "" SchedID "=: calendar";
    EXECUTE IMMEDIATE v_query1 in rel_date using the grid.




    I then take this rel_date variable, convert a varchar2 (rel_date_char), then use it as the name of the database in the following query...


    _ It returns an error(error ORA-00903: invalid table name)

    v_query2: = "select"PARTNO": rel_date_char.dbo.ProdDetails@fv where 'SchedID' =: calendar and"UnitID"=: unit"
    and 'MasterKey' =: master and "ParentKey" =: parent';

    EXECUTE IMMEDIATE v_query2 in part_number using planning, master, parent unit;



    I also tried using all of the following conditions without result:

    "select"PARTNO"of" | : rel_date_char | '.dbo. ProdDetails@fv where 'SchedID '...
    "select"PARTNO"of" | rel_date_char | '.dbo. ProdDetails@fv where 'SchedID '...
    "select"PARTNO"of" | @rel_date_char | '.dbo. ProdDetails@fv where 'SchedID '...
    "select"PARTNO"in @rel_date_char.dbo.ProdDetails @fv where 'SchedID'..."


    Is it possible to do it in PL/SQL?

    Thanks for any help!
    -Ian C.

    Published by: 946532 on July 15, 2012 19:45

    Just did a test using passthrough:

    SQL > set serveroutput on
    SQL > declare
    2 val varchar2 (100);
    3 c whole;
    4 whole nr;
    5. start
    c: 6 = dbms_hs_passthrough.open_cursor@FREETDS_DG4ODBC_EMGTW_11_2_0_3;
    7 dbms_hs_passthrough.parse@FREETDS_DG4ODBC_EMGTW_11_2_0_3 (c, "select count (*) from EMP");
    8 LOOP
    9 nr: = DBMS_Hs_Passthrough.fetch_row@FREETDS_DG4ODBC_EMGTW_11_2_0_3 (c);
    10 output when nr = 0;
    11 dbms_hs_passthrough.get_value@FREETDS_DG4ODBC_EMGTW_11_2_0_3 (c, 1, val);
    12 dbms_output.put_line (val);
    13 end of loop;
    14 dbms_hs_passthrough.close_cursor@FREETDS_DG4ODBC_EMGTW_11_2_0_3 (c);
    15 end;
    16.
    24576

    PL/SQL procedure successfully completed.

    SQL > declare
    2 val varchar2 (100);
    3 c whole;
    4 whole nr;
    5. start
    c: 6 = dbms_hs_passthrough.open_cursor@FREETDS_DG4ODBC_EMGTW_11_2_0_3;
    7 dbms_hs_passthrough.parse@FREETDS_DG4ODBC_EMGTW_11_2_0_3 (c, ' select count (*) from dbo.) EMP');
    8 LOOP
    9 nr: = DBMS_Hs_Passthrough.fetch_row@FREETDS_DG4ODBC_EMGTW_11_2_0_3 (c);
    10 output when nr = 0;
    11 dbms_hs_passthrough.get_value@FREETDS_DG4ODBC_EMGTW_11_2_0_3 (c, 1, val);
    12 dbms_output.put_line (val);
    13 end of loop;
    14 dbms_hs_passthrough.close_cursor@FREETDS_DG4ODBC_EMGTW_11_2_0_3 (c);
    15 end;
    16.
    24576

    PL/SQL procedure successfully completed.

    So all 3 ways work for me.

    Published by: kgronau on July 23, 2012 10:08

    Now, using the variables to make the selection:

    SQL > declare
    2 val varchar2 (100);
    3 c whole;
    4 whole nr;
    5 tabname varchar2 (20): = 'EMP ';
    6 ownr varchar2 (20): = "dbo."
    7 dbname varchar2 (20): = "door";
    Start 8
    c: 9 = dbms_hs_passthrough.open_cursor@FREETDS_DG4ODBC_EMGTW_11_2_0_3;
    10 dbms_hs_passthrough.parse@FREETDS_DG4ODBC_EMGTW_11_2_0_3 (c, ' SELECT count (*) FROM ': dbname: '.) ' || ownr | '.'|| tabname | ") ;
    11 LOOP
    12 nr: = DBMS_Hs_Passthrough.fetch_row@FREETDS_DG4ODBC_EMGTW_11_2_0_3 (c);
    13 when the exit nr = 0;
    14 dbms_hs_passthrough.get_value@FREETDS_DG4ODBC_EMGTW_11_2_0_3 (c, 1, val);
    15 dbms_output.put_line (val);
    16 end loop;
    17 dbms_hs_passthrough.close_cursor@FREETDS_DG4ODBC_EMGTW_11_2_0_3 (c);
    18 end;
    19.
    24576

    PL/SQL procedure successfully completed.

    => instead of executing the statement using the "execute Immediate" we use the PASTHROUGH package to pass the statement to SQL Server.

    Published by: kgronau on July 23, 2012 10:10

  • JDeveloper database query processing

    Hello

    im working with jdeveloper 11g. I have an application that displays database data in the table in the adf. In the app, I created display objects, connected via links. I some jsp pages, each of which contains 2 buttons, text fields, labels and the adf table that contains the data from database.

    When im switching between pages it takes about 5 seconds.
    When im updating the table (based on the specified time limits) he picks up at the minute. When im using TOAD, to get the data from database, the same request is processed in a second or two, but in jdeveloper it takes a minute, sometimes more. (2000 lines takes around 40seconds)

    Scrolling also takes a lot of time to 10seconds per minute, depends on the data, but in any case, it takes 20 seconds when there are about 1000 rows in the table and it is too long to wait.

    most of the time takes the query, the table display is only 1/3 of the time indicated and less.

    Do you know where the problem may be? or it's ok and jdevelopers apps are so slow?

    Thank you
    Katka

    Katka,
    as far as I know you did everything you could do. You must play with smaller numbers of lot and the beach. Normal sound better to the series 'number of visible row in the table, plus 3.
    The big means numbers that even if you see are 25 lines you get 500 (up to 475 to many). This often happens if you highlight the result set.

    Moreover, it is never a good practice to give the user the ability to scroll over these large result sets.
    Do you really need to do this?

    Timo

  • Database query - 2147467259 ADO error: 0x80004005

    So I'll have more database problems.  This I think is a bit simpler.  I have an Access database and in it, I have a table with several columns of data.  I want to get the maximum value for a column of this table.  One of my columns gives me a problem with this and I don't know why.  Here is my code:

    You can see reading of voltage and power of work very well, but the current read attempt returns an error.  Research on the site of NOR, this error is used for many things and it is usually due to a problem of 32 or 64 bits, but in this case the reading has worked on two previous columns that are also an I32, but the third time, it is not.  It also fails immediately when you try running everything first, so it is likely that something with this column.  Is there something I can check?  I opened in Access and has been able to do a query with the Query Wizard to find the max current min.  The database he is over 1 GB so posted will be not possible.  Same size, it could be a problem.  Any suggestions?  Thank you.

    If the current is a reserved word in Access?

  • SQL Query hierarchical select 2 level parent over sheet.

    Here, we use Oracle 11 g R1. Here is a sample of our Tables of the employee.

    I want you select all managers managers above them (which we call the Site Manager) and direct (that we call the Service Manager)

    Here is the example for the base table.

    SET DEFINE OFF;
    CREATE TABLE EMP_SAMPLE 
    (
      AGENT_ID VARCHAR2(100 BYTE) 
    , FULL_NAME VARCHAR2(100 BYTE) 
    , AGENT_MANAGER VARCHAR2(100 BYTE) 
    ) ;
    
    Insert into EMP_SAMPLE (AGENT_ID,FULL_NAME,AGENT_MANAGER) values ('JS001','JOHN SMITH',null);
    Insert into EMP_SAMPLE (AGENT_ID,FULL_NAME,AGENT_MANAGER) values ('AL001','ANN LEE','JS001');
    Insert into EMP_SAMPLE (AGENT_ID,FULL_NAME,AGENT_MANAGER) values ('JD001','JOHN DOE','AL001');
    Insert into EMP_SAMPLE (AGENT_ID,FULL_NAME,AGENT_MANAGER) values ('MB002','MARY BAKER','AL001');
    Insert into EMP_SAMPLE (AGENT_ID,FULL_NAME,AGENT_MANAGER) values ('HM003','HOWARD MONROE','MB002');
    Insert into EMP_SAMPLE (AGENT_ID,FULL_NAME,AGENT_MANAGER) values ('RM001','ROBYN MILLER','MB002');
    Insert into EMP_SAMPLE (AGENT_ID,FULL_NAME,AGENT_MANAGER) values ('DJ002','DAVID JONES','RM001');
    Insert into EMP_SAMPLE (AGENT_ID,FULL_NAME,AGENT_MANAGER) values ('WW001','WENDY WONG','MB002');
    Insert into EMP_SAMPLE (AGENT_ID,FULL_NAME,AGENT_MANAGER) values ('PB001','PETER RABBIT','JS001');
    Insert into EMP_SAMPLE (AGENT_ID,FULL_NAME,AGENT_MANAGER) values ('BB002','BEN BUNNY','PB001');
    Insert into EMP_SAMPLE (AGENT_ID,FULL_NAME,AGENT_MANAGER) values ('TM001','TONY MILLER','BB002');
    Insert into EMP_SAMPLE (AGENT_ID,FULL_NAME,AGENT_MANAGER) values ('PP002','PETER PARKER','RM001');
    Insert into EMP_SAMPLE (AGENT_ID,FULL_NAME,AGENT_MANAGER) values ('PP003','PEPPA PIG','PB001');
    Insert into EMP_SAMPLE (AGENT_ID,FULL_NAME,AGENT_MANAGER) values ('DB002','daniel baker','HM003');
    Insert into EMP_SAMPLE (AGENT_ID,FULL_NAME,AGENT_MANAGER) values ('TL001','Tom Lee','WW001');
    Insert into EMP_SAMPLE (AGENT_ID,FULL_NAME,AGENT_MANAGER) values ('MS001','Mary Smith',null);
    

    With the example like this data, I would like to that the result looks similar to

    Name of the Manager

    MARY BAKER - Manager of the Site

    HOWARD MONROE - Service Manager

    ROBYN MILLER - Service Manager

    WENDY WOND - Service Manager

    PETER RABBIT Site Manager

    BEN BUNNY - Service Manager

    I guess I should use the hierarchical query to achieve this. I googled to see all the solutions, I tried this under request

    SELECT agent_id, agent_manager, RPAD('.', (level-1)*2, '.') || full_name AS tree,
           level, CONNECT_BY_ROOT agent_id as root_id
           ,CONNECT_BY_ISLEAF AS is_leaf
    
    FROM EMP_SAMPLE
    START WITH agent_manager IS NULL
    CONNECT BY agent_manager = PRIOR agent_id
    ORDER SIBLINGS BY agent_id;
    

    But it seems that the level always starts from the root at the top of the page. I wonder, is it possible to identify even just the level two above the sheet.

    Here is some basic information. We are working on our oracle APEX application. One of the reports can be filtered by the Manager. The list currently shows a little all managers, regardless of what they are 1 senior as general manager, or the first line as a Service Manager Manager. Now, users want to be able to select only Service Manager and Site Manager.

    There is a DB work for updating the table Employee of LDAP. And the LDAP structure is not tidy this (we have some staff members who have no Manager, they are not even CEO). The Administrator told us that it is too busy to store it.

    We have about 20,000 employees in total including 800 East of managers.

    Thanks in advance.

    Ann

    Hi, Ann.

    Ann586341 wrote:

    Here, we use Oracle 11 g R1. Here is a sample of our Tables of the employee.

    I want you select all managers managers above them (which we call the Site Manager) and direct (that we call the Service Manager)

    Here is the example for the base table.

    1. TOGETHER TO DEFINE
    2. CREATE TABLE EMP_SAMPLE
    3. (
    4. AGENT_ID VARCHAR2 (100 BYTE)
    5. FULL_NAME VARCHAR2 (100 BYTE)
    6. AGENT_MANAGER VARCHAR2 (100 BYTE)
    7. ) ;
    8. Insert into EMP_SAMPLE (AGENT_ID, FULL_NAME, AGENT_MANAGER) values ('JS001', 'JOHN SMITH', null);
    9. Insert into EMP_SAMPLE (AGENT_ID, FULL_NAME, AGENT_MANAGER) values ('AL001', "ANN LEE", "JS001");
    10. Insert into EMP_SAMPLE (AGENT_ID, FULL_NAME, AGENT_MANAGER) values ('JD001', 'JOHN DOE', "AL001");
    11. Insert into EMP_SAMPLE (AGENT_ID, FULL_NAME, AGENT_MANAGER) values ('MB002', "MARY BAKER", "AL001");
    12. Insert into EMP_SAMPLE (AGENT_ID, FULL_NAME, AGENT_MANAGER) values ('HM003', 'HOWARD MONROE', 'MB002');
    13. Insert into EMP_SAMPLE (AGENT_ID, FULL_NAME, AGENT_MANAGER) values ('RM001", 'ROBYN MILLER', 'MB002');
    14. Insert into EMP_SAMPLE (AGENT_ID, FULL_NAME, AGENT_MANAGER) values ('DJ002', 'DAVID JONES', "RM001");
    15. Insert into EMP_SAMPLE (AGENT_ID, FULL_NAME, AGENT_MANAGER) values ('WW001', "WENDY WONG", "MB002");
    16. Insert into EMP_SAMPLE (AGENT_ID, FULL_NAME, AGENT_MANAGER) values ('PB001', 'PETER RABBIT', "JS001");
    17. Insert into EMP_SAMPLE (AGENT_ID, FULL_NAME, AGENT_MANAGER) values ('BB002', "BEN BUNNY", "PB001");
    18. Insert into EMP_SAMPLE (AGENT_ID, FULL_NAME, AGENT_MANAGER) values ('TM001', 'TONY MILLER', "BB002");
    19. Insert into EMP_SAMPLE (AGENT_ID, FULL_NAME, AGENT_MANAGER) values ('PP002","PETER PARKER","RM001");
    20. Insert into EMP_SAMPLE (AGENT_ID, FULL_NAME, AGENT_MANAGER) values ('PP003', 'PEPPA PIG', "PB001");
    21. Insert into EMP_SAMPLE (AGENT_ID, FULL_NAME, AGENT_MANAGER) values ('DB002', "daniel baker", "HM003");
    22. Insert into EMP_SAMPLE (AGENT_ID, FULL_NAME, AGENT_MANAGER) values ('TL001', "Tom Lee", "WW001");
    23. Insert into EMP_SAMPLE (AGENT_ID, FULL_NAME, AGENT_MANAGER) values ('MS001', 'Mary Smith', null);

    With the example like this data, I would like to that the result looks similar to

    Name of the Manager

    MARY BAKER - Manager of the Site

    HOWARD MONROE - Service Manager

    ROBYN MILLER - Service Manager

    WENDY WOND - Service Manager

    PETER RABBIT Site Manager

    BEN BUNNY - Service Manager

    I guess I should use the hierarchical query to achieve this. I googled to see all the solutions, I tried this under request

    1. SELECT agent_id, agent_manager, RPAD ('.) (', (level 1) * 2, '.') || full_name LIKE tree,
    2. level, agent_id CONNECT_BY_ROOT as root_id
    3. CONNECT_BY_ISLEAF AS is_leaf
    4. OF EMP_SAMPLE
    5. START WITH agent_manager IS NULL
    6. CONNECT BY PRIOR agent_id = agent_manager
    7. Brothers and SŒURS of ORDER BY agent_id;

    But it seems that the level always starts from the root at the top of the page. I wonder, is it possible to identify even just the level two above the sheet.

    Here is some basic information. We are working on our oracle APEX application. One of the reports can be filtered by the Manager. The list currently shows a little all managers, regardless of what they are 1 senior as general manager, or the first line as a Service Manager Manager. Now, users want to be able to select only Service Manager and Site Manager.

    There is a DB work for updating the table Employee of LDAP. And the LDAP structure is not tidy this (we have some staff members who have no Manager, they are not even CEO). The Administrator told us that it is too busy to store it.

    We have about 20,000 employees in total including 800 East of managers.

    Thanks in advance.

    Ann

    Here's one way:

    WITH leaves LIKE

    (

    SELECT agent_id

    Of emp_sample

    LESS

    SELECT agent_manager

    Of emp_sample

    )

    got_lvl AS

    (

    SELECT-full_name agent_id

    LEVEL AS lvl

    Of emp_sample

    START WITH agent_id IN)

    SELECT agent_id

    Sheets

    )

    CONNECTION BY agent_id = agent_manager PRIOR

    )

    SELECT full_name

    CASE

    WHEN MAX (lvl) = 3

    THEN 'Site Manager'

    ANOTHER "Service Manager"

    END AS title

    OF got_lvl

    GROUP BY full_name-, agent_id

    WITH MIN (lvl) > = 2

    AND MAX (lvl)<=>

    ORDER BY full_name

    ;

    Output:

    FULL_NAME TITLE

    -------------------- ---------------

    BEN BUNNY Service Manager

    MONROE HOWARD Service Manager

    MARY BAKER Site Manager

    PETER RABBIT Site Manager

    ROBYN MILLER Service Manager

    WENDY WONG Service Manager

    Thanks for posting the CREATE TABLE and INSERT statements; It's very useful!

    LEVEL does not always begin with the root; It starts with the lines that meet the condition to START WITH.  If you have a START WITH condition that only roots meet (as in the query you posted) then, Yes, LEVEL will start with the roots.  If you have a condition START WITH answering the criteria only the leaves (as in the query I posted), then LEVEL will start with the leaves.

    I guess just some of your needs.  If seems that a 'Site Manager' is the grandparent of a leaf, but "John Smith" (which is the grandmother of "John Doe", a sheet) is not considered to be a 'Site Manager'.  Similarly, it seems that a 'Service Manager' is the parent (but not the grand-parent) of the leaf, but "Ann Lee" (the mother of "John Doe") is not considered to be a 'Service Manager' for a reason any.

    I guess that full_name is unique.  If full_name is not unique, but agent_id is, then you will need a comment a few line above ends.  (I guess that agent_id is unique and not NULL).

Maybe you are looking for