Question about bind variables.

Hi,
I'm looking to do an oracle prepared statement in some code and I'm having issues with the bind variables. If I have this query:
SELECT count(*) FROM accessp WHERE id IN (?) AND groupies LIKE \'%?%\'
and I want to bind a list like this:
2,4,6
to the first ?
and a value like this:
cap
to the second ?
it seems as if it would work but I keep getting errors about oracle not seeing the bind variable. After some doing a little research I found that it looks like I need to create a type or types for my columns I'm doing the binding to.
Is that correct?
Any help, greatly appreciated.
Thanks,
Jon

No, that doesn't work. Unfortunately this is one of the few times when PreparedStatements are inconvenient.

Similar Messages

  • Question about Local Variables (Multiple answers welcomed!)

    A couple of questions about Local Variables
    1. Programmers always say: “Do not abuse of Local Variables”. I’d like to know, when and where Local variable are most efficiently used?
    2. If I have to create a couple of local variables, is there anyway to “clone” them without going through the repetitive “create/local variables” mouse click each time? (When I try to copy and paste, it creates a new variables instead of the one that I am trying to reproduce)
    3. Which is faster in execution: Updating a variable through a) writing to property node/value or b) through local variable
    Everyone’s input is welcomed, so if this question is already answered, please
    feel free to add additional comments/answers!

    1. Use Local Variables in user interface code and no where else. The only exception is using a local variable of a cluster output to define the datatype for a bundle by name node.
    2. You can drag copy them then right click to get to a menu of all the currently defined controls and indicators on the VI.
    3. B. The problem with A is that it forces a thread switch to the user interface thread--which can take time if you aren't already in it, and it's a very convoluted process under the hood. NI's advice never update indicator values through a property node unless you absolutely, positively can't figure out some other way of doing it.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Question about session variables and binding

    Hi All,
    I'm a newbie with Application Express. I've gone through several tutorials and a book, and now I'm actually getting started with apex. My first adventure is a tiny little form, where all you do is fill it out and it sends an email. Pretty simple.
    And, i have it working just fine - but I have a question about something I don't quite understand. Basically, I am generating the email text in a page process. And some of the form fields work fine if i reference them as *:ACCT_NAME*, but some give me the dreaded "not all variables bound" error. For the ones that give me the error, I can reference them like V('ACCT_NAME').
    So, as a newbie, I'm a little confused. When is it appropriate to use the V function, and when it is appropriate to use binding? Why would one of the fields work with binding but not another from the same form?
    Thanks for any clarification you can offer,
    Lisa

    Lisa,
    A bind variable is a place holder variable available in an environment.It is used quite frequently(outside Apex Context) in SQL and PLSQL scripts and especially in Dynamic SQL statements.Many times using a bind variable gives better performance. In the Apex environment,page items and many other variables related to the session are available as bind variables and hence their value can be referred in SQL,PLSQL contexts as :VARIABLE_NAME.
    Now V() function is an apex specific function which returns the value of an apex session variable outside the apex environment. So as Machaan pointed out, it is used in
    procedures and triggers that gets called from within an apex session. This is required since the bind variables themselves are not directly available in the SQL environment but their values from the corresponding session can be accessed by this apex built-in function.
    The length of any Bind variable name is limited to 30 characters, this is a limitation inherited from Oracle SQL itself and hence session variables(page or application items) whose name has a length which exceeds 30 characters cannot be used as the :ITEM_NAME format. In such cases you would have to use the v() method again. This might be happening in your case.

  • BC4J: Question on bind variables and DML in view objects

    Hello,
    I have a view object with a bind variable in the WHERE clause of the underlying query. I'm curious about how the state of this bind variable affects the use of the view object for inserting, updating, etc., at various stages of the commit cycle (before posting changes, after posting changes, after commit).
    Specifically, what happens in the following scenarios?
    1. The bind variable is not bound (and the query has not been executed) and a row is inserted into the VO
    2. The bind variable is set to some value and an inserted or updated row in the VO does not meet the criteria specified by the bind variable; the transaction is then committed
    If there is a weblog entry, help file, or HOWTO somewhere, I'd welcome a link to it.
    Thanks,
    Alan

    The variable would only come into play when the VO's query is executed. It can be executed implicitly -- for example, accessing the first() row if the query hasn't been executed yet -- or explicitly by a call to executeQuery().
    By setting setMaxFetchSize(0) on your VO, no rows will be fetched and you can use the VO for insert only.

  • Question reg bind variable...

    hi,
    I have learnt that when we pass parameter to proc/func. those parameters are auto. treated as bind variables...
    but what if I have a simple proc. which does not accept any argumets nor it returns anything just a batch job type for e.g to send emails.. then how will the variables declared in that proc treated as bind variables or not?
    If not, how can i modify the proc to use bind variables
    thx

    Any PL/SQL variables or parameters will be automatically treated as bind variables in static SQL. There is nothing special you have to do.

  • Data binding working ... now a question about the variables

    I wrote a small app based on the example (below) from sapui5.hana.ondemand.com.
    My question pertains to anyone else that has data binding working and has tried to do something like the text in red.
    When stringing together "variables" like the ones highlighted in below ... if I do something similar all I get on the screen is the actual text, ie {Width} instead of the value that should replace that.  If I get rid of the extra text and just have the variable in " " I get the correct value displayed for the "variable"
    Anyone else ran across this?
    -Mike
    var header = new sap.m.ObjectHeader({
      title : "{Name}",
      number : "{Price}",
      numberUnit : "{CurrencyCode}",
      statuses : [
      new sap.m.ObjectStatus({
      text : "Some Damaged",
      state : "Error"
      new sap.m.ObjectStatus({
      text : "In Stock",
      state : "Success"
      attributes : [
      new sap.m.ObjectAttribute({
      text : "{WeightMeasure} {WeightUnit}"
      new sap.m.ObjectAttribute({
      text : "{Width} x {Depth} X {Height} {DimUnit}"
      new sap.m.ObjectAttribute({
      text : "{Description}"
      new sap.m.ObjectAttribute({
      text : "www.sap.com",
      active : true,
      press : function () {
      sap.m.URLHelper.redirect("http://www.sap.com", true);

    Thanks for the reply Chandra,
    To clarify a bit more, I have a list object and have successfully been able to bind a model to it.  When I create a list item to put in the list I can display the correct values using the same syntax as above, ie {Width}
    So I am not binding the model to the items in the list rather to the list itself then referring to fields that are available in the model using the syntax {Width} ... and this works fine ... until I try and add some additional text like {StgeBin} in the example below (I am including myHeader in the list that has a model bound to it):
    var myHeader = new sap.m.ObjectHeader({
            title : "Bin # {StgeBin}",   //This shows the text --> Bin # {StgeBin}  ... rather then Bin # 123  (which is what I want)
            //title : "{StgeBin}",        This works and will show the bin number as I expected ie 123
            statuses : [
              new sap.m.ObjectStatus({
                text : "Some Damaged",
                state : "Error"
              new sap.m.ObjectStatus({
                text : "In Stock",
                state : "Success"
            attributes : [
              new sap.m.ObjectAttribute({
                text : "{StgeLocDesc}"
              new sap.m.ObjectAttribute({
                text : "{Material}"
              new sap.m.ObjectAttribute({
                 text : "{MaterialDesc}"
    I took this example right from the SAPUI5 documentation and it works great, just can't add additional text inline with my variables.

  • Question about shared variables and report generator

    I have a project with about 200-250 shared variables and at every 12 hours i want to make a report containing information about some boolean and double front panel variables linked to the shared variables... Now, i've tried with both the "Write Trace to SpreadSheet File" function from DSC->History and with different functions from NI Report Generation Toolkit. My problem is this: i would like to get my xls file to contain just the timestamps when my shared variable changed value. As it is, the number of rows in the file depends, obviously, on the sampling interval given as input. As an example, in 12 hours, my shared variable would change value maybe 5-6 times. Thus i would like my xls file to contain just 5-6 rows with those 5-6 changes. If i set the sampling interval to say, a matter of seconds, that would mean too much unneeded information in my xls file. Instead, if i set it to let's say 15 minutes, i would probably lose the moment the shared variable changed value. Is there a way for me to achieve my desired functionality with functions from DSC or Report Generation Toolkit? Thanks in advance, Sabin 

    Hi Mike and thanks for the reply. Actually, my first idea was exactly this: in an event case structure, whenever my variable changed value, i would retain the relevant data in an array and then at the 12 hour period write all of it in a report. However, my boss deeemed it memory unefficient and compelled me to use only one function. Thus my predicament... If you have more advice on this new info, i would be grateful... Cheers, sabin

  • Question about global variable scope in mxml

    Let's say I have two files, myApp.mxml and EntryClass.as, as
    attached at the end of this post.
    Why does mxmlc complain with this error message:
    quote:
    /path/to/EntryClass.as(4): col: 7 Error: Access of undefined
    property myChart.
    myChart.graphics.drawRect(100,100,100,100);
    ^
    According to devguide_flex3.pdf,
    quote:
    The IDs for all tags in an MXML component, no matter how
    deeply nested they are, generate public variables of the component
    being defined. As a result, all id properties must be unique within
    a document. This also means that if you specified an ID for a
    component instance, you can access that component from anywhere in
    the application: from functions, external class files, imported
    ActionScript files, or inline scripts.
    So how does one reference these public variables?

    "slinabery" <[email protected]> wrote in
    message
    news:gbtnji$f03$[email protected]..
    > Let's say I have two files, myApp.mxml and
    EntryClass.as, as attached at
    > the
    > end of this post.
    >
    > Why does mxmlc complain with this error message:
    >
    quote:
    /path/to/EntryClass.as(4): col: 7 Error: Access of undefined
    property
    > myChart.
    >
    > myChart.graphics.drawRect(100,100,100,100);
    > ^
    >
    >
    > According to devguide_flex3.pdf,
    >
    quote:
    The IDs for all tags in an MXML component, no matter how
    deeply nested
    > they
    > are, generate public variables of the component being
    defined. As a
    > result, all
    > id properties must be unique within a document. This
    also means that if
    > you
    > specified an ID for a component instance, you can access
    that component
    > from
    > anywhere in the application: from functions, external
    class files,
    > imported
    > ActionScript files, or inline scripts.
    >
    > So how does one reference these public variables?
    >
    > myApp.mxml:
    >
    > <?xml version="1.0"?>
    > <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    > applicationComplete="EntryClass.main()">
    > <mx:Panel>
    > <mx:VBox id="myChart" width="900" height="300" />
    > </mx:Panel>
    > </mx:Application>
    >
    > EntryClass.as:
    >
    > package {
    > public class EntryClass {
    > public static function main():void {
    > myChart.graphics.drawRect(100,100,100,100);
    > }
    > }
    > }
    http://www.magnoliamultimedia.com/flex_examples/Amys_Flex_FAQ.pdf
    Third question.

  • Questions about authorization variable customer user exit

    Dear all,
    To reduce the authorization maintenance effort, I found from the web that we can use authorization variable with customer user exit RSR00001.
    When I use the transaction CMOD to display the maintain the user exit RSR00001, the user exit does not found. I would like to know how can I use thie user-exit?
    My SAP version is R/3 4.7
    The information of authorization variable  from web is as follow:
    http://help.sap.com/saphelp_nw04/helpdata/en/6d/58f438114ee836e10000000a114084/frameset.htm
    Would anyone have some ideas to solve my questions?
    Many thanks
    Sunny
    Edited by: LI Sunny on Aug 3, 2010 12:08 PM

    Dear Bala Duvvuri,
    Firstly, many thanks of your reply.
    Actually, what I want to do is to call some user-exit when performing authorization checking. I want to add some logic to the authorization checking and the user exit can be called automatically when performing authorization checking.
    I mainly use this checking in the FI module.
    Are there any ways I can perform this checking?
    One more findings, I have another machine containing SAP XI, I can search the user exit RSR00001. but it doesn't exit in SAP R/3 4.7. Is it version issue or my SAP R/3 4.7 doesn't contain the BI module?
    Many Thanks again.
    Sunny

  • Very simple question about declaring variables

    if a create a new ' int ' as in the code below :
    static int counter;
    does the value of counter automatically default to ' 0 ' ?
    Does this also apply if i declare the var to be public, protected etc ( but not final )
    thanks

    Most languages will initialise an int to 0 if no value is specified but it is dangerous to rely on this as it is not always the case. It is therefore recommended as good practice that you always initialise your own variables to ensure they start with the value you wish and not something unexpected.
    Mark.

  • Question about product variable - is BC the right choice for me?

    I have a criteria that must be met for my ecommerce solution for a new business. The customer has a product that has a variable length, and would like the price to reflect the options that are offered. For example: the produced panels are 30" wide, but the customer can choose the length of each panel. Another option may be sq. ft. for material...
    How can I achieve this with Business Catalyst? Is there an easy way?
    Thank you for your time!!!
    Matt

    Look into Product Attributes.
    You can preset various sizes and change the price based on the size. See this KB Article.
    I would recommend creating a trial site, use a template, then try Product Attributes and see if it does all of what you need.
    If you believe it would work then you can go from there.
    Lynda

  • Question about global variables in Netbeans 4.1's debugger

    so i can see the local variables, great.
    how do i display the global variables when im debugging? searched help, nothing, searched the netbeans site, nothing.
    anyone know?

    I haven't used the 4.1 version of the debugger (I can't get it to work on a single file/class) but under 3.6 you just put the cursor over them and the values is in the tooltip.

  • Simple question about environment variables and setting the class path???

    ok I have been trying for a few months now ontrying to set the class path..
    I work with windows vista..
    on the environment variables user variables,
    I have the name of the variable as class
    and the value as C:\Program Files\Java\jdk1.6.0_04\bin;.
    where javac is...
    on the system variables I have
    its name as class
    and the value as C:\Program Files\Java\jdk1.6.0_04\bin;.
    why is this not reading javac

    The PATH environment variable should have as an entry the directory containing your javac executable. The CLASSPATH should have have entries which define your library directories and entries which are your jar file libraries. In the early days, probably the only CLATHPATH entry you will need will be a '.' to indicate the current directory.
    The Java tutorial covers ALL of this.

  • A basic question about static variables and methods

    What would be the effects if I declare lots of static variables and static methods in my class?
    Would my program run faster?
    Would the class take more memory spaces? (If so, how do I estimate an appropriate number of variabls and methods to be declared static?)
    Thank you @_@

    when you declare a static var the var isn't created for every instance of the class, it just "live" in the class
    when you declare a static method is the same, so if you have:
    class MyClass
    static int myMethod()
    //Method work
    you dont need to have a instance of the class to call myMethod, you can do such things like this.
    int value = Myclass.myMethod();
    if myMethod isn't static you can't do this.. so, if
    class MyClass
    int myMethod()
    //Method work
    you CAN'T call
    int value = MyClass.myMethod();
    instead, you have to write
    MyClass m;
    m = new MyClass();
    value = m.myMethod();

  • Question about conky variable ${acpiacadapter}

    Hello. It's possible to do some flow control based on the ${acpiacadapter} state? I mean, when the laptop is plugged to the AC do this, when is not do that.
    This is what I tried so far:
    ${if_match ${acpiacadapter} == "off-line"} foo ${else} bar ${endif}
    Output error: "Conky: Bad arguments: 'on-line ' and ' "offline"' Conky: compare failed for expression 'on-line == "off-line"'
    ${if_match ${acpiacadapter} == off-line} foo ${else} bar ${endif}
    Output error: "Conky: Bad arguments: 'on-line ' and ' offline' Conky: compare failed for expression 'on-line == off-line'
    ${if_empty ${acpiacadapter}} foo ${else} bar ${endif}
    Turns out that the var it's never empty (as expected).
    I cannot remove the battery of the laptop, it's locked under the chassis (it's a really thin laptop), so I can't check if the battery is plugged in or not. Any pointer? Thanks!

    I have `${if_match "$battery_short" != "F"}$battery_short($battery_time)$endif` in my conkyrc. You need to quote the variable when using if_match.
    Last edited by livibetter (2010-06-05 03:34:12)

Maybe you are looking for