Binary Operation in PL/SQL

How do I do binary operations like or/and/xor in pl/sql? Are there any built-in libraries?

I believe NOT x = -x - 1So NOT 19 = -20andNOT -8 = 7Hope this helps,
T.

Similar Messages

  • How do I create a binary file using PL/SQL

    Hi
    Can you help me with writing a binary file in PL/SQL? I like to load binary data from data file, process in database then write to a new binary file.
    Thank you very much in advance.
    regrds
    Yongdong

    DBMS_LOB won't help you write a BLOB to disk.
    You need to an external procedure to do that. Eric K's java works great and he's helped me with his solution and probably about a thousand others.
    Doing a search on this forum will yield many discussions on this often regurgitated topic.

  • Binary operations

    Hi all,
    Okay im not very familiar with much binary operations, so I need a little help.  The problem that im having is the DAQ board im using has uses a 32 bit interface for digital I/O, and I need to be able to change  lines 8-22, depending on the decimal number and base the user enters and have that binary be in inverted logic.  For example if the user entered 486.6 with a step size of 0.05 the binary in regular logic would be 000000000 010011000000100 00000000 and in inverted logic 000000000 101100111111011 00000000 and I dont want the change of decimal affect any others lines of the code.  I think maybe for that I could just set a max limit for the decimal number to being 2^15-1, but not sure I can create this limit and shift in the binary in labview.  Any help would great, thanks.

    dbartz,
    Al of the logic primitives are polymorphic, meaning that you anc use them with numerical values. Set up your data as an unsigned 32 bit integer (U32). Use AND and OR functions to mask off the parts you want to change and the parts you want to protect. If you had 8-bit words (for a simplified example) and wanted to change bits 2, 3, and 4, you could do this:
    let K = old data (example K = 10101010)
    let P = new data (example P = 00111110) {Notice that P has non-zero values in bits other than 2, 3, 4}
    let Mk = mask for old data (example Mk = 11100011), and
    let Mp = mask for new data (example Mp = 00011100 = NOT Mk).
    Then (K AND Mk) OR (P AND Mp) = data to write.
    Using the example values above (K AND Mk) = 10100010, (P AND Mp) = 00011100, and data to write = 10111110.
    Lynn

  • Store a uploaded file of type binary into a java.sql.Blob

    Hi all,
    I try a File-Upload and store the file in a  java.sql.Blob of a MaxDB.
    My Problem is, that I'm not able to import a Model-Attribute of data type byte[]. Further I don't no how to convert the uploaded value attribute of data type binary, in a java.sql.Blob.
    Regards,
    Silvia Hofmann

    http://www.excelsior-usa.com/jet.html
    http://www.ej-technologies.com/products/exe4j/overview.html
    http://jsmooth.sourceforge.net/
    Distributing your Application as an executable JAR file
    Google is your friend.

  • In range and coerce binary operation

    How do I implment the "in range and coerce" function with binary operation?  I want to do that to make my fpga code more efficient.
    Kudos and Accepted as Solution are welcome!

    What exactly do you mean by "binary operation"?  I am assuming you are dealing with integers here to make life simple.
    The In Range portion is just a simple Less Than and a More Than with an AND ( x < UL && x > LL).  The Coerce portion would likely be best done with Select nodes based on the Less Than and the More Than comparisons.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • RS-232 binary operation

    Dear all,
    I am a researcher with commercial instrument.
    After communication with my technician, I got to know I have to do binary operation in RS-232.
    But I am not familiar with the binary operation.
    Could you please give me some solution about this by labview 6 or 7?
    I attah a part of the manual.
    *)please let me explain the meaning of the parameters.
    Host → Ecotec II: 5(start the communication), 5(length of the command, 5 bits),
    3 (RS-232 functional command), 0(parameter of the command), 13(checksum, 5+5+3+0).
    Very thank you for your attention.
    Any comments will be very helpful to me.
    Attachments:
    aaa.bmp ‏1129 KB

    Duplicate.
    Try to take over the world!

  • Table Operator In PL/SQL

    Sir,
    This is srinivas from India
    Recently I started working with Objects in Pl/SQL
    I am facing problem with table operator in pl/sql
    my Query is
    Select s.rollno,s.Name,column_value from student s,table(marks)
    above query working fine in at SQL Prompt
    but the same thing if I am trying to use at Cursors in PL/SQL it is giving error
    please suggest me how to use Table operator in PL/SQL
    student
    srinivas

    I suggest you post your problem to the Products->Database->SQL/PLSQL discussion Forum.
    This Forum is meant for the Apple Macintosh OS.

  • Binary Sytem / binary operation

    I need any references (websites/PDFs) explainning binary sytem and binary operations (conversion,subtraction,division..)
    thanx in advance

    hi,
    try these:
    http://mindprod.com/jglossbinary.html
    http://www.learnbinary.com/
    for the last one click start in the top banner to start the tutorial, it's shown in an applet so it might take time to load depending on your connection.

  • How can i do bitwise (binary) operations (AND, OR, XOR)

    I need to do bitwise (binary) operations such as AND, OR, and XOR.  For example, how do I AND 10101000 with 11111000?

    for OR, with 10101000 in A1 and 11111000 in A2, try:
      =1×SUBSTITUTE(A1+A2,2,1)
    Result:  11111000
    and for XOR, try:
       =1×SUBSTITUTE(A1+A2,2,0)
    Result: 1010000  (missing leading 0)
    You can display missing leading zeros by setting the cell's Data Format to 'Numeral System' with Base set to 10 and Places to 8, or turn the result into a string with something like this (assuming the result is in A3):
         =RIGHT("0000000"&A3,8)
    SG

  • Binary operations in Java

    Hi,
    are there any binary operations in Java like '&' in C? I didn't found any information in the API description.
    Thank u.

    You didn't find them from the API since they are a feature of the language. Try the langspec instead: http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#5228

  • How to use/implement xor binary operator in oracle

    Hi,
    Like in VB and .Net we have a Binary operator/expression called Xor for the following
    logic....
    EXAMPLE:
    A Integer = 10
    B Integer = 8
    C Integer
    c = (A Xor B) OUTPUT is 2
    1010 (10 in Binary)
    1000 (8 in binary)
    0010 (result is 2 in binary)
    I want to implement the same logic in Oracle do we have any builtin operator function
    for this? If we dont have can anyone please try to code it. It will be very helpful and
    urgent.
    Thanks in Advance
    Reddy

    do we have any builtin operator functionfor this?
    Up to a point. Specifically, Oracle has a BITAND() function. With this it is possible to code our own BITOR and BITXOR functions. I'm glad to say I personally haven't had to worry about bits for over ten years, but Connor McDonald has posted a solution on Jonathan Lewis's FAQ site.
    Cheers, APC

  • Spamtrainer error - binary operator expected

    On 10.4 server, this error started showing up. No updates were installed. Hoping to fix this, I even installed updated spamtrainer. But it did not help.
    At the command line, I typed this:
    /usr/sbin/spamtrainer -p col -d
    (where col is the partition name)
    Starting spamtrainer...
    Training from user folders
    /usr/sbin/spamtrainer: line 1021: [: /Volumes/Users/user_name/Mails: binary operator expected
    /usr/sbin/spamtrainer: line 1028: [: /Volumes/Users/user_name/Mails: binary operator expected
    Either there is no mailbox called user/junkmail in the mailpartition col
    or it has never been fed with mail.
    /usr/sbin/spamtrainer: line 1050: [: /Volumes/Users/user_name/Mails: binary operator expected
    Either there is no mailbox called user/notjunkmail in the mailpartition col
    or it has never been fed with mail.
    Syncing SpamAssassin Database
    Displaying SpamAssassin Database Stats
    0.000 0 8860 0 non-token data: spam
    0.000 0 40718 0 non-token data: ham
    Deleting learned HAM and SPAM
    Done!
    Output produced by spamtrainer Version 1.8.5
    There are mailboxes junkmail and notjunkmail. Junkmail is always fed. I don't understand why it is going to /Volumes/Users/user_name/Mails and shouting "binary operator expected".
    Appreciate any help.
    Thanks !

    /etc/imapd.conf:
    admins: cyrusimap, serveradmin
    configdirectory: /var/imap
    partition-default: /var/spool/imap
    unixhierarchysep: yes
    altnamespace: yes
    servername: our_domain.net
    sievedir: /usr/sieve
    sendmail: /usr/sbin/sendmail
    lmtpdowncasercpt: 1
    tlscertfile: /etc/certificates/our_domain.crt
    logrollingdays: 1
    logrolling_daysenabled: true
    enablequotawarnings: yes
    lmtpover_quota_permfailure: yes
    tlskeyfile: /etc/certificates/our_domain.key
    popauthgssapi: yes
    popauthapop: yes
    imapauth_crammd5: yes
    imapauthgssapi: yes
    imapauthlogin: yes
    imapauthplain: yes
    tlscafile: /etc/certificates/our_domain.chcrt
    partition-col: /Volumes/Users/serveradmin/Mails
    Message was edited by: Chakravarthy Cuddapah

  • Notify more than 1 operator in a SQL Agent job

    Hi Forum,
    is there a way to notify more than one operator if a SQL Agent job fails?
    TIA
    Alex

    Hello Alex,
    If you are using a "maintenance plan" task "Notify operator" you can select several operators from a list.
    In a SQL Server Agent job itself you can only add several operator for "warnings", but for the notifications like "finished" just one.
    Olaf Helper ----------- * cogito ergo sum * errare humanum est * quote erat demonstrandum * Wenn ich denke, ist das ein Fehler und das beweise ich täglich http://olafhelper.over-blog.de

  • Performance: Operations in Cursor vs. Operations in PL/SQL block

    Why does I have a better performance when I program operations in complex cursors instead of programming the same statement in a pl/sql block in a stored procedure?
    Operation in a Cursor:
    CURSOR c IS
      DECODE(name,'Peter','dog','cat') animal
      ...The same Operation in a PL/SQL block:
    begin
      if name = 'Peter'
      then
          animal = 'dog';
      else
          animal = 'cat';
      end if;
    end;
    ...I know that a parsed cursor is placed in the Shared Pool and reference
    a context area in the PGA.
    Does anybody have an idea?
    Message was edited by:
    mad

    Maybe because if you can write only a SQL query, it is faster than to write PL/SQL code that will do the same job. See following thread for a analog discussion: Re: pl/sql table

  • Logical XOR operator in T-SQL (SQL Server 2000)

    Hi all....
    I was wondering why SQL Server 2000 lacks a logical XOR operator. Do you have a ready to use function that implements it?
    How can I program one by myself? I know that A XOR B is equivalent to NOT A * B + A * NOT B. So I tried to create this function :
    CREATE FUNCTION XOR
    -- Add the parameters for the function here
    @A BIT,
    @B BIT
    RETURNS BIT
    AS
    BEGIN
    RETURN NOT @A AND @B OR @A + NOT @B
    END
    But it didn't compile.
    How can I pass boolean values as parameters? any other hint?
    Thanks
    Jaime

    I have these two views , one of them hard coded as NULL as it always needs to be NULL. I wanted to union them
    Now the problem is I have to replace those NULLS if I have a value from other VIEW or else NULL ( no change)
    I am getting duplicates of rows with values and NULLS , whereas I needed only records with values
    I need records with values and records without value as NULL . please let me know how to eliminate dups with NULLS
    21
    ARGH
    Bus    
    NULL
    NULL
    NULL
    NULL
    21
    ARGH
    Bus
    66
    781
    HEAVY
    00:00.0
    21
    F1WS
    Ship
    NULL
    NULL
    NULL
    NULL
    21
    HGDD
    car
    NULL
    NULL
    NULL
    NULL
    21
    HGDT
    car
    NULL
    NULL
    NULL
    NULL
    Below is the code :
    --- view having values
    SELECT *
    FROM Table1 AS S INNER JOIN
    Table2 AS P ON S.columnA = P.columnB
    WHERE EXISTS
    (SELECT 1 AS A
    FROM Table2 AS R
    WHERE (S.columnA = columnB))
    GROUP BY ALL
    UNION
    --- views harded coded as NULLS
    SELECT *, NULL AS APR , NULL AS MAY , NULL AS JUN , NULL AS JUL , NULL AS AUG
    FROM Table1 AS S INNER JOIN
    Table2 AS P ON S.columnA <> P.columnB
    WHERE (NOT EXISTS
    (SELECT 1 AS A
    FROM Table2 AS R
    WHERE (S.columnA = columnB) )) OR
    EXISTS
    (SELECT 1 AS A
    FROM Table2 AS R
    WHERE (S.columnA = columnB) )
    GROUP BY ALL

Maybe you are looking for

  • Address Book and Maps

    I have several entries in my address book that contain Apartment numbers, suite numbers and so forth. When I click on such an address in my OS X addressbook entry, the Google Maps application comes up in Safari, but invariably is unable to match the

  • Select query with secondary index

    hi, i have a report which is giving performance issues on a perticular select query on KONH table. the select query doesnt use the primary key fields and table already has around 19 million entries.So there was a secondary index created for the field

  • How to disable the cancel button in the ProgressMonitor

    hi, I need to know, is there any way to disable/remove the (cancel)button in the ProgressMonitor? One more problem is, Once i click the cancel button, isCanceled() return true, how to make it false again so that the process continue.... It is very ur

  • Using APD process - What Transformation : BI to CRM

    Hi All, I am New to APD Process, i want to send data from BI ( DSO - Standard ) to CRM( Data Traget) system What Tranformation process should i use? Thanks, Nithi.

  • Configuring State_Code,Region_code,Country_code

    Hi, Configuring State_Code,Region_code,Country_code is must???if we leave it by default wat will happen? Rama