Using the PL - SQL CAST function

Hi friends,

I write a stored procedure that attempts to convert a string returned by a function in a fixed-size varchar (3).


ex:

newChar varchar (3);


newChar: = cast (fn_getValue (aInputValue) as varchar (3));

This is the return type of the function ( fn_getValue) is varchar2 (4000), I should keep the return type as varchar2 because size should vary according to the entry.

When I run the procedure gives:

PLS-00103: encountered the symbol "(" quand attend une deles de valeurs suivantes:) "

. ) @ %

Please, help me to meet my needs.

Thanks for your reply...

It is a generic function and the 3 I've mentioned is just an example, it can change on different cases.

I tried with select cast (fn_getValue as varchar (aInputValue) (3)) in the double newChar; his work...

@John stegeman

Tags: Database

Similar Questions

  • I installed Adobe elements 12 update to 6 items.  I need to use the save for Web function, but it is grayed.  I tried re-installing 12 items three times in case there was something missing, but this has not solved the problem and save the enemy

    I installed Adobe elements 12 update to 6 items.  I need to use the save for Web function, but it is grayed.  I tried to reinstall 12 items three times where it was missing something, but this has not solved the problem and enemy Save Web feature is always gray on. How can I get this feature too much work. I contacted the home and they have happened to you. I have 20 minutes to make a customers web work and if I don't work (about £500). Please advise/help.

    You are on the Expert tab in the editor?

  • "How could I use the ' UTL_RAW. CAST_TO_VARCHAR2 ' function in apex?

    "How could I use the ' UTL_RAW. CAST_TO_VARCHAR2 ' function in apex?

    For what purpose?

    It's a little too vague to be able to help. Maybe you could read this...

    http://tkyte.blogspot.com/2005/06/how-to-ask-questions.html

    See you soon

    Ben

  • Retrieve and display a result set using the dynamic sql?

    Hi all

    How would display a result set in Oracle using the dynamic SQL? Reason being, the table where I'd retrieve and display the result set is a GLOBAL TEMP TABLE created in a stored procedure. If I try to use the loop as usual, the compiler complains that the table does not exist. This makes sense because the compiler does not recognize the table because it is created dynamically. Here is an example:

    create or replace PROCEDURE maketemptab IS
    sql_stmt VARCHAR2 (500);
    OutputString VARCHAR2 (50);

    BEGIN
    -create temporary table
    sql_stmt: = ' CREATE of TABLE TEMPORARY GLOBAL globtemptab (id NUMBER, col1 VARCHAR2 (50))';
    EXECUTE IMMEDIATE sql_stmt;
    dbms_output.put_line ('... created table ');

    -Insert a row into the temporary table
    sql_stmt: = "INSERT INTO globtemptab values (1, 'some data of a test')';"
    EXECUTE IMMEDIATE sql_stmt;
    dbms_output.put_line ('... inserted row ');

    -Insert a row into the temporary table
    sql_stmt: = ' INSERT INTO globtemptab values (2, "some more test data");
    EXECUTE IMMEDIATE sql_stmt;
    dbms_output.put_line ('... inserted row ');

    -Select the row on temporary table
    sql_stmt: = 'SELECT col1 FROM globtemptab WHERE id = 1';
    EXECUTE IMMEDIATE sql_stmt INTO outputstring;
    dbms_output.put_line ('... selected line: ' | outputstring);

    -drop temporary table
    sql_stmt: = 'DROP TABLE globtemptab;
    EXECUTE IMMEDIATE sql_stmt;
    dbms_output.put_line ('... moved table ');

    -display the result set
    for tabdata loop (select col1 from globtemptab)
    dbms_output.put_line ('... test of recovered data are' | tabdata.col1)
    end loop;
    end;


    In short, how to rewrite the SQL below the comment "to display the result set" using the dynamic sql?

    Thank you
    Amedeo.

    Hello

    Try this:

    CREATE OR REPLACE PROCEDURE maketemptab IS
       sql_stmt     VARCHAR2(500);
       outputstring VARCHAR2(50);
       v_cursor     SYS_REFCURSOR;
       v_col1       VARCHAR2(30);
    BEGIN
       -- create temp table
       sql_stmt := 'CREATE GLOBAL TEMPORARY TABLE globtemptab(id NUMBER, col1 VARCHAR2(50))';
       EXECUTE IMMEDIATE sql_stmt;
       dbms_output.put_line('...table created');
    
       -- insert row into temp table
       sql_stmt := 'INSERT INTO globtemptab values (1, ''some test data'')';
       EXECUTE IMMEDIATE sql_stmt;
       dbms_output.put_line('...row inserted');
    
       -- insert row into temp table
       sql_stmt := 'INSERT INTO globtemptab values (2, ''some more test data'')';
       EXECUTE IMMEDIATE sql_stmt;
       dbms_output.put_line('...row inserted');
    
       -- select row from temp table
       sql_stmt := 'SELECT col1 FROM globtemptab WHERE id=1';
       EXECUTE IMMEDIATE sql_stmt
          INTO outputstring;
       dbms_output.put_line('...row selected: ' || outputstring);
    
       OPEN v_cursor FOR 'SELECT col1 FROM globtemptab';
    
       LOOP
          FETCH v_cursor
             INTO v_col1;
          EXIT WHEN v_cursor%NOTFOUND;
          dbms_output.put_line('...test data retrieved is' || v_col1);
       END LOOP;
       CLOSE v_cursor;
    
       -- drop temp table
       sql_stmt := 'DROP TABLE globtemptab';
       EXECUTE IMMEDIATE sql_stmt;
       dbms_output.put_line('...table dropped');
    END;
    /
    

    Kind regards

  • Could not get the native web service response to Oracle using a PL/SQL < Message > function <! [CDATA [component "WS_CALC" must be said]] > < / Message >

    Hi, we have a problem with oracle native web service access using a PL/SQL function. We are running out of ideas how to solve the problem. Someone would be so nice to take a look at our case. Thank you much in advance. Best regards, Smiljana

    CREATE TABLE for_web_info (some_hello_text VARCHAR2 (150), when_inserted DATE, we_are_from VARCHAR2 (30));

    INSERT INTO for_web_info VALUES ('HI everyone :-) ', SYSDATE, 'Ljubljana, Slovenia');

    CREATE OR REPLACE

    PACKAGE ws_calc AUTHID CURRENT_USER AS

    FUNCTION CalcProduct (a NUMBER by DEFAULT 1,

    b in on NUMBER,

    g NUMBER of OUTPUT)

    RETURN NUMBER;

    END ws_calc;

    /

    CREATE OR REPLACE

    PACKAGE ws_calc AS BODY

    FUNCTION CalcProduct (a NUMBER by DEFAULT 1,

    b in on NUMBER,

    g NUMBER of OUTPUT)

    RETURN NUMBER IS

    product NUMBER;

    BEGIN

    SELECT SUM (1) IN the for_web_info OF g;

    product: = a * b;

    RETURN any product;

    END;

    END;

    /

    Our two DBA done all the steps described in the manual Oracle® XML DB's Guide Developer, 11 g Release 2 (11.2), E23094-04, February 2014, section using Oracle DB native XML Web Services.

    Access us two wsdl with browser without problem and get two of them. We also receive web serivce response which databese of query table.

    http://our_db:8080 / orawsv? WSDL

    http://our_db:8080 / orawsv/OUR_SCHEMA/WS_CALC/CALCPRODUCT? WSDL

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

    | First WSDL.

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

    <? XML version = "1.0"? >

    " < name definitions = targetNamespace"orawsv"=" http://xmlns.Oracle.com/orawsv "" "

    " xmlns =" http://schemas.xmlsoap.org/wsdl/ "

    ' xmlns:tns = ' http://xmlns.Oracle.com/orawsv "" "

    ' xmlns:soap = ' http://schemas.xmlsoap.org/WSDL/SOAP/ "

    " container = ' http://www.w3.org/2001/XMLSchema "

    " xmlns: xsi =" http://www.w3.org/2001/XMLSchema-instance "

    " xsi: schemaLocation =" http://schemas.xmlsoap.org/wsdl/ http://schemas.xmlsoap.org/wsdl/"> ".

    < types >

    < xsd: Schema

    " targetNamespace = ' http://xmlns.Oracle.com/orawsv "" "

    elementFormDefault = "qualified" >

    < xsd: element name = "query" >

    < xsd: complexType >

    < xsd: SEQUENCE >

    < xsd: element name = "DDL_text" type = "xsd: String".

    minOccurs = "0" maxOccurs = "unbounded" / >

    < xsd: element name = 'query_text' >

    < xsd: complexType >

    < xsd:simpleContent >

    < xsd:extension base = "XSD: String" >

    < xsd: attribute name = "type" >

    < xsd:simpleType >

    < xsd:restriction base = "xsd:NMTOKEN" >

    < value xsd: Enumeration = "SQL" / >

    < value xsd: Enumeration = "XQUERY" / >

    < / xsd:restriction >

    < / xsd:simpleType >

    < / xsd: attribute >

    < / xsd:extension >

    < / xsd:simpleContent >

    < / xsd: complexType >

    < / xsd: element >

    < xsd: Choice minOccurs = "0" maxOccurs = "unbounded" >

    < xsd: element name = "bind" >

    < xsd: complexType >

    < xsd:simpleContent >

    < xsd:extension base = "XSD: String" >

    < xsd: attribute name = "name" type = "xsd: String" / >

    < / xsd:extension >

    < / xsd:simpleContent >

    < / xsd: complexType >

    < / xsd: element >

    < xsd: element name = "bindXML" >

    < xsd: complexType >

    < xsd: SEQUENCE >

    < xsd: all / >

    < / xsd: SEQUENCE >

    < / xsd: complexType >

    < / xsd: element >

    < / xsd: Choice >

    < xsd: element name = "null_handling" minOccurs = "0" >

    < xsd:simpleType >

    < xsd:restriction base = "xsd:NMTOKEN" >

    < value xsd: Enumeration = "DROP_NULLS" / >

    < value xsd: Enumeration = "NULL_ATTR" / >

    < value xsd: Enumeration = "EMPTY_TAG" / >

    < / xsd:restriction >

    < / xsd:simpleType >

    < / xsd: element >

    < xsd: element name = "max_rows" type = "positiveInteger" minOccurs = "0" / >

    < xsd: element name = "skip_rows" type = "positiveInteger" minOccurs = "0" / >

    < xsd: element name = "pretty_print" type = "xsd: Boolean" minOccurs = "0" / >

    < xsd: element name = "indentation_width" type = "positiveInteger" minOccurs = "0" / >

    < xsd: element name = "rowset_tag" type = "xsd: String" minOccurs = "0" / >

    < xsd: element name = "row_tag" type = "xsd: String" minOccurs = "0" / >

    < xsd: element name = "item_tags_for_coll" type = "xsd: Boolean" minOccurs = "0" / >

    < / xsd: SEQUENCE >

    < / xsd: complexType >

    < / xsd: element >

    < xsd: element name = "queryOut" >

    < xsd: complexType >

    < xsd: SEQUENCE >

    < xsd: all / >

    < / xsd: SEQUENCE >

    < / xsd: complexType >

    < / xsd: element >

    < / xsd: Schema >

    < / types >

    < name of message = "QueryInput" >

    < name of part = element "body" = "tns:query" / >

    < / message >

    < name of the message 'XMLOutput' = >

    < name of part = element "body" = "tns:queryOut" / >

    < / message >

    < portType name = "ORAWSVPortType" >

    < operation name = "XMLFromQuery" >

    < input message = "tns:QueryInput" / >

    < output message = "tns:XMLOutput" / >

    < / operation >

    < / portType >

    < connection name = "ORAWSVBinding" type = "tns:ORAWSVPortType" >

    " < style: soap = transport = 'document' binding ' http://schemas.xmlsoap.org/SOAP/HTTP "/>

    < operation name = "XMLFromQuery" >

    " < soap: operation soapAction = ' http://our_db:8080 / orawsv "/>

    < input >

    < use of soap: body = "literal" / >

    < / Entry >

    < output >

    < use of soap: body = "literal" / >

    < / output >

    < / operation >

    < / binding >

    < service name = "ORAWSVService" >

    < documentation > Oracle Web Service < / documentation >

    < name of port = "ORAWSVPort" binding = "tns:ORAWSVBinding" >

    " < soap: address location = ' http://our_db:8080 / orawsv "/>

    < / port >

    < / service >

    < / definitions >

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

    | Second WSDL.

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

    <? XML version = "1.0"? >

    < name of definitions = "CALCPRODUCT."

    " targetNamespace = ' http://xmlns.Oracle.com/orawsv/OUR_SCHEMA/WS_CALC/CALCPRODUCT "" "

    " xmlns =" http://schemas.xmlsoap.org/wsdl/ "

    ' xmlns:tns = ' http://xmlns.Oracle.com/orawsv/OUR_SCHEMA/WS_CALC/CALCPRODUCT "" "

    " container = ' http://www.w3.org/2001/XMLSchema "

    ' xmlns:soap = ' http://schemas.xmlsoap.org/WSDL/SOAP/ ">

    < types >

    " < xsd: Schema targetNamespace = ' http://xmlns.Oracle.com/orawsv/OUR_SCHEMA/WS_CALC/CALCPRODUCT "" "

    elementFormDefault = "qualified" >

    < xsd: element name = "SNUMBER-CALCPRODUCTInput" >

    < xsd: complexType >

    < xsd: SEQUENCE >

    < xsd: element name = "G-NUMBER-OUT" >

    < xsd: complexType / >

    < / xsd: element >

    < xsd: element name = "B-NUMBER-INOUT" type = "xsd: double" / >

    < xsd: element name = "A-NUMBER-IN" minOccurs = "0" maxOccurs = "1" type = "xsd: double" / >

    < / xsd: SEQUENCE >

    < / xsd: complexType >

    < / xsd: element >

    < xsd: element name = "CALCPRODUCTOutput" >

    < xsd: complexType >

    < xsd: SEQUENCE >

    < xsd: element name = "RETURN" type = "xsd: double" / >

    < xsd: element name = "G" type = "xsd: double" / >

    < xsd: element name = "B" type = "xsd: double" / >

    < / xsd: SEQUENCE >

    < / xsd: complexType >

    < / xsd: element >

    < / xsd: Schema >

    < / types >

    < name of message = "CALCPRODUCTInputMessage" >

    < name of part = "parameters" element = "tns:SNUMBER - CALCPRODUCTInput" / >

    < / message >

    < name of message = "CALCPRODUCTOutputMessage" >

    < name of part = "parameters" element = "tns:CALCPRODUCTOutput" / >

    < / message >

    < portType name = "CALCPRODUCTPortType" >

    < operation name = "CALCPRODUCT" >

    < input message = "tns:CALCPRODUCTInputMessage" / >

    < output message = "tns:CALCPRODUCTOutputMessage" / >

    < / operation >

    < / portType >

    < connection name = "CALCPRODUCTBinding".

    Type = "tns:CALCPRODUCTPortType" >

    " < style: soap = transport = 'document' binding ' http://schemas.xmlsoap.org/SOAP/HTTP "/>

    < operation name = "CALCPRODUCT" >

    < soap: operation

    soapAction = "CALCPRODUCT" / >

    < input >

    < soap body parts: = 'settings' use = "literal" / >

    < / Entry >

    < output >

    < soap body parts: = 'settings' use = "literal" / >

    < / output >

    < / operation >

    < / binding >

    < service name = "CALCPRODUCTService" >

    < documentation > Oracle Web Service < / documentation >

    < name of port = "CALCPRODUCTPort" binding = "tns:CALCPRODUCTBinding" >

    < address soap:

    " location = ' http://our_db:8080 / orawsv/OUR_SCHEMA/WS_CALC/CALCPRODUCT "/>

    < / port >

    < / service >

    < / definitions >

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

    | SQL Developer |

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

    SET serveroutput ON

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

    | First WS.

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

    DECLARE

    V_SOAP_REQUEST XMLTYPE: = XMLTYPE (' <? xml version = "1.0"? > < env:Envelope xmlns:env = "http://www.w3.org/2002/06/soap-envelope " > < env:Body > < query xmlns = "http://xmlns.oracle.com/orawsv" > < type of the argument texte_requete = "SQL" > <!) ([CDATA [SELECT * FROM for_web_info WHERE the INSTR (UPPER (we_are_from),: e) > 0]] > < / query_text > < link name 'e' = > SLOVENIA < / bind > < false pretty_print > < / pretty_print > < / query > < / env:Body > < / env:Envelope > ');

    V_SOAP_REQUEST_TEXT CLOB: = V_SOAP_REQUEST.getClobVal ();

    V_REQUEST UTL_HTTP. REQ;

    V_RESPONSE UTL_HTTP. RESP;

    V_BUFFER VARCHAR2 (1024);

    URL VARCHAR2 (4000): = ' http://our_db:8080 / orawsv ';

    BEGIN

    V_REQUEST: = UTL_HTTP. BEGIN_REQUEST (URL = > URL, METHOD = > 'POST');

    UTL_HTTP. SET_AUTHENTICATION (R = > V_REQUEST, username = > 'OUR_U', PASSWORD = > 'OUR_P'); -not case-sensitive

    V_REQUEST. METHOD: = 'POST';

    UTL_HTTP. SET_HEADER (R = > V_REQUEST, NAME = > 'Content-Length', VALUE = > DBMS_LOB.) GETLENGTH (V_SOAP_REQUEST_TEXT));

    UTL_HTTP. WRITE_TEXT (R = > V_REQUEST, DATA = > V_SOAP_REQUEST_TEXT);

    V_RESPONSE: = UTL_HTTP. GET_RESPONSE (V_REQUEST);

    LOOP

    UTL_HTTP. READ_LINE (V_RESPONSE, V_BUFFER, TRUE);

    DBMS_OUTPUT. PUT_LINE (V_BUFFER);

    END LOOP;

    UTL_HTTP. END_RESPONSE (V_RESPONSE);

    EXCEPTION

    WHEN UTL_HTTP. END_OF_BODY THEN

    UTL_HTTP. END_RESPONSE (V_RESPONSE);

    END;

    anonymous block filled

    " <? xml version ="1.0"? > < envelope soap: xmlns:soap = ' http://www.w3.org/2002/06/SOAP-envelope ' > < soap: Body > < queryOut xmlns = " http://xmlns.Oracle.com/orawsv "> "

    < set of LINES > < ROW > < SOME_HELLO_TEXT > HI everybody :-) < / SOME_HELLO_TEXT > < WHEN_INSERTED > 03.10.14 < / WHEN_INSERTED > < WE_ARE_FROM > Ljubljana, Slovenia < / WE_ARE_FROM > < / ROW > < / rowset > < / queryOut > < / soap: Body > < / envelope soap: >

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

    | Second WS.

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

    DECLARE

    V_SOAP_REQUEST XMLTYPE: = XMLTYPE ("<?") XML version = "1.0"? > < soap envelope: xmlns:soap = "http://www.w3.org/2002/06/soap-envelope" > < soap: Body > < xmlns SNUMBER-CALCPRODUCTInput = ""http://xmlns.oracle.com/orawsv/OUR_SCHEMA/WS_CALC/CALCPRODUCT"(> < A-NUMBER-IN > 2 < / A-NUMBER-IN > < B-NUMBER-INOUT > 3 < / B-NUMBER-INOUT > < R-NUMBER-OUT / > < / SNUMBER-CALCPRODUCTInput > < / soap: Body > < / SOAP: envelope > '); "

    V_SOAP_REQUEST_TEXT CLOB: = V_SOAP_REQUEST.getClobVal ();

    V_REQUEST UTL_HTTP. REQ;

    V_RESPONSE UTL_HTTP. RESP;

    V_BUFFER VARCHAR2 (1024);

    URL VARCHAR2 (4000): = ' http://our_db:8080 / orawsv/OUR_SCHEMA/WS_CALC/CALCPRODUCT ';

    BEGIN

    V_REQUEST: = UTL_HTTP. BEGIN_REQUEST (URL = > URL, METHOD = > 'POST');

    UTL_HTTP. SET_AUTHENTICATION (R = > V_REQUEST, username = > 'OUR_U', PASSWORD = > 'OUR_P'); -not case-sensitive

    V_REQUEST. METHOD: = 'POST';

    UTL_HTTP. SET_HEADER (R = > V_REQUEST, NAME = > 'Content-Length', VALUE = > DBMS_LOB.) GETLENGTH (V_SOAP_REQUEST_TEXT));

    UTL_HTTP. WRITE_TEXT (R = > V_REQUEST, DATA = > V_SOAP_REQUEST_TEXT);

    V_RESPONSE: = UTL_HTTP. GET_RESPONSE (V_REQUEST);

    LOOP

    UTL_HTTP. READ_LINE (V_RESPONSE, V_BUFFER, TRUE);

    DBMS_OUTPUT. PUT_LINE (V_BUFFER);

    END LOOP;

    UTL_HTTP. END_RESPONSE (V_RESPONSE);

    EXCEPTION

    WHEN UTL_HTTP. END_OF_BODY THEN

    UTL_HTTP. END_RESPONSE (V_RESPONSE);

    END;

    anonymous block filled

    <? XML version = "1.0"? >

    " < envelope soap: xmlns:soap = ' http://www.w3.org/2002/06/SOAP-envelope/ ">

    < soap: Body >

    < soap: Fault >

    < Code: soap >

    < soap: value > SOAP: sender < / SOAP: value >

    < / Code: soap >

    entry processing < soap: reason > error < / SOAP: reason >

    < soap: detail >

    " < OracleErrors xmlns =" http://xmlns.Oracle.com/orawsv/faults "> "

    So OracleError >

    < ErrorNumber > ORA-19202 < / ErrorNumber >

    < message > <! [CDATA [error has occurred in the processing of XML]] > < / Message >

    < / OracleError >

    So OracleError >

    < ErrorNumber > ORA-06550 < / ErrorNumber >

    < message > <! [CDATA [line 1, column 24:]] > < / Message >

    < / OracleError >

    So OracleError >

    < ErrorNumber > PLS-00302 < / ErrorNumber >

    < message > <! [CDATA [component "WS_CALC" must be said]] > < / Message >

    < / OracleError >

    So OracleError >

    < ErrorNumber > ORA-06550 < / ErrorNumber >

    < message > <! [CDATA [line 1, column 7:]]

    [[PL/SQL: statement ignored]] > < / Message >

    < / OracleError >

    < / OracleErrors >

    < / Details: soap >

    < / soap fault: >

    < / soap: Body >

    < / envelope soap: >

    With reference APEX web service, the response is exactly the same and apex_web_service.make_request also work.

    Thanks again.

    The SOAP request is not correct.

    must be:

    So again, it does not solve the problem:

    -Which user you are using to authenticate on the other side?

    If it's another user the owner of the package, then of course you must grant the execute privilege appropriate to this user (and possibly one explicit SELECT on the table referenced too privilege).

  • How to get GMT or IST using the PL/SQL FUNCTION

    Hello, I use Oracle 10 G database (operating system: Windows-32 or 64 Windows).
    How can I get the date and time GMT or International without mentioning SYSDATE / DBDATE.
    Real problem the DB Sever time is frequently manipulated by the end user and I would like to connect the actual date and time of the transaction in other audit tables.

    Kind regards

    Tarun

    It won't increase your load on the server, you would simply have many waiting http events and the performance of your application depends on your internet connection to customers. Something not very desirable if you ask me and certainly will cause you headaches. Really bad headaches, and one day someone will ask who came up with the brilliant idea to get the timestamp system via http instead of... + sysdate + (I smell a future article http://thedailywtf.com/).

    In any case; That is: the http based sysdate function. I use mod_plsql to my 'webservice' running on a server where I'm sure the date is correct. You can use what you want, for a 'real' webservice implementation will be a little different. Google should know the answer about calling Web services from the data base.

    $[CHE_TEST@asterix1_impl] create or replace procedure server_time as
      2  begin
      3  htp.print(to_char(sysdate, 'dd.mm.yyyy hh24:mi:ss'));
      4  end;
      5  /
    
    Procedure created.
    

    As you can see the procedure does nothing else then exit the sysdate from my database server in a specified date format. I then call the procedure mod_plsql via utl_http on another server:

    $[CHE_TEST@asterix2_al32utf8] create or replace function get_server_time return date is
      2  begin
      3    --default would be 60, this is clearly too much
      4    utl_http.set_transfer_timeout(1);
      5    return to_date(utl_http.request('http://ias4/asterix1_impl_cronet/server_time'), 'dd.mm.yyyy hh24:mi:ss');
      6  exception
      7    when utl_http.REQUEST_FAILED then
      8      return sysdate;
      9  end;
     10
     11  /
    
    Function created.
    

    Now get_server_time will give me the time of my first database server (unless the requested HTTP fails for any reason, then it'll be sysdate)

    $[CHE_TEST@asterix2_al32utf8] select get_server_time from dual;
    
    GET_SERVER_TIME
    -------------------
    24.07.2012 13:35:00
    

    Again, if you go in this way use the feature carefully and not at each end of your application as it will give you performance problems .

    see you soon

  • How to get distinct records by using the ListAgg OBIEE report function?

    Hi all

    I get a correct result as mentioned below. But I don't see duplicates in my result here, in my example, I get duplicate for the name of the employee 'Pat '. So how to get Distinct values by using the LISTAGG function?

    Data set of sample with the Department and its employees

    Service employee

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

    Marketing Michael

    Pat of marketing

    Pat of marketing

    Pat of marketing

    Purchase of Den

    Purchase of Alexander

    Purchase of Shelli

    Purchase of Sigal

    Guy of purchase

    Purchase of Karen

    Using the ListAgg function, we can convert it to:

    Employees of the Department

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

    Marketing of Pat, Pat, Pat, Michael

    Purchase of Sigal, Shelli, Karen, Guy, Den, Alexander

    I tried a lot of things, but I'm not able to understand how exactly this can be achieved, if anyone has any idea or suggestions please do share, thanks in advance.

    After much research, I found the solution & I want to share what he finds very useful, we can create SQL logic in the Advanced tab, as below and after you click Rescan, and then you will get your desired results.

    SELECT saw_0, Evaluate_Aggr T1.dept ("ListAgg(%1,'' & '') intra group (about 1%)") ("as long as VarChar (1000), T1.emp) saw_1 FROM)

    SELECT 'emp_dept '. "the Department dept,

    'emp_dept '. "' employee ' emp

    IN THE "DOMAIN".

    GROUP BY dept, emp

    ) T1 GROUP FROM T1.dept ORDER BY saw_0

    Also note here that we have good anti-aliasing for columns parent (ex: saw_0, saw_1), another by mistake oracle bi server.

  • How to use the pl/sql procedure

    Hi all,

    How to use pl/sql packages and especially in what situations we are pl/sql, which is the cause of the procedure. Please explain with precision using small example.

    Thanks and greetings

    RAM

    I could tell this at a very high level.

    PL/SQL's procedural extension to SQL. SQL (structured query language) has no procedural capacity. They are executed as a stand-alone statement. When you want to generate a process flow with several SQL statement that you need to have a procedural language that could accommodate your SQL. PL/SQL is something similar to Java and Dot Net in this aspect. Said that PL/SQL is Oracle DB. This has some advantages. The most important thing is that when you have your SQL in PL/SQL oracle maintains its reliance on the object. Any database oracle related so you want to build, then you can consider to PL/SQL as the best way to use process flows.

    PL/SQL provides various methods such as the PROCEDURE, FUNCTION and the PACKAGE. The only thing that race stands is in its ability to modularize your code. So, using the package you can create process workflows that is modular and easy to understand.

  • Where is the DBMS output window when using the PL/SQL Editor in v1.5.5?

    I find the output window of DBMS when using the SQL worksheet, but where is when I run a PL/SQL procedure in the PL/SQL Editor window?

    I'm used to using TOAD (and want to use SQL Developer, because it's much better behaved when executing procedures, among other problems, TOAD refuses to reduce to a minimum when it executes a pl/sql procedure) and it allows me to edit a pl/sql procedure, enable the DBMS output window, run the proc, and have the DBMS lines show up in the said output window.

    I can't find the same functionality in SQL Developer. I've seen a lot of posts (this forum and a Google search), but they all talk about the SQL worksheet. This is not what I want.

    Any help would be greatly appreciated.

    Thank you.

    Hello
    After running PL/SQL procedure, I saw all the important information in the running tab (called Running - log) including DBMS_OUTPUT.put_line lines.
    Petr

  • by using the LAG() and MIN() functions

    So, I try to get the smallest number in a column of an alias I use LAG() in. I know, which makes no sense, so here's what im trying to do with a SQL statement:

    Select MIN (NUM1 - lag (num1, 1, 0)) over (ORDER BY NUM1) AS J_LAG ORDER BY HEY HEY

    Basically I want the smallest number of the column that I run the lag function on. When I try to it says, ' ORA-30484: lack of specification of the window for this function. I tried to put in brackets the minutes like this: MIN (NUM1 - lag (num1, 1, 0)) and as follows: MIN (NUM1 - lag (num1, 1, 0) over (ORDER BY NUM1)) and none of them does not seem to work.

    Any ideas?

    -Joshua
    like this ??
    
    Select Min(hey) From (Select num1 - lag(num1,1,0) over(ORDER BY NUM1) As hey From J_LAG)
    
  • Firefox does not open with the tabs I had open when I use the renunciation and backup function. Firefox opens on my home page only. How to fix?

    When I use the function "Save and exit" has no effect. The next time I open Firefox it goes to my home page only.

    This has happened

    Each time Firefox opened

    Is 3 days ago

    If you use delete navigation, search and download history on Firefox in Firefox 3.5/6, or clear private data in Firefox 3 to clear the browsing history when Firefox is closed then in restaurant tabs at the last session (for example "save and exit" or "show my windows and tabs from last time ') does not work.

  • Using the Interface of FPGA functions palette

    Hello

    I use the card PCI-5640R and PXI-5600. I want to use the "scale" and "FFT" exspress screws to the range of functions 'Mathematical FPGA and analysis' in my VI "FPGA VI" and "FFT spectrum for '"FPGA interface"in my"host VI.

    A poster of the code examples in which these three subVIs are used can.

    Thanks in advance.

    Kind regards

    Rashid

    The answer to this question is available to

    http://forums.NI.com/T5/if-Rio/using-FFT-to-spectrum-SubVI-of-FPGA-interface-functions-pallete/TD-p/...

  • OfficeJet J4660 all-in-One on Windows Server 2003 R2 - cannot use the scan and fax functionality

    Hello everyone,

    I recently purchased the Officejet J4660 AIO.  I had to install on our Windows Server 2003 R2 (with all latest updates), being present on the CD of driver for Win XP, I had to download the latest driver (OJJ4600_Corporate_ENU_10 - 55.8 MB) from the HP site.  During installation, ONLY the printer driver has been installed.  I can't use the SCAN function or the FAX software.  In fact, the icons for these two programs not created in the HP program group.  No error message appeared well while installing.

    All the world was a program similar and been able to get a work around for this?  I would like to use AIO printer that I bought, not only on the side of impression of it.

    Any help will be much appreciated.

    Thank you.

    Salim

    I think that the Acquisition of Image Windows (WIA) service is disabled in your system. Unlike Windows XP or Vista, in most Windows Server systems, this service is disabled by default. You can activate it in this way:

    1. right click on my computer and select manage.

    2. Select "Applications and Services-> Services";

    3. find Windows Image Acquisition (WIA), right click and select Properties.

    4. Select "auto" in the "Startup Type" list box in the "Général" tab

    5. in the situation 'Services', click 'start '.

  • Need to check delays in update of 1000 lines using the PL/SQL procedure.

    Hi all

    I'm new to PL/SQL. I need your help to build a procedure that executes the following statement and follows the time of update of 1000 rows. This is to check the performance of the database. I need to print the timestamp of start before the update and end timestamp after update. I need to do for the 1000 lines. The statement that will be used in the procedure is:

    SELECT

    'UPDATE XXAFL_MON_FACTS_F SET TASK_WID =' | NVL (TO_CHAR (TASK_WID), 'NULL') |', EXECUTION_PLAN_WID =' | NVL (TO_CHAR (EXECUTION_PLAN_WID), 'NULL').

    ', DETAILS_WID =' | NVL (TO_CHAR (DETAILS_WID), 'NULL') |', SOURCE_WID =' | NVL (TO_CHAR (SOURCE_WID), 'NULL') |', TARGET_WID = ' | NVL (TO_CHAR (TARGET_WID), 'NULL').

    ', RUN_STATUS_WID =' | NVL (TO_CHAR (RUN_STATUS_WID), 'NULL') |', SEQ_NUM =' | NVL (TO_CHAR (SEQ_NUM), 'NULL') |', NAME = "' | NVL (TO_CHAR (NAME), 'NULL').

    "', NO_POSITION =" ' | NVL (TO_CHAR (INSTANCE_NUM), e ') | " ', INSTANCE_NAME = "' | NVL (TO_CHAR (INSTANCE_NAME), 'NULL').

    "', TYPE_CD =" ' | NVL (TO_CHAR (TYPE_CD), e ') | " ', STATUS_CD = "' | NVL (TO_CHAR (STATUS_CD), e ') | " ', START_TS =' | NVL (TO_CHAR (START_TS), 'NULL').

    ', END_TS =' | NVL (TO_CHAR (END_TS), 'NULL') |', DURATION = ' | NVL (TO_CHAR (DURATION), 'NULL') |', STATUS_DESC = "' | NVL (TO_CHAR (STATUS_DESC), 'NULL').

    "', DBCONN_NAME =" ' | NVL (TO_CHAR (DBCONN_NAME), e ') | " ', SUCESS_ROWS =' | NVL (TO_CHAR (SUCESS_ROWS), 'NULL').

    ', FAILED_ROWS =' | NVL (TO_CHAR (FAILED_ROWS), 'NULL') |', ERROR_CODE = ' | NVL (TO_CHAR (ERROR_CODE), 'NULL') |', NUM_RETRIES =' | NVL (TO_CHAR (NUM_RETRIES), 'NULL').

    ', READ_THRUPUT =' | NVL (TO_CHAR (READ_THRUPUT), 'NULL') |', LAST_UPD = ' | NVL (TO_CHAR (LAST_UPD), 'NULL') |', RUN_STEP_WID = "' | NVL (TO_CHAR (RUN_STEP_WID), 'NULL').

    "', W_INSERT_DT = ' | NVL (TO_CHAR (W_INSERT_DT), 'NULL') |', W_UPDATE_DT = ' | NVL (TO_CHAR (W_UPDATE_DT), 'NULL').

    ', START_DATE_WID =' | NVL (TO_CHAR (START_DATE_WID), 'NULL') |', END_DATE_WID = ' | NVL (TO_CHAR (END_DATE_WID), 'NULL') |', START_TIME =' |

    NVL (TO_CHAR (START_TIME), 'NULL') |', END_TIME =' | NVL (TO_CHAR (END_TIME), 'NULL'). "WHERE INTEGRATION_ID ="' | INTEGRATION_ID | " « ; »  OF XXAFL_MON_FACTS_F;

    The above query creates instructions of update that must be executed 1000 times and the time required to update the 1000 lines should be followed.

    Thanks in advance!

    Code horribly wrong!

    Why this approach?

    Dynamic SQL is almost NEVER needed in PL/SQL. And if you think it's necessary and taking into account what is displayed as being problems here, you have a 99% chance of being wrong.

    This 1% where dynamic SQL is necessary, he will WITH bind variables to create shareable SQL, decrease memory requests, decrease the likelihood of a fragmented shared reel and decrease the burning CPU cycles on hard analysis.

    An example below. Your approach is the 1st. One that is slower than the correct approach to 37 (x_!) ...

    SQL> create table t ( n number );
    
    Table created.
    
    SQL>
    SQL> var ITERATIONS number;
    SQL> exec :ITERATIONS := 100000;
    
    PL/SQL procedure successfully completed.
    
    SQL>
    SQL>
    SQL> TIMING START "INSERTs using Hard Parsing"
    SQL> declare
      2          i      integer;
      3  begin
      4          for i in 1..:ITERATIONS
      5          loop
      6                  execute immediate 'insert into t values ('||i||')';
      7          end loop;
      8          commit;
      9  end;
    10  /
    
    PL/SQL procedure successfully completed.
    
    SQL> TIMING SHOW
    timing for: INSERTs using Hard Parsing
    Elapsed: 00:02:00.33
    SQL>
    SQL> TIMING START "INSERTs using Soft Parsing"
    SQL> declare
      2          i      integer;
      3  begin
      4          for i in 1..:ITERATIONS
      5          loop
      6                  execute immediate 'insert into t values ( :1 )' using i;
      7          end loop;
      8          commit;
      9  end;
    10  /
    
    PL/SQL procedure successfully completed.
    
    SQL> TIMING SHOW
    timing for: INSERTs using Soft Parsing
    Elapsed: 00:00:06.06
    SQL> drop table t;
    
    Table dropped.
    
    SQL> create table t( n number );
    
    Table created.
    
    SQL>
    SQL>
    SQL> TIMING START "INSERTs using a single parse and repeatable statement handle "
    SQL> declare
      2          i      integer;
      3  begin
      4          for i in 1..:ITERATIONS
      5          loop
      6                  insert into t values ( i );
      7          end loop;
      8          commit;
      9  end;
    10  /
    
    PL/SQL procedure successfully completed.
    
    SQL> TIMING SHOW
    timing for: INSERTs using a single parse and repeatable statement handle
    Elapsed: 00:00:04.81
    SQL>
    
  • Is highest Null or more low value? using the fewest number of function...

    So Null is one of the if not the highest value in a list of values.

    Whenever I order a column, null has always been highest.

    However, when I use the function less

    Select * from bills by terms_of_discount desc;

    Select LESS ('2 ', '5', '12', ' 3', null) double;

    Select the LEAST ('apples', 'apps', 'applas', null) double;

    In both cases the null value is the lowest

    so I wonder why this is.

    As mentioned in oradocs:

    DESCRIPTION

    The Oracle/PLSQL LESS function returns the smallest value in a list of expressions.

    It's the greatest or least. As soon as you try to use the NULL value in a comparison, the answer is unknown.

    So, if you have NOTHING in there, the answer will be NULL.

    It goes the same for GREATEST().

    Global functions (SUM, MIN, MAX, etc) ignore NULL values.

    In ORDER BY, you can specify NULL FIRST or NULLS LAST.

Maybe you are looking for

  • Popup message when the charge of the sequence

    Total newbie to TestStand, first post I noticed that the Bill to open some of the example TestStand sequences will cause a pop-up message displays describing what is talking about the example. I am trying to understand the source of this message. It

  • 8600 unable to print photo paper or paper cardstock: Firmware fix

    HP has recently released an updated firmware for the 8600 series printer.  The firmware has several product improvements/corrections.  Here is the list: (1) improve the Diagnostic ePrint for ePrint Setup report(2) improve the ease of wireless configu

  • Windows 8 apps don't are not updated and download

    Hi, recently I started to use Windows 8. It set up perfect, but some applications do not work and I can't download apps in store windows. When I connect to my PC, a message arrives he says, a framework is needed to download and install, other wise so

  • How to find the failed connection attempts at 'check' session is enabled

    How to find the unsuccessful connection attempt to dba_audit_trail when the "audit logon" is enabled.

  • failed to install creative cloud

    Due to some problems above, it fails to install cc application. Then the window disappears immediately.More when the cc application begins, the popup appears above.She seems to have a problem with the cc Setup program, so I'm trying to download photo