TCPIP select

I have a situation where I need to monitor several dozen TCPIP connections for activity.  I'm wondering if it is possible to, in effect, use the socket select function within Labview (I don't see this function directly available) to avoid polling all these connections.  Alternatively, if I code this with multiple threads do they automatically coordinate using the socket selection function or does each run independently?  I'm concerned that many threads with a small polling interval will consume too much system resources for other parallel tasks to run effectively.
Thanks

Native LabVIEW TCP primitives don't give very good feedback regarding the state of a connection. You can call into the Winsock library. What exactly are you trying to do? When you say activity do you mean data available that will be read? Or are you simply trying to determine if there is activity on the connection. The first is not really a problem and can be written to avoid heavy CPU usage. I don't think the second is possible.
If you are simply reading data as it comes in you don't have to have tight polling loops. You can use the timeout value on the TCP Read to control the processing. You can configure the read to read some number of characters (how much is determined by how your data is formatted.) with a reasonable timeout. For example you could use 1000 ms. While the read is waiting for the data or the timeout to occur that thread will basically be idle and therefore consuming no CPU time. An alternative if you need data faster is to read smaller amounts of data and post that to a queue for processing.
I have written stuff with dozens of active connections running in parallel and have not run into performance issues. The trick is to write your code correctly to avoid such an effect.
Mark Yedinak
"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot

Similar Messages

  • Printing Blocks and Bands of Color

    Two PC's (2000 & XP), an Officejet 7310 and a TV are connected to a wired ethernet router. Both PC's have been configured to use this printer as their default. It's the only printer connected right now.
    This printer had no software disk when I found it. I got the latest drivers from the HP website in the form of "exe" files. The full featured driver failed to install properly on both PCs. I uninstalled that and installed the basic driver on the XP machine first, then on the 2000 PC. On the XP PC the installer failed to create a printer, and as I remember, never asked me any information about drivers or ports to use. I had to use the Add Printer Wizard to create a printer for it on the XP PC. The installer failed to create a printer on the 2000 PC also. The Add Printer Wizard could not find the printer until I marked the printer "shared" on the XP PC. Is that normal?
    NOTE: When I tried to install the "full featured" driver software on the 2000 PC there was a warning that my hardware was below the minimum "recommended" level, but according to the HP website, I am well above the "recommended" level. (It is Compaq Deskpro, PentiumIII, 375MB RAM, 2GB free space) No such warning appeared when I installed the "Basic" driver software.
    When I attempt to check ink levels with the HP Toolbox on both PC's I get the following error:
    "The computer is unable to establish two-way communication with the device."
    I uninstalled the printer on the Win2000 PC so that I could record my steps exactly, and I also marked it "Do not share" on the XP PC because this should work (on the 2000 PC) with the XP PC shut down.
    Please verify I did this properly: Here's how I recreated the printer in Windows 2000:
    Started "Add Printer Wizard" => Next => select "Network Printer" + Next => Next (to browse for a printer) => (none were found) Back => select "Connect to a printer on the Internet or on your Intranet" + enter URL "192.168.0.101" + Next => "Error: could not connect to the printer" + OK => Back => select "Local Printer" + Next => select "Create new port" + "Type: Local port" + Next => Enter port name: "Local TCP" + OK => Manufacturers: "HP" + Printers: "HP Officejet" + Next => (keep existing driver) Next => Printer name: "HP Officejet 7310 on Local TCPIP" + select "Yes" (default) + Next => (do not share) Next => (Yes - print test page) Next => Finish.
    No test page is printed.
    Then I opened the Properties for the new printer => select "Ports" tab => Add Port... => select "Standard TCP/IP Port" + New Port... => the "Add Standard TCP/IP Printer Port Wizard" opens => Next => enter IP address "192.168.0.101" + Port name: "Local TCPIP" + Next => (some info, eg. "Protocol: RAW, Port 9100", Adapter type: "Hewlett Packard Jet Direct" {somehow it knew this time}) Finish => Close (Printer Ports dialog) => (new port appears with box checked) Apply => (printer name appears beside new port) => select "General" tab => (features: Color: "No") select "Advanced" tab => Printing Defaults... (it's a very simplistic driver) => Advanced... => (no options to control color) Cancel => Cancel => (Driver: "HP Officejet") select "HP Officejet 7300 series" in driver drop-down list + Apply => Select "General" tab => (Features: Color: "Yes") Print Test Page => (the windows logo is printed in color, but the text below says "Color support: No") select "Advanced" tab => Printing Defaults... => (sophisticated driver appears) select "Color" tab => remove check from "Print in grayscale" + OK => select "General" tab => Print Test Page => (test page looks good, says I now have color support) OK.
    But still I get color blocks and bands on some pages when printing from Word, and I think on all AutoCAD plots when plotting through the system printer (which will have to be setup again in the Plotter Manager).
    I also still get the same error trying to check ink levels.
    What am I doing wrong? Shouldn't the installer have created the printer with all parameters properly set?

    HPPSdr.exe says "Everything checks out okay with your product."  The test page prints OK.
    I also found the HP Hardware Diagnostic Utility 4.1, and it says "We're sorry, but the HP Officejet 7300 series is not currently supported by this utility."
    The problem seems to be getting more prevalent and more extreme, sometimes printing solid black, off the edge of the page too, with some blocks of color mixed in.  This is occuring from two computers (Compaq and Dell) with different operating systems (2000 and XP) and different versions of Microsoft Word (2000 and 2003).
    What next?

  • Which Technology was selected then creating Master Repository for ODI?

    Hi,
    Which Technology was selected then creating Master Repository for ODI SQL Server 2003? Which technolgy must be selected?
    First of all I created master repository for ODI on SQL Server 2003 via Microsoft SQL Server, it did not work.
    I checked the Driver and URL as below
    com.microsoft.sqlserver.jdbc.SQLServerDriver
    jdbc:sqlserver://<servername>:<PortNumber>;selectMthod=cursor;databasename=<databasename>;integratedsecurity=false
    there is a error as below
    com.sunopsis.tools.core.exception.SnpsRuntimeException: com.sunopsis.tools.core.exception.SnpsRuntimeException: Unable to find the XML file corresponding to your technology.
         at oracle.odi.sdk.repository.OdiRepositoryManager.createMasterRepository(OdiRepositoryManager.java)
         at com.sunopsis.wizards.MasterRepositoryWizard.d(MasterRepositoryWizard.java)
         at com.sunopsis.wizards.MasterRepositoryWizard.f(MasterRepositoryWizard.java)
         at com.sunopsis.wizards.MasterRepositoryWizard.a(MasterRepositoryWizard.java)
         at com.sunopsis.wizards.MasterRepositoryWizard.a(MasterRepositoryWizard.java)
         at com.sunopsis.wizards.MasterRepositoryWizard$IvjEventHandler.actionPerformed(MasterRepositoryWizard.java)
         at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
         at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
         at java.awt.Component.processMouseEvent(Unknown Source)
         at java.awt.Component.processEvent(Unknown Source)
         at java.awt.Container.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Window.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)
    Caused by: com.sunopsis.tools.core.exception.SnpsRuntimeException: Unable to find the XML file corresponding to your technology.
         at com.sunopsis.repository.manager.RepositoryManager.masterRepositoryCreation(RepositoryManager.java)
         ... 29 more
    Caused by:
    com.sunopsis.tools.core.exception.SnpsRuntimeException: Unable to find the XML file corresponding to your technology.
         at com.sunopsis.repository.manager.RepositoryManager.masterRepositoryCreation(RepositoryManager.java)
         at oracle.odi.sdk.repository.OdiRepositoryManager.createMasterRepository(OdiRepositoryManager.java)
         at com.sunopsis.wizards.MasterRepositoryWizard.d(MasterRepositoryWizard.java)
         at com.sunopsis.wizards.MasterRepositoryWizard.f(MasterRepositoryWizard.java)
         at com.sunopsis.wizards.MasterRepositoryWizard.a(MasterRepositoryWizard.java)
         at com.sunopsis.wizards.MasterRepositoryWizard.a(MasterRepositoryWizard.java)
         at com.sunopsis.wizards.MasterRepositoryWizard$IvjEventHandler.actionPerformed(MasterRepositoryWizard.java)
         at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
         at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
         at java.awt.Component.processMouseEvent(Unknown Source)
         at java.awt.Component.processEvent(Unknown Source)
         at java.awt.Container.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Window.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)
    okan
    Edited by: ankist on Jan 15, 2010 2:46 PM

    It is highly recommended to use the JDBC Driver for SQL Server 2005, even if you are using SQL Server 2000. In ODI's pre-populated lists, it is not there - you will have to (1) get the driver yourself, downloadable from the Microsoft site. (get the driver v1.2, not the 2.0, and use a JRE v1.5, 1.5 or 1.6. The 2.0 driver from Microsoft requires the JRE 1.6)
    (2) use the
    Driver: com.microsoft.sqlserver.jdbc.SQLServerDriver
    and the URL: jdbc:sqlserver://<myserver>:<myport, default 1433>;database=<mydb>;selectMethod=cursor
    these are not automatic, you will need to type them in.
    The database must be configured for connections from tcpip.
    For more information see the blog: http://odiexperts.com/?tag=sql-server-2005

  • Device with both RS232 and TCPIP

    Gurus,
    I'm writing a driver for a new instrument I designed.  It has an RS232 port and an internal RS232<>Wifi module from Roving Networks.  I wrote the RS232 vi's using VISA.  Now I'm trying to figure the best way to handle both types of comms within one vi.  So far I added my TCP address into MAX, it shows up in the list of VISA's.  
    I put in a boolean switch on the panel (select TCPIP or RS232) and a CASE in the code to switch between initializing RS232/TCPIP.  Looks sloppy though...  It keeps crashing on a VISA READ ("lost comms"?) even though the init works fines with no errors, but I'll try to debug that..
    I'm a HW guy creating drivers, don't know all the "fun" stuff you guys do 
    1 - What is the best practive way to implement a dual-comms driver?
    2 - Does any PC I install this driver on have to have MAX on it (to configure the TCPIP socket?
    3 - Can anyone share an init / write & get data vi's please who has done this?  My device only has 4 values to read/write, so very simple.
    Thanks!!!!
    Streve

    You can format the VISA resource name directly allowing you to communicate using VISA using either the RS-232 or TCP connection. The piece of your code that will need to care about this is the initialization. Everything down stream will simply use VISA read or write. If you don't know the exact size of the returned data or you don't have a delimiter for your messages a method to read unknown sizes of data is to read a single byte. This read will use a longer timeout. Once a single character is read read chunks of data (some reasonable size) but use a much shorter timeout. The logic here is that there will be a break between messages. The shorter timeout should be less than the expected interval between messages.
    Since you will be using both serial and TCP communications don't use the Bytes At Port method in VISA. This only applies to the serial connection and therefore your general read/write VIs will have to have logic to differentient behavior based on the connection type. You should avoid doing this and limit that to the initialization only.
    I have implemented several variotions of a generic communication interface library. The most recent is LVOOP. I am not at liberty to post these however. But it is very doable.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • Getting Error: cluster ip address not added to tcpip properties

    I have 2 2008 R2 physical servers on the same subnet and they have been using NLB for the past 1.5 years.  We had a firewall issue and I took one of the servers out of the cluster to do testing, while the other main server (priority 1) was left serving
    up the virtual IPs. The main server continues to work properly.
    The servers have 2 NICs, one for NLB and one just for regular traffic.  The NICs also have their own IP addresses and then there is a cluster IP and 2 virtual IPs.
    Error:
    When I try and add the second server to the cluster, I first connect to existing cluster which works fine.  Then I do a Add Host to Cluster, and type the name of the server and select the NLB NIC.  It sees the other server and it seems to start
    the process, however soon after the NLB NIC goes to having internet access to a "enabled" state and the gateway gets taken out of the settings.  I try to add it back, but as soon as I get out of the settings it disappears again.  NLB manager
    tells me: cluster ip address (192.#.#.#) not added to tcpip properties.  It lists this error 4 times, once for each IP (2 virtual, 1 cluster, and then once for the dedicated NLB NIC IP).  I have also tried adding all virtual IPs to the NLB NIC's
    settings and still same exact error.  Registry: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters\Interfaces    -even reg looks good.
    Any help would be appreciated.  If I can't get any resolution my next step is going to be to delete the NLB cluster on the main server and recreate it....but this requires downtime and got to make sure it comes back up!

    Hi,
    You can find out the log of the event, then refer the following KB to future troubleshoot.
    Network Adapter Functionality
    http://technet.microsoft.com/en-us/library/cc726411.aspx
    More information:
    Dual-NIC NLB Configuration with Windows Server 2008 NLB Clusters
    http://blogs.technet.com/b/networking/archive/2008/11/20/balancing-act-dual-nic-configuration-with-windows-server-2008-nlb-clusters.aspx
    Hope this helps.
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • The catalog that you have selected is currently unavailable

    Hi,
    I am trying to display product catalog at sales transaction and I have made the following settings:
    1. Created product catalog and indexed to TREX server--I can see the indexes at txn TREXADM and program TREX_RFC_AE_EXAMPLE
    2. http://<hostname>:<port>/shopadmin/admin/xcm/init.do---created my own app conf.
    3. http://<hostname>:<port>/shopadmin/shopadmin/init.do---created my web shop with the previously created product catalog
    When I try to display the catalog;  "The catalog that you have selected is currently unavailable" error is displayed.
    I have double checked my settings according note #980678.
    Checked the Visual Admin settings as follows:
    "Go to Cluster->Services->TREX Service and check the entry "nameserver.address". It should have "tcpip://<trex host name>:<name server port>. ex tcpip://mytrexserver:30201."
    Does anyone has faced an issue like this?
    Thanks..

    Hi there,
    Are you using staging for the product catalog?  If so then you need to activate the index.
    Is the catalog and variant active also?
    Otherwise check your xcm settings for the web app (b2b or b2c) so its set up for the right IMS settings.
    Cheers
    Andrew

  • Encore CS6 and tcpip.sys

    I have recently dipped my toes in the water of Blu-Ray creation, after may hundreds of successful DVDs. The current menu is created from within Encore but using a .png background image and buttons created in Photoshop. The content consists of 12 sequences, imported from the Premiere Pro CS6 timeline. Every time i select 'Build' the system gets a little way in, not always the same place,and  the whole computer crashes with a message which isn't on he scren for very long but names a file - TCPIP.SYS. I can't quite see wehat the connection between tcpip.sys and Encore can be. It automatically reboots the PC and we go round in a cirtcle. Has anyone else seen this behaviour and, if so, was  a solutiojn found? The PC is a Hewlett Packard i7 with 16Gb of RAM and plenty of hard disc space (128Gb+) away from the C: drive.

    Many thanks for your thoughts, Stan. It's late here in the UK so I'll change the preference tomorrow and see if more information can be gleaned
    I supose I should have tried a 'simple' BD first but, as ever with me, far from dipping my toes, I jump in with both feet! I didn't expect the workflow to be much different to DVD. I have read somewhere else in the forum, that it is better to Export from PrPro rather than 'Import' to Encore. I have been importing from the PrPro Timeline direct to Encore. I'll give that a try tomorrow, aslo.
    Once again, many thanks. I'll report back when I am more awake!

  • KDE networkmanagement couldn't select the ad-hoc Connection?

    Hello.
    I use kdeplasma-applets-networkmanagement to manage network, but can't select the ad-hoc connection, it's not in the Connections list.
    If I type in 'hidden network' the ad-hoc connection name, it will show create new connection, not connecting.
    applets-networkmanagement  do not support ad-hoc connection?

    Here some of my settings in my hp Laptop (I have non-english Vista so I'm trying to translate):
    In the status page I read:
    IPv4 Connectivity....................Local
    IPv6 Connectivity....................Limited
    Media state.............................Enabled
    SSID.......................................hpsetup
    In the details subpage of the status page I read:
    Intel wireless 5100
    Enable DHCP..................YES 
    IPv4 adress ....................169.254.111.28
    IPv4 mask subnet.............255.255.0.0
    Netbios tcpip enabled......YES
    I have my J6410 reset to the deafult settings.
    Any HELP will be appriciated, I can't run my practice here....

  • Keithley 2701: pb with tcpip

    Hello,
    My Keithley 2701E DMM isn't detected on Lan by MAX, neither by "find ressource.vi" !
    It is accessible via a Windows tcpip ping, and via the Keithley remote web page.
    It is also ok with Labview vi if I forced the Visa command with the @tcpip of the Keithley.
    Why it is not detected by MAX (if I do "add ressource" in tcpip) and not detected by "find ressource.vi"?
    thank
    Franck

    Hi,
    What's your LV and MAX version ? MAX searches automatically the default port, so you can't select which port MAX will search. So you should force MAX to search the port you want to select as explain in this KB.
    Hope this helps.
    Regards,
    Message Edité par Steve M. le 28-09-2009 02:36 PM
    Steve M.
    National Instruments France
    #adMrkt{text-align: center;font-size:11px; font-weight: bold;} #adMrkt a {text-decoration: none;} #adMrkt a:hover{font-size: 9px;} #adMrkt a span{display: none;} #adMrkt a:hover span{display: block;}
    >> Vidéo-t'chats de l'été : présentations techniques et ingénieurs pour répondre à vos questions

  • Error message: "playlists selected for updating no longer exist"

    I tried to update my ipod nano and I guess I had deleted a playlist, but since then, I have not been able to update. Every time I try, I get the following message:
    "Cannot be updated because all of the playlists selected for updating no longer exist."
    I haven't been able to highlight which playlists are selected to begin with.
    I read through the manual and thought that maybe rebooting the whole system might work. So I deleted Itunes from my computer and re-installed.
    Then I tried re-setting my ipod. So now I have nothing on my ipod.
    I also deleted everything from my library, thinking it might help to start from scratch. Nothing has worked.
    How do I "select" and "unselect" playlists so I can get up and running again?

    Here you go.
    http://discussions.apple.com/thread.jspa?messageID=607312&#607312

  • Error while calling a select esb service

    javax.resource.ResourceException: RollbackException: Transaction has been marked for rollback:
    I encounter the above error while executing a synchronous bpel process, that invokes an esb db select service to fetch a value from the db.
    the details available for the error are:
    An unhandled exception has been thrown in the ESB system. The exception reported is: "java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 0 at java.util.Vector.get(Vector.java:710) at oracle.tip.esb.server.common.wsif.WSIFInvoker.readResponseHeader(Unknown Source) at oracle.tip.esb.server.common.wsif.WSIFInvoker.executeOperation(Unknown Source) at oracle.tip.esb.server.common.wsif.WSIFInvoker.nextService(Unknown Source) at oracle.tip.esb.server.service.impl.outadapter.OutboundAdapterService.nextService(Unknown Source) at oracle.tip.esb.server.service.impl.outadapter.OutboundAdapterService.processBusinessEvent(Unknown Source) at oracle.tip.esb.server.dispatch.InitialEventDispatcher.dispatchNonRoutingService(Unknown Source) at oracle.tip.esb.server.dispatch.InitialEventDispatcher.dispatch(Unknown Source) at oracle.tip.esb.server.dispatch.BusinessEvent.raise(Unknown Source) at oracle.tip.esb.wsif.WSIFOperation_ESB.executeRequestResponseOperation(Unknown Source) at com.collaxa.cube.ws.WSIFInvocationHandler.invoke(WSIFInvocationHandler.java:431) at com.collaxa.cube.ws.WSInvocationManager.invoke2(WSInvocationManager.java:353) at com.collaxa.cube.ws.WSInvocationManager.invoke(WSInvocationManager.java:192) at com.collaxa.cube.engine.ext.wmp.BPELInvokeWMP.__invoke(BPELInvokeWMP.java:733) at com.collaxa.cube.engine.ext.wmp.BPELInvokeWMP.__executeStatements(BPELInvokeWMP.java:368) at com.collaxa.cube.engine.ext.wmp.BPELActivityWMP.perform(BPELActivityWMP.java:197) at com.collaxa.cube.engine.CubeEngine.performActivity(CubeEngine.java:3266) at com.collaxa.cube.engine.CubeEngine.handleWorkItem(CubeEngine.java:1696) at com.collaxa.cube.engine.dispatch.message.instance.PerformMessageHandler.handleLocal(PerformMessageHandler.java:75) at com.collaxa.cube.engine.dispatch.DispatchHelper.handleLocalMessage(DispatchHelper.java:184) at com.collaxa.cube.engine.dispatch.DispatchHelper.sendMemory(DispatchHelper.java:269) at com.collaxa.cube.engine.CubeE
    Please suggest
    thanx
    AJ

    Done That,
    Thanx a ton Dave, it worked.
    So I am finally moving on :-)
    Just one question Dave, I happened to work on the Beta release of this version too, the problem was not there. How come we have been able to get it in dev preview.

  • Logical operators in Oracle select query

    Hello all,
    Can i use logical operators in oracle select queries?
    for 1 and 0 =0 ; 1 or 0 =0
    if i have two fileds in a table COL1 have a value of 1010 and COL2 have a value of 0001.
    Is there any way to use select col1 or col2 from table? where or is a logical operator?
    Regards,

    Hi,
    NB wrote:
    Hello all,
    Can i use logical operators in oracle select queries?Sure; Oracle has the logical operators AND, NOT and OR. All the comparison operators, including >, >=, = !=, EXISTS, IN, IS NULL, LIKE and REGEXP_LIKE are really logical operators, since they return logical values. You can use them in SELECT statements, and other places, too.
    for 1 and 0 =0 ; 1 or 0 =0
    if i have two fileds in a table COL1 have a value of 1010 and COL2 have a value of 0001.It's unclear what you want. Maybe you'd be interested in the BITAND function:
    http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/functions014.htm#sthref1080
    BITAND is the only logical function that I know of. Many other functions, especially numberical fucntions such as MOD, have applications in logic.
    Is there any way to use select col1 or col2 from table? where or is a logical operator?Whenever you have a question, please post a little sample data (CREATE TABLE and INSERT statements), and also post the results you want from that data.
    Explain how you get those results from that data.
    Always say which version of Oracle you're using.

  • Can not select from data dictionary view from a procedure

    Hi,
    I wonder, which privilege is missing here:
    my schema has this roles and privs:
    GRANT CONNECT, RESOURCE TO cb ;
    GRANT CREATE SESSION TO cb ;
    GRANT SELECT_CATALOG_ROLE TO cb ;
    GRANT CREATE SYNONYM TO CB;
    GRANT CREATE VIEW TO CB;
    I create a procedure:
    create or replace procedure dd_test as
    begin
         dbms_output.enable(2000000);
         for r in (select table_name from sys.dba_tab_partitions     where owner = 'CB') loop
                   dbms_output.put_line(r.table_name);
         end loop;
    end;
    sho err
    4/38 PL/SQL: ORA-00942: table or view does not exist
    When I run the core statement form sql prompt, it works !
    so what privilege is missing here ???
    thanks for any hint, Lao De

    Hi,
    thanks for that reply, after doing that I can not select this DD-view from sql-prompt anymore (which I don't wonder ;-). Can you tell me, what idea you had behind that test ?
    I found another instance, where the procedure works and I will compare those privileges, but it's hard to sort out that complex structure of nested roles and sys_privs.
    How ever, I will update here, when I found the missing privilege.
    regards LaoDe

  • 'IF' statement in a select statment?

    I have the following cursor in a package specification;
    cursor c_sales_code is
    select sales_condition||' MC '||sales_option
    from sales;This will return something like: 'T300 MC 9'
    MC means 'multiple choice' for when there are multiple options. Although, sales_option is sometimes null and in this case I just want 'T300' to be returned, not 'T300 MC'.
    How would I go about doing this?
    Thanks,
    fakelvis

    Use
    CASE and DECODE
    to add the functoinality of Conditional Statements in Your SQL Statements..
    These two CASE / DECODE will help you to get your desired output

  • IF Statement in Select

    I need to choose between value1 and value2 within a select statement.
    TableA
    Flag (char)
    Value1
    Value2
    ItemDesc
    pseudo code
    select ItemDesc, (if Flag = 'y' then Value1 else Value2) as Price from TableA;
    How can this be done?

    select   itemdesc,
             sum (case
                     when flag = 'y'
                        then (case
                                 when value1 < 10
                                    then value1 * 1.2
                                 else value1
                              end)
                     else value2
                  end
                 ) as price
        from tablea
    group by itemdesc;

Maybe you are looking for

  • O/P probelm when the spool is generated by SM36 for REUSE_ALV_GRID_DISPLAY

    Hi Can anyone help me in solving the issue for the problem in display o/p (Line wrapping happens after certain length of display in the spool) in the spool generated after running the REUSE_ALV_GRID_DISPLAY. i.e when the report is run online complete

  • Movieclips visibility

    Hi, having trouble with something.  I have created two symbols which I intend to display on a button click.  In actionscript, I have assigned each symbol to a movieclip variable.  If i then set their visibility to false, they do not display.  However

  • How to fetch env. variable from OC4J instance

    At the launch of my application I want to fetch a variable value we have created on the iAS server at the application's OC4J instance level and under "Server Properties". I am unable to fetch anything using getHttpServletRequest() method. Does anyone

  • I keep getting an "Inconsistant System Files" error at startup.

    Inconsistant System Files I have used disk utility and all looks ok. I tried to restore to a previous time with time machine but the error still comes up. I don't know why it started as I haven't installed any new hardware or software, unless it's so

  • Release Strategies::::Urgent

    Dear All, I am creating release strategies for PR... I have created a Release Group "01" Release Code GM & PM Release Strategy R1 but when i  check the strategy...it gives error sayin...."Release Code for release group is inconsistent" Cheers