using vsize() with variables and fields

Hello

I have a trigger that generates timestamps. I need to how long (in bytes) are the values that the trigger generates debug output. So here's what I'm trying to do:
create or replace trigger my_table_bu
before update on my_table for each row
declare
  l_size number;
begin
   :new.my_timestamp := localtimestamp;
   l_size = vsize(:new.my_timestamp);
   dbms.ouput.put_line(to_char(l_size));
end my_table_bu;
I guess it's obvious what to do. How can I write this code exactly?

Thank you!

If you need to...

and to be academically correct, you would probably do better

declare
   s    timestamp (6) := localtimestamp;
   v    varchar2(20);
begin
   select vsize (s) into v from dual;

   dbms_output.put_line ('PL/SQL Timestamp: ' || v);
end;
/

to take into account (unlikely) differences in sql / plsql lengths.

Tags: Database

Similar Questions

  • When we need to use a query variable and how to use it?

    Hello

    When we create a line of dashboard, we set the variable, there are two types: variable presentation and application.
    I'm confuse when we need to use a query variable and how to use it?

    Thank you
    Anne

    Hello
    The variable 'demand' can be used if you want to use session related information specific to you.

    See below a:
    http://gerardnico.com/wiki/dat/OBIEE/logical_sql/obiee_set_request_variable_dashboard_prompt

    FYI... example of
    for the example query variable (a good post Nico)

    http://gerardnico.com/wiki/dat/OBIEE/set_variable

    for the variable of presentation with example

    http://gerardnico.com/wiki/dat/OBIEE/presentation_variable

    Thank you

    Deva

  • Open with options: I want to add a new application to the list right click on file-> open with and rearrange the list so my search app is first. I know that I can use open with-> other and select any application, but it takes too much time since I u

    I want to add a new application to the list right click on file-> open with

    and also reorder the list so my search app is first / top of the list.

    I know that I can use open with-> other and select any application, but it takes too long I should use my intended application in this way several times a day.

    Basically, I'm looking for a configurable way configure open with, something more to send to Windows.

    Thank you very much for all the advice offered.

    The operating system, not you, not control that open with the menu command.

  • Error insert using statement with subquery and prepared partition

    Connection Conn = null;
    PreparedStatement stmt = null;
    final StringBuilder lSql = new StringBuilder();
    lSql.append ("INSERT INTO table1");
    lSql.append ("(Colonne1, Colonne2, column_group, column_sequence )" ");
    lSql.append ("VALUES");
    lSql.append ("(?,?,?, (selection from table1 (PARTION column_group max (column_sequence) + 1)) " ");)
    ...

    the query was operating normally, the error occurred after you enter the code in red.

    Normally, I would ask: what error you are getting? And what channel the operation generates?

    But "select (...) over" ist lacks at least one feature after select: over clause is used for analytical functions and has the form: SELECT a_function() OVER (...) - and without the function I expect an error.

    Maybe:

    Select max (column_sequence) + 1 MORE (PARTION column_group) from table1

    might be what you want. At least it's a plausible use of the analytical function; but I guess she returns several rows and so it will not help in a clause of insert values.

  • Anonymous block with Variable and SELECT

    Hi guys,.
    I'm fighting to connect the material that I am learning. I read on the anonymous blocks and variable so I want to write a
    Nice and neat select with all the fancy stuff (variables, exceptions) to get it right and what I read in the book.

    DECLARE
    MYSTRING AS VARCHAR (10);
    MYSTIRNG: = 'X '.
    BEGIN
    SELECT * FROM DUAL WHERE DUMMY = MYSTRING
    END;


    but... This causes an error after another. I get the wrong concept here or is this a syntax error?

    PL/SQL, you will need to use SELECT... IN...
    http://download.Oracle.com/docs/CD/B19306_01/AppDev.102/b14261/sqloperations.htm#sthref1348

    SQL> declare
      2    mystring varchar(10) := 'X';
      3    myvar varchar(10);
      4  begin
      5    select dummy into myvar
      6    from   dual
      7    where  dummy = mystring;
      8    dbms_output.put_line(myvar);
      9  end;
     10  /
    X
    
    PL/SQL procedure successfully completed.
    
  • Problems to use LAG with 2504 and 3560

    Hello, we recently bought a 2504 wireless controller, and I can't using the aggregation of links (LAG) to connect the WLC to the network.   I was able to connect properly to the contoller using a single link, but as soon as I activate LAG (on the switch and wlc) I'm unable to access the controller.  I think that I have the correct position of the switches as the port channel is active and shows active on the controller via cdp.

    I can't do a ping of the controller, but I see it via cdp.

    The controller runs 7.4.100.0 with bootloader 1.0.18

    The switch is a WS-C3560G-48PS and running 12.2 (25r) SE

    The controller is 10.10.10.202.

    No access-lists on interface vlan switch

    Note that I have currently the 2nd stop of the port as the first member of the Association is active.

    Thoughts?   Any help would be appreciated.

    Thank you

    Bryan

    #sho ip arp 10.10.10.202

    Protocol of age (min) address Addr Type Interface equipment

    Internet 10.10.10.202 143 5478.1aad.1f0b ARPA Vlan1

    #sho address mac-address-table 5478.1aad.1f0b

    Mac address table

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

    VLAN Mac Address Type Ports

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

    1 5478.1aad.1f0b m 1 DYNAMIC

    Total of the Mac addresses for this criterion: 1

    #sho cdp neighbors detail

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

    Device ID: wubc_wlc

    Workshop / entry:

    IP address: 10.10.10.202

    Platform: AIR-CT2504-K9, capacity: host

    Interface: GigabitEthernet0/40, ID of Port (outgoing port): GigabitEthernet0/0/1

    Hold time: 153 s

    Version:

    Name of the manufacturer: Cisco Systems Inc.  Product name: Cisco Controller Product Version: 7.4.100.0 Version RTOS: Erro Bootloader Version: 1.0.18 Type of Build: DATA + WPS

    version of the announcement: 2

    Duplex: full

    Workshop / management:

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

    Device ID: wubc_wlc

    Workshop / entry:

    IP address: 10.10.10.202

    Platform: AIR-CT2504-K9, capacity: host

    Interface: GigabitEthernet0/40, ID of Port (outgoing port): LAGInterface0/3/1

    Hold time: 148 s

    Version:

    Name of the manufacturer: Cisco Systems Inc.  Product name: Cisco Controller Product Version: 7.4.100.0 Version RTOS: Erro Bootloader Version: 1.0.18 Type of Build: DATA + WPS

    version of the announcement: 2

    Workshop / management:

    # sho etherchannel summary

    Flags: D - low P - port-channel

    I have - autonomous s - suspended

    H Eve (LACP only)

    R - Layer 3 S - Layer2

    U - running f - cannot allocate an aggregator

    u - unfit to tied selling

    w waiting to be aggregated

    d default port

    Number of channels: 1

    Number of aggregators: 1

    Protocol for the Port-Channel port group

    ------+-------------+-----------+-----------------------------------------------

    1 Po1 (SU) - Gi0/40 (P) Gi0/42 (D)

    #sho run IM int 0/40

    Building configuration...

    Current configuration: 123 bytes

    !

    interface GigabitEthernet0/40

    switchport trunk encapsulation dot1q

    switchport mode trunk

    channel-group mode 1 on

    end

    #sho run IM int 0/42

    Building configuration...

    Current configuration: 133 bytes

    !

    interface GigabitEthernet0/42

    switchport trunk encapsulation dot1q

    switchport mode trunk

    Shutdown

    channel-group mode 1 on

    end

    #sho run int port-channel 1

    Building configuration...

    Current configuration: 92 bytes

    !

    Interface Port - Channel 1

    switchport trunk encapsulation dot1q

    switchport mode trunk

    end

    Make sure that your markup of the wlc management interface.

    Sent by Cisco Support technique iPhone App

  • Certificate error when you use AnyConnect with AD and SecurID auth on a few clients

    Hello

    We have a set ASA5510 in place with AnyConnect Essentials, with clients that connect both XP and Win7.

    This works as expected on most clients, but on the 3 XP clients, we get a strange error.

    They identify installed software and connects successfully the first time.

    Each attempt to connect after that, they get a message saying "VPN connection interrupted, the certificate is not found on the smart card or smart card does not exist".

    We use certificates for authentication at all (only LDAP and securid).

    Try to connect with a good name of user and password known on one of these computers, gives the same error.

    Connection with one of the users on a well-known work VPN setup/PC problem works every time.

    If remove us the AnyConnect Client of a computer problem, and then it installs again, it works the first time (as before).

    Then, all attempts after that gives the error of samme.

    The connection profile and the settings for the affected users are identical to all the others who work.

    What could be the problem?

    upgrade to

    3.0.5075 solved my problem

  • Questions using the 'Make' variables and 'Models' file rename templete

    I currently have two import of models of change of name of the file. I chose according to the CF card camera came. I tried LR4 and now the LR5 use a built-in variable to 'Do' and 'model '. This way I just having a name change model and do not have to worry about forgetting to change the model. Am I missing something here? All the info is in the EXIF data. Why can't LR out?

    Sample of my two models:

    "Nikon_D700_ {Date (MM)"} {Date (DD) '} {Date (YYY) '} _ {filename number suffix}.

    "Nikon_D300_ {Date (MM)"} {Date (DD) '} {Date (YYY) '} _ {filename number suffix}.

    Sample of what I want:

    "_ _ {Model}' {brand} {Date (MM)"} {Date (DD) '} {Date (YYY) '} _ {filename number suffix}.

    That I lose my mind or is the variable renaming works as expected and I use it wrong?

    Thanks in advance!

    Conrad

    Have you actually tried import using this model? It works when I try. Yes, the example seems strange... but it should still work. So what happens when you try?

    BTW, you may find that the 'model' may also include the 'make' (it does on my Canon cameras).

  • How/where to use jquery with webworks and bbui?

    Hi, I have a small application bbui and webworks.

    now I need to add jQuery code, but I don't know where exactly he Add. I want to add for example something like this:

    $(document).ready(function () {
        $("#Div1").click(function () {
            alert("Hello world!");
        });
    });
    

    I added to my index.htm, but my code designating the Div1 element, is in a http://www.sigling.is/IMO/imofishing/home.htm which is loaded via bb.pushScreen

    its not working, I have to add the jQuery code for each "screen" where I want to use?

    I don't know where to place them in a page 'normal' jQuery, but here the bb.pushScreen is special.

    but I solved it now:

    bb.pushScreen('home.htm', 'home');
    

    can I use the following syntax:

    ondomready: function(element, id) {
            if (id == 'home') {
                $("#Div1").click(function () {
                    alert("Hello world!");
                });
            }
        }
    

    and it works

  • Error with SwfLoader and field of application

    Hello

    I have a test with a SWFLoader loading of an application in a different application domain.

    Test with SWFLoader is ok during the loading of the application in the same application domain, but when I want a new Application domain, I have an error with a debug version of flahplayer message when I use the unload method.

    Is this a bug?

    Well, I can reproduce this.

    Have seen, as I can now reproduce outside of FlexUnit however. It seems the specific problem with the FU framework is when we add it to the container of UIImpersonator, the Manager of bridgeToFocus is never properly created internally.

    I can create the same circumstances in a regular application too if I followed a similar trend. Eager to focus on this more but maybe need a loop in other countries, so I don't think it's a quick fix.

    When you have time, please this file as a bug in jira FlexUnit. Adobe is off this week, it will be at least next week before I can get a review on some of my proposed corrections.

    Mike

  • Use Adobe Creative cloud with Mac and Windows

    Hello

    When I register for the Adobe Creative complete cloud - I can use it with Mac and Windows computers, or is it limited to a single system?

    Kind regards

    Johanna

    Hi Johanna,.

    Creative cloud is platform independent. You can use it on windows and mac.

    You can activate the subscription on two machines but use only on one machine at a time.

    Reference: http://www.adobe.com/legal/licenses-terms.html

    I hope this helps.

    Concerning

    Megha Rawat

  • Error of closure with variable

    Dear all,

    Please help me. I want to loop recording. I have two diet. First of all, I do without variable and no mistake. Second, I do with variable and error occurs. below my syntax:

    First of all:
    ------
    declare
    x varchar (50);
    Start
    -x: = 'choose the double dummy;
    C1 in loop (double dummy selection)
    dbms_output.put_line (C1. Dummy);
    end loop;
    end;

    result:
    -------
    X

    --------
    Second:
    declare
    x varchar (50);
    Start
    x: = 'choose the double dummy;
    C1 (looping x)
    dbms_output.put_line (C1. Dummy);
    end loop;
    end;

    result:
    -------
    Encountered the symbol "LOOP" when expected...

    If you want to use a dynamic SQL statement, you would need something like

    SQL> ed
    Wrote file afiedt.buf
    
      1  declare
      2    l_cursor sys_refcursor;
      3    l_sql_stmt varchar2(100);
      4    l_dummy    varchar2(1);
      5  begin
      6    l_sql_stmt := 'select dummy from dual';
      7    open l_cursor for l_sql_stmt;
      8    loop
      9      fetch l_cursor into l_dummy;
     10      exit when l_cursor%notfound;
     11      dbms_output.put_line( l_dummy );
     12    end loop;
     13    close l_cursor;
     14* end;
    SQL> /
    X
    
    PL/SQL procedure successfully completed.
    

    Justin

  • What is the difference between the variable and set

    WHAT IS THE DIFFERENCE BETWEEN

    These different versions when it is done using the keyword "variable" and "set."
    and these two are performed outside 'DECLARE '.


    VARIABLE g_monthly_sal NUMBER
    SET p_annual_sal = 5000

    -I understand that p_annual_sal will be considered to be a TANK.
    -ALSO if DEFINE the variable serves as a macro variable, THEN it is necessary to give it a certain value whenever we define.
    If this is not the case, what value would it replace?

    OR does that mean when we want to specify the data type for a variable binding, we should use VARIABLE and
    When we do not want to specify type we use SET?

    Thank you

    Published by: user6287828 on February 24, 2009 11:03

    Published by: user6287828 on February 24, 2009 11:04

    Both are SQL * most orders. In a real programming environment you will use these constructions (except in a few rare cases of scripts).

    The difference is the way in which the building will be used later. DEFINE looks more like a string copy & paste. Wherever this substitution variable name is found, it will be pasted into the sql * plus the term.
    VARIABLE creates a real variable. You can change the value and if follwos the usual principles of variables (including the link).

    Example can be found in the docs:

    documentation
    Where and how to use the Substitution Variables

    You can use anywhere substitution variables in the SQL and SQL * more orders, except that the first word entered. When SQL * Plus meets a variable substitution not defined in a SQL command * more will prompt you for the value.

    You can enter any string, at the prompt, even a container of spaces and punctuation. If the SQL command that contains the reference must have quotes around the variable and you include here, the user must include the quotation marks when you are prompted.

    SQL * Plus reads your answer from the keyboard, even if you have redirected the terminals input or output to a file. If a terminal is not available (if, for example, you run the script in batch mode), SQL * Plus uses the redirection file.

    After you have entered a value in the prompt, SQL * Plus lists the line containing the variable substitution twice: once before replacing it with the value that you enter and once after substitution. You can delete this list by setting the variable to VERIFY OFF command.

    The use of Bind Variables
    Bind variables are variables that you create in SQL * Plus and then the reference in PL/SQL or SQL. If you create a variable binding in SQL * Plus, you can use the variable as you would for a variable declared in your PL/SQL subprogram and access the variable from SQL * more. You can use bind variables for things such as the storage of return codes or debug your PL/SQL subprograms.

    Because bind variables are recognized by SQL * Plus, you can display their values in SQL * more or reference them in PL/SQL subprograms that you run in SQL * more.

    Creating Bind Variables
    You create variable bind in SQL * Plus with the command VARIABLE. For example

    Ret_val VARIABLE NUMBER
    This command creates a variable binding named ret_val with a NUMBER data type. See the command VARIABLE for more information. (To list all the bind variable created in a session VARIABLE type without arguments).

    Referencing Bind Variables
    You reference bind variables in PL/SQL by typing a colon (:)) immediately followed by the name of the variable. For example

    : ret_val: = 1;
    To change this variable binding in SQL * Plus, you must enter a PL/SQL block. For example:

    BEGIN
    : ret_val: = 4;
    END;
    /

  • Forms and fields in the application 'fill and sign '.

    I created a PDF with forms and fields to fill in, but when you open it in "filling and the sign" App, all fields are missing? But they are present during the opening in the application 'Adobe Acrobat'.

    Please notify.

    Thank you very much

    The app fill & sign does not even existing form fields like saying Adobe Reader on the desktop, or Acrobat for iOS.  Existing fields are not 'clickable '.  The app fill & sign creates new fields on the page where you click and enter the text if the form has already been fields to fill in those who are "flat" and new content is added on top.  This could be what you are referring.  It is really designed to work best with shapes that have no real fields on them--a major issue for many users, as there are so many PDF files out there that looks like forms, but do not have to fill in form fields.

    Thank you

    Josh

    PS - I will contact you offline to track.

  • Use of system variables in the configs

    Hello

    I need to build strings using java system variables and place them in tangosol-coherence - override.xml

    I need something like this:

    <init-params>
        <init-param>
            <param-type>java.lang.String</param-type>
            <param-value>${somePath}/coherence/cache-config.xml</param-value>
        </init-param/>
    </init-params>
    

    Can I use a placeholder in the form ${some} to be replaced by the variable system during execution?

    Thank you in advance!

    I assume you mean the system property.

    You should be able to use syntax like this.

    / Home/myaccount/Coherence/cache-config. XML

    Then the system my.own.cache.config set property just to substitute it at runtime, for example, "/ home/otheraccount/coherence/cache-config.xml".

Maybe you are looking for