Display the results in the String form: dosen't work based on the example

Hello

To understand How to display the results as a string, I tried to reproduce this:
[http://apex.oracle.com/pls/otn/f?p=31517:84 | http://apex.oracle.com/pls/otn/f?p=31517:84]

I have my emp table
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 7839  KING PRESIDENT -  81-11-17 5000 -  10 
 7698 BLAKE MANAGER 7839 81-05-01 2850 -  30 
 7782 CLARK MANAGER 7839 81-06-09 2450 -  10 
 7566 JONES MANAGER 7839 81-04-02 2975 -  20 
 7788 SCOTT ANALYST 7566 82-12-09 3000 -  20 
 7902 FORD ANALYST 7566 81-12-03 3000 -  20 
 7369 SMITH CLERK 7902 80-12-17 800 -  20 
 7499 ALLEN SALESMAN 7698 81-02-20 1600 300 30 
 7521 WARD SALESMAN 7698 81-02-22 1250 500 30 
 7654 MARTIN SALESMAN 7698 81-09-28 1250 1400 30 
 7844 TURNER SALESMAN 7698 81-09-08 1500 0 30 
 7876 ADAMS CLERK 7788 83-01-12 1100 -  20 
 7900 JAMES CLERK 7698 81-12-03 950 -  30 
 7934 MILLER CLERK 7782 82-01-23 1300 -  10 
I've created with the wizard, on my page, a new AREA of REPORT
-Selected SQL - RESULTS
-Name: Test
-Area Source Type: SQL Query
-Model region: region report


IN function enter SQL Query or PL/SQL returns a SQL query, I COPY-PASTE the following code to [http://apex.oracle.com/pls/otn/f?p=31517:84 | http://apex.oracle.com/pls/otn/f?p=31517:84]

DECLARE
   p_vc_arr2   htmldb_application_global.vc_arr2;
   p_string    VARCHAR2 (2000);
BEGIN
   SELECT ename
   BULK COLLECT INTO p_vc_arr2
     FROM emp
    WHERE deptno = :p84_select_deptno;

   p_string := 
     HTMLDB_UTIL.table_to_string (p_vc_arr2, ':');
   HTP.p (p_string);
END;
AND I have this error:

+ 1 error has occurred.
Invalid query, no found select statement

Is not a PL/SQP selected?

Do I did wrong?


Thank you

Roseline Paquin
Montreal, Canada

1 error has occurred
Invalid query, no found select statement

What happens if you try

DECLARE
   p_vc_arr2   htmldb_application_global.vc_arr2;
   p_string    VARCHAR2 (2000);
BEGIN
   SELECT ename
   BULK COLLECT INTO p_vc_arr2
     FROM emp
    WHERE deptno = :p84_select_deptno;

    return 'select ''' ||  HTMLDB_UTIL.table_to_string (p_vc_arr2, ':') || ''' str from dual';

END;

??

Tags: Database

Similar Questions

  • How to display each character in a string of entry in different lines

    Dear members,

    I want to write a SQL or PL/SQL where in I can separate and display each character in a string of entry in several lines.
    For example, the input string is TEST, I want the result is displayed as follows:

    1 T
    2 E
    3 S
    1 1
    5 I
    5 m
    8: 00

    I know that we can use substr, but it returns me one or more than one characters consecutively.
    Please help me to get the desired result.

    Thanks in advance.

    Hello

    Maybe

    with a as
    (
    select 'TESTING' text from dual
    )
    select level, substr(a.text,level,1)
    from a
    connect by level <= length(a.text)
    
  • Search for a similar string in the 2D array and displays the result with another column

    Hello

    One who can help, I have a chart 2D of txt file that have as many lines and 5 columns and I want to do a search and display the other results of the column.

    For example.

    Column 0                      1                           2                                  3                           4

    12345 qwer asdf 12qwe tjhrtyert

    werr 23568 wef fgertge fsefff

    If I manage to find 12345 and I want to display 12qwe, what should I do in labview? Help, please!

  • To display the result in the dialog box

    Hi all!

    I wonder if there is a way to make me at the end of a process, to display the result (number or string), I got in a dialog box.

    I mean at the end there is a dialog box containing the message as "the result is xxx" xxx is the result of this process.

    Any idea about it? Thanks in advance!

    Chao

  • Display the name of the tag as the column name and the value in the tag as a row of data from the input string.

    Hi Forum members,

    I am looking for a query display the name of the tag as the column name and the value in the tag as a row of data.

    I have to print the values within the tag to a file by choosing the value of the flags. the sequence of the tags will vary each time, as the tag name will change dynamically.

    So here is the example of input data and the expected output. The string in the text column must be separated as the column names and values.

    Input data
    Select 1 as seqno,' < > 0210A 50 4f < / 4f > < 5f20 > TEST CARD 16 < / 5f20 > < 5f2a > < / 5f2a > < 82 > 1 c 00 < / 82 > ' double text


    Output:

    Seqno 4f 5f20 5f2a 82
    0210A 50 16 1 00 TEST CARD 1

    Please help me by providing your entries on this.

    We use the version of Oracle 11.2.

    Note: This is not the XML string

    Thank you

    Shree

    with

    data in the form of

    (select 1 as seqno,'<4f>0210 A 50<5f20>TEST CARD 16<5F2a><82>00 1' text of all the double union)

    Select 2 as seqno,'XYZ<4F>0210 A 50<5f20>TEST CARD 16<5f2a><82>00 1' text of all the double union

    Select 3 as seqno,'<4f>0210 A 50<5f20>TEST CARD 16<5F2A><82>1 00XYZ ' text of all the double union

    Select option 4 as seqno,'<4F>0210 A 50<5F20>TEST CARD 16<5f2A><82>1 00XYZ' double text

    )

    Select d.seqno, x.*

    d the data,

    XMLTable ('/ root')

    by the way xmltransform (xmltype ('': replace (replace (text,'<><>'),)))

    XmlType (q'~http://www.w3.org/1999/XSL/Transform "version ="1.0"> ")

                                                     

                                                       

                                                         

                                                       

                                                     

                                                     

                                                       

                                                         

                                                       

                                                     

    ~'

    )

    )

    path of columns '4f' varchar2 (10) "tag4f."

    path of "5f20' varchar2 (30)"tag5f20. "

    path of '5f2a' varchar2 (10) "tag5f2a."

    path of varchar2 (10) "82" "tag82.

    ) x


    SEQNO 4f 5f20 5f2a 82
    1 0210A 50 16 TEST CARD - 1 00
    2 0210A 50 16 TEST CARD - 1 00
    3 0210A 50 16 TEST CARD - 1 00
    4 0210A 50 16 TEST CARD - 1 00

    with

    data in the form of

    (select 1 as seqno,'<4f>0210 A 50<5f20>TEST CARD 16<5F2a><82>00 1' text of all the double union)

    Select 2 as seqno,'XYZ<4F>0210 A 50<5f20>TEST CARD 16<5f2a><82>00 1' text of all the double union

    Select 3 as seqno,'<4f>0210 A 50<5f20>TEST CARD 16<5F2A><82>1 00XYZ ' text of all the double union

    Select option 4 as seqno,'<4F>0210 A 50<5F20>TEST CARD 16<5f2A><82>1 00XYZ' double text

    ),

    Chopper (seqno, Key, value, String) as

    (select seqno,

    regexp_substr (text,'<(.+?)>', 1, 1, null, 1),

    regexp_substr (Text,'>(.*?))

    regexp_substr (text,'<.+?>. *? ) (.*) $', 1, 1, null, 1). » <>'

    from the data

    Union of all the

    Select seqno,

    regexp_substr (String,'<(.+?)>', 1, 1, null, 1),

    regexp_substr (String,'>(.*?))

    regexp_substr (String,'<.+?>. *? ) (.*) $', 1, 1, null, 1)

    Chopper

    where regexp_substr (string,'<(.*?)>', 1, 1, null, 1) is not null

    )

    Select '4f', seqno, '5f2a', '82', '5f20.

    of (seqno, lower (key) select key, value)

    Chopper

    )

    Pivot (max (value) for key in ('4f' as '4f', '5f20' as '5f20', '5f2a' as '5f2a', "82" as "82"))

    Concerning

    Etbin

  • State form field to display the drop-down list of all States

    My client has an interest in having the STATE form field in the withdrawal form store a string to a field conversion menu drop-down displays the list of States. He only sells to the United States, so there are 50 lists. I don't think it's necessary, but is it possible?

    Thanks for your time!

    Mouma

    Hi Jeff,

    As long as her select field name is the same as it is for the text field (and just good to do the same thing for ID) then you can change it.

    Options whose value. Then come by in admin.

    Note that if the customer ships internationally is not a viable edition.

  • How to display the result sqlplus in java?

    I want to call sqlplus to run some commands sql in java, but how can I print the result of sqlplus?

    In java code, I call sqlplus as:

    Process of p;
    Run the command
    p = Runtime.getRuntime () .exec (commandString);
    print the result of the command
    InputStream inputStream = p.getInputStream ();

    How to display the result of the execution?

    Published by: Yi on February 26, 2012 23:41

    You can use ProcessBuilder. Copy the following code starts sql * more and runs the script in the variable "filename". It displays the results in the console of NetBeans.

    import java.io.BufferedReader;
    import java.io.InputStreamReader;
    import java.io.File;
    import java.util.Map;
    
    public class test1 {
    
        public static void main (String args []) {
    
            test_script();
        }
    
        public static void test_script () {
    
            String fileName = "@test_table.sql";
            String sqlPath = "E:\\";
    
            String sqlCmd = "sqlplus";
    
            String arg1   = "user/password@sid"; -- plug in your user, password and db name
            String arg2   = fileName;
            try {
                String line;
                ProcessBuilder pb = new ProcessBuilder(sqlCmd, arg1, arg2);
                Map env = pb.environment();
                env.put("VAR1", arg1);
                env.put("VAR2", arg2);
                pb.directory(new File(sqlPath));
                pb.redirectErrorStream(true);
                Process p = pb.start();
              BufferedReader bri = new BufferedReader
                (new InputStreamReader(p.getInputStream()));
              BufferedReader bre = new BufferedReader
                (new InputStreamReader(p.getErrorStream()));
              while ((line = bri.readLine()) != null) {
                System.out.println(line);
              }
              bri.close();
              while ((line = bre.readLine()) != null) {
                System.out.println(line);
              }
              bre.close();
              System.out.println("Done.");
            }
            catch (Exception err) {
              err.printStackTrace();
            }
    
        }
    
    }
    

    Here is the content of the script at E:\\test_table.sql

    Prompt drop TABLE ANOTHER_TEST;
    DROP TABLE ANOTHER_TEST CASCADE CONSTRAINTS
    /
    
    Prompt Table ANOTHER_TEST;
    CREATE TABLE ANOTHER_TEST
    (
      BATCH_SEQ             NUMBER,
      BATCH_GROUP_ID        NUMBER,
      STATUS_FLAG           VARCHAR2(30 BYTE),
      OBJ_BEING_PROCESSED   VARCHAR2(80 BYTE),
      BATCH_RUN_START_DTTM  DATE,
      BATCH_RUN_END_DTTM    DATE,
      CREATE_DTTM           DATE,
      CREATE_USER           VARCHAR2(30 BYTE),
      UPDATE_DTTM           DATE,
      UPDATE_USER           VARCHAR2(30 BYTE)
    )
    LOGGING
    NOCOMPRESS
    NOCACHE
    PARALLEL ( DEGREE DEFAULT INSTANCES DEFAULT )
    MONITORING
    /
    
    COMMENT ON TABLE ANOTHER_TEST IS 'This is a test table.'
    /
    
    EXIT
    /
    
  • Tax calculation based on the user in the box input and displaying the result.

    Thanks to WhyIsThisMe for starting me on my first draft script & Jono! I'm almost there with my purchase requisition form (90% manufactured from the tutorial).  Everything works except for the taxable column

    form.JPG

    I can't understand the correct syntax to check the value of the checkbox in the column taxable and then do the math for the tax based on user input in the field % tax

    (total * stateTaxPercent / 100)

    Essentially, I want to make the calculation only the taxable = 1, and then display the cumulative tax in the tax field.

    Should I use mouseup as trigger to perform the calculation of the tax and save the result as a variable and displays the variable in the tax field? Then if another taxable box gets checked, I could add the new calculation of the variable. Not sure whether in an elegant way to get there.

    ?

    I would put the following text in the change event of each taxable check box (in formcalc):

    If ($ == 1) then

    tax = tax + (amount * 0,0825)

    ElseIf ($ == 0) then

    tax = tax - (quantity * 0,0825)

    endif

    (where 'tax' is what you called your total tax box and the 'amount' is what you called your box of price).

  • When I search something and click the Web site in the search results, I get nothing and the tab says something like "nclk (Image GIF 1 x 1 pixel)" what should I do to display the Web page?

    I just switch to Firefox this morning, but I used it in the past. I set Yahoo as my homepage, and it opens fine when I start Firefox but if I type something in the search bar, such as Wal-Mart or ebay it will display the search results, but when I click on the page I want to open, I get something like "nclk (Image GIF 1 x 1 pixel)" on any of the Web pages I have to choose. If I put www.walmart.com in the address bar, it works fine. What should I do?

    Using Kaspersky? This error is usually caused by a parameter in Kaspersky. In the Kaspersky Firewall section, under filter turn off the blocker of banner advertising (may be called anti-banner).

  • How to display the current Options in the window treatment result

    Hello

    I am preparing customized results processing plugin in TestStand. TS help I can use Base.OptionsDescriptionExpression to set the Options column in the window treatment result. In this column may consult the summary current settings. I want to display the path of the directory of report in this document, as in the sample report in Simple text format. Unfortunately I'm not able to do this...

    I use FileGlobals.ModelPluginComponentDescription.Default.InitializationExpression to set default report path, in plugin options, by using the following expression:

    #NoValidation, ModelPlugin.PluginSpecific.Options.ReportOptions.Directory = RunState.Engine.GetTestStandPath (TestStandPath_Public) + "\\Reports.

    Then I changed FileGlobals.ModelPluginComponentDescription.Default.Base.OptionsDescriptionExpression into #NoValidation, ModelPlugin.PluginSpecific.Options.ReportOptions.Directory which should contains the default path for the report estimated at InitializationExpression and this directory should be displayed in the column of the Options in the window treatment result.

    I don't know what Miss me, because it doesn't work. When I use the breakpoint in model Plugin - configure the Standard Options to see the Parameters.ModelPlugin.Base.OptionsDescriptionExpression, it displays:

    #NoValidation, / / disable validation because higher level ModelPlugin property exists only when running

    ""

    So it seems that my Default.Base is not copied in Parameters.ModelPlugin.Base

    So how do you view the current Options (at least report the path) in the window treatment outcome? Help, please

    OK, I think what is happening. FileGlobals.ModelPluginComponentDescription.InitializationExpression is evaluated when I add the new instance of the result new treatment-> insert plugin. Then each window treatment of the result of time shows that Parameters.modelplugin.base.optionsdescriptionexpression is evaluated to update the Options column.

  • To display the string on the one button dialog

    I would like to format the display of the string through the dialog box only one button.  How do I do that?  I want the text to ensure that the different color and style.  I'm a string constand feeding the node of a single button dialog box.  I was teo may change the color of the text on the block diagram, but when it is displayed, the color did not appear.

    You cannot format the text for the dialog a button. You must create your own dialog box. Examples are provided with LabVIEW.

  • How to make a loop to display the results of each iteration?

    I have a process inside a for loop and I want to display the results of 1, 2, 3 and 4 iterations all at once. Is it possible to do without creating 4 distinct for loops with a different constant for every N?

    Thanks for the help.


  • Is there a way to divide such ads and Add ons in a screen and automatically display search results in the other

    Original title: twomonitorsononepc

    I have two monitors on my pc is there any way for example divide ads and Add ons in a screen and automatically display search results in the other.

    or if facebook were used cat into one screen and status on the other screen please

    Hi Richard,

    What is the operating system installed on the computer?

    It seems that you need to divide the same application in several windows and place them in different monitors. Is this correct?

    Unfortunately, it is normal and you can not split the same application on two different monitors.

    Hope this information helps. Get back to us if you have more queries about Windows.

  • How to display the Html string into the field

    Hi guys. IM using Eclipse with jre 4.5.

    I need display text html (example"

    a text
    other tags... ")

    This text, I have to a String. I've read a lot of forums about this but never found.

    Can someone help me?

    Im trying using the browser, but it is not good... It hide my application and display the content (or a link such as "Google.com").

    I have to show this text in the field, with other areas.

    Help me please.

    Best regards, Peter.

    Thanks for the answer. But browserfield not supportede on 4.5. Is support for 5.0 +.

    While I do? (

  • call a stored procedure for each row in the transitional attribute and display the data in the form of af: table. The other rows are based on the entities

    Hi Experts,

    JDeveloper 12.1.3.0.0

    I have a VO based on entity object. With a column of the VO is transient attribute (I created).

    I need to call a stored procedure for each row in the transitional attribute and display the data in the form of af: table. As well as other attributes.

    So can anyone suggest how can I achieve this?

    Thank you

    AR

    I think that you need a stored function (which returns the value) in this case, is not?

    Take a look at:

    https://docs.Oracle.com/CD/B31017_01/Web.1013/b25947/bcadvgen005.htm

    and search for:

    Invoking stored function with only Arguments in

    call your function in the Get attribute and return value accessor...

Maybe you are looking for