Problem in sql pass through query

i am using the following query:
select * from table_name where item IN (?0) and item1 IN (?1)
i am creating sqlPassthroughQuery but i am getting : Missing right parenthesis /Query not terminated properly exception
but the query is working without where clause and it is working also if i am not using query without parameters i.e.
select * from table_name where item IN ('itemvalue1','itemvalue2') and item1 IN ('itemvalue1','itemvalue2')
Any pointers will be useful
Prakhar

Hi,
i used the query like this:
String query="Select * from table_name where col1 IN(?,?,?) and col2 = ?";
Object params[] = new Object[4];
params[0] = "val1";
params[1] = "val2";
params[2] = "val3";
params[3] = "val4";
Builder builder = (Builder)view.getQueryBuilder();
Query sqlQuery = builder.createSqlPassThroughQuery(query,params);
RepositoryItem[] items = view.executeQuery(sqlQuery);
This is just a basic example.You can get more info @ATG Repository Guide.
Prakhar

Similar Messages

  • Code to run a query in SQL from Access with pass through query

    I have a query in SQL Server 2008:
     [Auto Null Up Date].sql. I want to run this query from Access 2007 using a Pass Through Query. What is the command/code to run this query from Access? I have used Pass Through Queries but never in this capacity so I am somewhat lost. I have
    already established the OBDC link and tested.

    Naomi,
    Here are a few lines of the SQLCMD code in the [Auto Null Update].sql query:
    USE [Archive Master]
    Go
    :r "\\10.200.1.60\c$\Users\bkreft\My Documents\SQL Server Management Studio\Projects\Null BackPress 2 update.sql"
    GO
    :r "\\10.200.1.60\c$\Users\bkreft\My Documents\SQL Server Management Studio\Projects\Null CHWR 3 update.sql"
    GO
    :r "\\10.200.1.60\c$\Users\bkreft\My Documents\SQL Server Management Studio\Projects\Null CHWR 4 update.sql"
    When this code is pasted into a Create Procedure, (the USE [Archive Master] is not used), the procedure will run, but once saved here is what is left of the procedure once I attempt to modify:
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    -- =============================================
    -- Author:                         
    <Author,,Name>
    -- Create date: <Create Date,,>
    -- Description:              
    <Description,,>
    -- =============================================
    Create PROCEDURE [dbo].[NullTest2]
    AS

  • How to get hardware related metrics of SQL Server through query ?

    Hi Folks,
                   I am newbie to the SQL Server programming. I also follow this forum only now. I am not sure if these kind of question had been asked in the past. Let me furnish you more detail about my query. I do like
    to get few details regarding the SQL server. I do need the following details to get the information about it through query
    SQL Server Installation directory
    No. Of CPU(as i read SQL Server standard support 4 cpu and Enterprise support 32 CPU)
    CPU Speed of the SQL Server installed machine
    Disk Storage details
    Operating system on which the SQL Server is installed
    Location of the swap file of SQL Server
    TempDB directory path
    System database directory path
    User database location 
    Log files location
    I do like to get information like this through query. Can i know if such information can be get through query or it should be get only thro' WMI. Please drop your ideas in getting these details.
    Thanks in Advance,
    Regards,
    JeiSurya

    Try this query in the below link 
    http://gallery.technet.microsoft.com/Query-to-find-all-the-8fa765e6
    you will get the SQL Server and H/W Details like 
    IP Address 
    FQDN 
    CurrentSQLNodeName 
    SQL Instance Name 
    SQL Server Product
    SQL Server Edition 
    Service Pack 
    SQL Server Version 
    Operating System
    OS SP Level
    OS Build Number
    SystemManufacturer 
    Processor Type 
    System Model 
    Total RAM in MB 
    NumberOfPhysicalCPUs 
    NumberOfCoresInEachCPU 
    TotalNumberOfCores 
    NumberOfLogicalCPUs

  • Create Recordset (or Datasets?) based on the result of (or the equivalent of) a Pass-through query

    Hello
    Bit new to Visual Studio, coming across as a VB man used to working with ADO
    I've successfully made two Datasets - one pointing to a MySQL database, the other to an Oracle database
    Aside from my other problem of not being able to create a tableadapter with a 'Select returning rows' query just yet, what I will need to do is this:
    'Select * From {OracleTable} where {OracleTable.ID} Not in {MySQL.ID}'
    and have the result returned as something I can read/write/manipulate.
    ADO is quite easy in my head. Can anyone help structure the required steps for this in my head? I'm not even sure what to google for at this point
    Thanks

    It's only that easy (as your SQL statement) if you use linked tables. You can create linked tables in an Access database or SQL Server and then create the join through these tables. It might be easier to use Access in this instance since the database you
    are connecting to isn't that important and Access provides a QBE designer.
    Another option is to use ADO.NET and LINQ to join the DataTables in your DataSets, although that might be a bit more complicated. You would also need to pull all of the data from both tables, which could be a big problem if the tables contain a lot of data.
    If not, it then it may be your best option.
    https://msdn.microsoft.com/en-us/library/bb386921.aspx?f=255&MSPPError=-2147217396
    I've never experimented with a heterogeneous join between Oracle and MySQL so I don't know whether it would be possible to do it directly.
    Paul ~~~~ Microsoft MVP (Visual Basic)

  • Problem extracting variables passed through a url

    Hi I'm trying to pass two variables via a url which I can acheive, but I'm having trouble extracting the information when page refreshes.
    This is the code I've used to pass the variables:_
    <?php while ($row = mysql_fetch_assoc($result1)) {   ?>
    <a href="<?php echo $_SERVER['PHP_SELF'];?>?gallery_id=<?php echo $row['gallery_id']; ?>&amp;year_id=<?php echo $row['year_id'];?>"><?php echo $row['name']; ?></a>
    <?php } ?>
    I'm able to acheive the my objective when on variable is passed using the following code:-
    if (array_key_exists('gallery_id', $_GET)) {
    $gallery_id = $_GET['gallery_id'];
    My question is, how do I do this with two (or more) variables? I need to extract $year_id as well.
    Thanks.

    Thanks for the reply.
    I get the following notice.
    Notice: Unidentified index: gallery_id in ......
    I'm trying to create a photo gallery that displays years at the top, the gallery names for the relevant year in the left hand pane and the relevant photos for a particular gallery in the right hand pane. I have nearly acheived the aim in that everything will initially display ok and when a different year is selected and the page reloads, it will list the galleries for that year and display the photos for the first gallery in the list.
    The problem is that when a new gallery is selected I am able to pass the new gallery_id and the year_id when the page reloads, but I can't extract both results using If(array_key_exists and since the script needs both to function I'm a bit stuck.
    What i really want to do is something like If(array_key_exists('year_id', 'gallery_id', $_GET)) {
    but this won't work! Is it possible to do it this way or am I barking up the wrong tree?
    Thanks.

  • One screen presentation problem on calls pass through cube

    hello all,
    may I have your advices about following problem;
    this is flow diagram:  cts codec (site A)  --  >>  cube  -->> cts codec  (site B) 
    if the codec in the site B is one screen as cts 1100 the presentation cant be shared bidirectional.
    however if it is 3 screen as cts 3010 the presentation works fine.
    this is the part of config:
    voice service voip
     ip address trusted list
      ipv4 X.X.X.X
      ipv4 X.X.X.X
     rtp-ssrc multiplex
     address-hiding
     allow-connections sip to sip
     redirect ip2ip
     fax protocol t38 version 0 ls-redundancy 0 hs-redundancy 0 fallback none
     sip
      session transport tcp
      rel1xx disable
      header-passing
      early-offer forced
      midcall-signaling passthru
      pass-thru headers unsupp
      pass-thru content sdp
      sip-profiles 1
      copy-list 1
    voice class codec 1
     codec preference 1 aacld profile 1
     codec preference 2 g722-64
     codec preference 3 g711ulaw
     video codec h263+
     video codec h264 profile 2
     video codec mpeg4
    voice class sip-profiles 1
     request INVITE peer-header sip Contact copy "(;video;audio;x-cisco-tip;x-cisco-multiple-screen=3)" u01 
     request INVITE sip-header Contact modify "$" "\u01" 
    dial-peer voice X voip
     destination-pattern X...
     video codec h264 profile 2
     rtp payload-type cisco-codec-fax-ack 126
     rtp payload-type cisco-codec-fax-ind 110
     rtp payload-type cisco-codec-aacld 96
     rtp payload-type cisco-codec-video-h264 112
     session protocol sipv2
     session target ipv4: X.X.X.X
     voice-class sip bind control source-interface GigabitEthernet0/0xxx
     voice-class sip bind media source-interface GigabitEthernet0/0xxx
     codec aacld profile 1

    hi
    you have any string as
    voice class sip-profiles 1
     request INVITE peer-header sip Contact copy "(;video;audio;x-cisco-tip;x-cisco-multiple-screen=3)" u01 
     request INVITE sip-header Contact modify "$" "\u01" 
    change it with 
     request INVITE peer-header sip Contact copy "(;video;audio;x-cisco-tip;x-cisco-multiple-screen=*)" u03 
     request INVITE peer-header sip Contact copy "(;video;audio;x-cisco-tip;x-cisco-multiple-screen=(.*))" u03 
     request INVITE sip-header Contact modify "$" "\u03" 
    it will work.

  • Incorporate CAS thesaurus with SQL pass throughs

    First off, I'm very new with Endeca. Our company recently upgraded our Endeca implementation and has asked me to evaluate the new feature that allows the pipeline to pull data directly from SQL using a SQL Query in the record adapter. Currently, our DBA has a task that extracts the SQL data into xml files and then the CAS picks them up. We currently have a large workbench thesaurus definition set. Is it possible to incorporate the thesaurus definition into the pipeline? Even if someone can point me in the right direction(documentation?) that talks about incorporating a record adapter that utilizes a SQL query and incorporates the search metadata, I would appreciate it very much..
    Thank you in advance.

    First off, I'm very new with Endeca. Our company recently upgraded our Endeca implementation and has asked me to evaluate the new feature that allows the pipeline to pull data directly from SQL using a SQL Query in the record adapter. Currently, our DBA has a task that extracts the SQL data into xml files and then the CAS picks them up. We currently have a large workbench thesaurus definition set. Is it possible to incorporate the thesaurus definition into the pipeline? Even if someone can point me in the right direction(documentation?) that talks about incorporating a record adapter that utilizes a SQL query and incorporates the search metadata, I would appreciate it very much..
    Thank you in advance.

  • Use of LEFT, MID  functions in MS Access expression evaluating a SQL pass-thru on an Oracle Backend

    As the title above suggests this is a somewhat complex problem.
    I have the following expression on a field in a MS Access Make Table query.
    Left([SYN4_View Invalid Last Candidates]![LastName],3). The table it is referring to: SYN4_View Invalid Last Candidates is a SQL Pass-thru query on an Oracle backend. So, when the expression attempts to evaluate in MS Access 2003 I get the following error msg:
    Undefined function 'left' in expression.
    I am assuming this is because LEFT function can't evaluate the output of the SQL P-T. I can't use SUBSTR as Access doesn't recognize it.
    I would appreciate suggestions

    robleh7 wrote:
    I don't have access to the Oracle dB. No pun intended here. Everything I do, I must do from the MS Access 2003 front-end
    wow .. that's kinda like sending soldiers into a war zone with a bear trap attached to their legs. O_0
    Kind of blatantly trying to hamper your ability to do your job, don't you think?

  • Problems in SQL Query

    Dear All,
    I am having some problem in SQL query. I am trying to get total sum of one inventory using the following query it works fine:
    sum(case when mt.transaction_quantity > 0 then (mt.transaction_quantity) else 0 end) "TOT_IN"
    ,sum(case when mt.transaction_quantity >= 0 then 0 else (abs(mt.transaction_quantity)) end) "TOT_OUT"
    But when I breakup the total sum into monthly breakup it fails to return the correct some could any one help what is wrong in the following query which is returning incorrect monthly sum. Following is that query. Your help in this regard would highly be appreciated.
    sum(case when mt.transaction_quantity > 0 then (decode (floor (floor (to_date('17-MAR-2009')- mt.transaction_date) / 30), 0, mt.transaction_quantity, null)) else 0 end) "MONTH1_IN"
    ,sum(case when mt.transaction_quantity >= 0 then 0 else (decode (floor (floor (to_date('17-MAR-2009')- mt.transaction_date) / 30), 0, abs(mt.transaction_quantity), null)) end) "MONTH1_OUT"
    Thanks

    Hi,
    Sorry, I don't really understand what you want.
    Whenever you have a question, it helps to post:
    (1) The version of Oracle (and any other relevant software) you're using
    (2) A little sample data (just enough to show what the problem is) from all the relevant tables
    (3) The results you want from that data
    (4) Your best attempt so far (formatted)
    (5) The full error message (if any), including line number
    Executable SQL statements (like "CREATE TABLE AS ..." or "INSERT ..." statements) are best for (2).
    If you can present your problem using commonly available tables (for example, tables in scott schema, or views in the data dictionary), then you can omit (2).
    Formatted tabular output is okay for (3). Type these 6 characters
    &#123;code&#125;
    (small letters only, inside curly brackets) before and after the tabular text, to preserve spacing.
    What exactly do you mean by "monthly breakup"?
    If you want separate figures for each calendar month, Blushadow's suggestion (TRUNC (mt.transaction_date, 'MM')) is what you want.
    If you want separate figures for the last 30 days before today, then something like what you posted ("FLOOR ((:target_date - mt.transaction_date) / 30)": the extra FLOOR doesn't help any) should work, so if you ran the query on March 17, 2009, the first "month" would be February 16 through March 17.
    In a CASE statement, there's rarely any need to use DECODE. The following is equivalent to the last line of code you posted:
    ,       SUM ( CASE
                WHEN  mt.transaction_quantity >= 0
                THEN  0
                WHEN  TO_DATE ('17-MAR-2009', 'DD-MON-YYYY') - mt.transaction_date
                        BETWEEN 0
                        AND     29.99999  -- 30 days minus a fraction of a second
                THEN  ABS (mt.transaction_quantity)
               END
             )          AS month1_outDon't you find this easier to understand (and debug)?

  • Bex Query: make data pass through user exit calculation at navigation time

    Hi all!
    I have a new requirement and I don't know how to solve it...
    Now, when I execute a web model containing a query, the system "reads" a date and calculate the query based on that date in a user exit defined in CMOD, for example, filtering data with an interval between january and the date read.
    Besides, I have in the web model a dropdown item where user can choose other months. The dropdown item only shows single values but now if I choose a month, the query only shows data for that month.
    I need the system filters the query with the new interval. For example, between january and the new month the user has just chosen.
    Does anyone know a way to make a query pass through the user exit calculation after executing the query for the first time? Any other ideas? I need the query to "reexecute" and filter the data (create a new interval) based on the value a user chose.
    (sorry about any inconvenience, because I posted the problem in another sdn specific forum but as I received no answer I've decide to explain it in here...)
    Thank you! Points will be assigned.

    Any ideas please?

  • Having problem while connecting to SQL Server through a application

    hi guys ,
    having one problem while connecting to the SQL SERVER 2008 R2 through a application (Dynamics NAV), by using the concept of Linked Server.
    But one more thing , i am able to access that very SQL server through my app , when i am working locally , i mean to say that when i am working on the machine itself on which the server is installed then its working fine .
    But when i am working on another system the query doesn't work.

    by using the concept of Linked Server.
    Why through a linked server and not directly as a simple remote connection? I don't think you app is aware of linked server.
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • Should I Install SQL Server 2008 R2 on a VHDX or Pass-through disk

    Hi,
    I am in going to be setting a virtual server running Windows Server 2008 R2 on my Hyper-V cluster and I will be also adding SQL Server 2008 R2 once the OS is configured. Can you please suggest whether I should setup a VHDX or a pass-through disk? I have
    read articles online suggesting to use a pass-through disk from my SAN but I also read that since Windows Server 2012, VHDX is as good as a pass-through disk, especially because it will allow to have snapshots taken, unlike the pass-through which will not.
    Please advise on whether I should chose a pass-through disk or a VHDX.
    Thanks in advance,

    Hi Aquila,
    There are three basic types of Virtual Hard Disks (VHDs) that you can use with VMs, such as dynamic VHD, fixed VHD, and differencing disks. Usually, the fixed VHD is almost always the best choice for virtualized SQL Server systems that run a production workload.
    You can use dynamic disks for noncritical production workloads, as well as for testing, training, and lab environments. Pass-through disks offer the highest level of performance for VM storage, however, Pass-through disks can't be moved without incurring downtime,
    and they don't support VM snapshots. For more information, see:http://sqlmag.com/sql-server/sql-server-virtualization-tips
    In addition, there is an article about how to setup boot from VHD for a SQL Server. You can review the following link.
    http://www.mssqltips.com/sqlservertip/2327/how-to-setup-boot-from-vhd-for-a-sql-server-test-or-development-environment/
    Regards,
    Sofiya Li
    Sofiya Li
    TechNet Community Support

  • Logical partitioning, pass-through layer, query pruning

    Hi,
    I am dealing with performance guidelines for BW and encountered few interesting topics, which however I do not fully undestand.
    1. Mainetance of logical partitioning.
    Let's assume logical partitioning is performed on year. Does it mean that every year or so it is necessary to create additional cube/transformation and modify multiprovider? Is there any automatic procedure by SAP that supports creation of new objects, or it is fully manual?
    2.Pass- though layer.
    There are very few information about this basic concept.  Anyway:
    - is pass through DSO write optimized one? Does it store only one loading - last one? Is it deleted after lading is sucessfully finished (or before new load starts)? And - does this deletion do not destroy delta mechanism? Is the DSO replacing PSAfunctionally (i.e. PSA can be deleted every load as well)?
    3. Query pruning
    Does this happen automatically on DB level, or additional developments with exits variables, steering tables and FMs is required?
    4. DSOs for master data loads
    What is the benefit of using full MD extraction and DSO delta insetad of MD delta extraction?
    Thanks,
    Marcin

    1. Mainetance of logical partitioning.
    Let's assume logical partitioning is performed on year. Does it mean that every year or so it is necessary to create additional cube/transformation and modify multiprovider? Is there any automatic procedure by SAP that supports creation of new objects, or it is fully manual?
    Logical partitioning is when you have separate ODS / Cubes for separate Years etc ....
    There is no automated way - however if you want to you can physically partition the cubes using time periods and extend them regularly using the repartitioning options provided.
    2.Pass- though layer.
    There are very few information about this basic concept. Anyway:
    - is pass through DSO write optimized one? Does it store only one loading - last one? Is it deleted after lading is sucessfully finished (or before new load starts)? And - does this deletion do not destroy delta mechanism? Is the DSO replacing PSAfunctionally (i.e. PSA can be deleted every load as well)?
    Usually a pass through layer is used to
    1. Ensure data consistency
    2. Possibly use Deltas
    3. Additional transformations
    In a write optimized DSo - the request ID is key and hence delta is based on request ID. If you do not have any additional transformations - then a Write optimized DSO is essentially like your PSA.
    3. Query pruning
    Does this happen automatically on DB level, or additional developments with exits variables, steering tables and FMs is required?
    The query pruning - depends on the run based and cost based optimizers within the DB and not much control over how well you can influence the execution of a query other than havin up to date statistics , building aggregates etc etc.
    4. DSOs for master data loads
    What is the benefit of using full MD extraction and DSO delta insetad of MD delta extraction?
    It depends more on the data volumes and also the number of transformation required...
    If you have multiple levels of transformations - use a DSO or if you have very high data volumes and want to identify changed records - then use a DSO.

  • Re: Problem in SQL Query

    Hi Billy,
    Thanks for ur reply. It was very helpful. I do have a small problem i want to reterieve a column called doc_class_description from a table called class which also contains the doc_class_code. To be more clear
    tablename: Class
    the fields are:
    Name Null? Type
    DOC_CLASS_CODE NOT NULL NUMBER(10)
    DOC_CLASS_DESCRIPTION VARCHAR2(1000)
    I want to reterieve this column DOC_CLASS_DESCRIPTION along with the columns in subclass table in the same format as asked yesterday.
    for ur reference:
    fields in subclass table are:
    Name Null? Type
    DOC_CLASS_CODE NUMBER(10)
    DOC_SUBCLASS_CODE NOT NULL NUMBER(10)
    DOC_SUBCLASS_DESCRIPTION VARCHAR2(1000)
    My output should look like:
    DOC_CLASS_CODE DOC_CLASS_DESCRIPTION DOC_SUBCLASS_CODE DOC_SUBCLASS_DESCRIPTION
    12 ABC 1 XYZ
    2 DFG
    Can the same query given yesterday be modified

    Duplicate thread
    Re: Problem with SQL query

  • [4.0EA2]Is there a way to simply pass through SQL commands?

    Hello out there,
    I wonder if there is a way to pass through some commands without SQL Developer trying to parse or otherwise process them.
    In 3.2 I could do something like this when connected to a MySQL database:
    /*sqldev:stmt*/begin;
    delete from test where some_condition=1;
    /*sqldev:stmt*/rollback;
    Now I get the following error:
    SELECT command denied to user 'tsn'@'pc259.vu2k.vertriebsunion.de' for table 'all_tab_cols'
    It seems that SQL Developer tries do do some magic that does not work on non-Oracle databases.
    So is there some magic comment like /*sqldev:stmt*/ that just passes through the command without further parsing?
    The best solution would be SQL Developer supporting transactions on MySQL though...
    I know, I posted a similar question some time ago for 4EA1, but did not get an answer for that.
    Regards,
    dhalek

    Hi Dhalek,
    Just tried out a small example and it works ok in SQL Dev 4
    drop table t1;
    create table t1 (col1 int);
    insert into t1 values (1);
    insert into t1 values (2);
    insert into t1 values (3);
    select * from t1;
    /*sqldev:stmt*/BEGIN;
    DELETE FROM t1;
    SELECT * FROM t1;
    /*sqldev:stmt*/ROLLBACK;
    SELECT * FROM t1;
    ---- RESULT ----
    table T1 dropped.
    table T1 created.
    1 rows inserted.
    1 rows inserted.
    1 rows inserted.
    col1      
    1         
    2         
    3         
    /*sqldev:stmt*/BEGIN
    3 rows deleted.
    col1      
    /*sqldev:stmt*/ROLLBACK
    col1      
    1         
    2         
    3        
    Regards,
    Dermot
    SQL Developer Team

Maybe you are looking for

  • How do I stop getting shared calendar notifications?

    If I share a calendar to someone in read-only mode, how can I prevent them from being spammed with notifications every time I add or change appointments?  Similarly, when I've subscribed to someone else's shared calendar, can I prevent myself from be

  • Can't see video of windows XP user

    i'm trying to video chat with a windows xp user (they are using AIM 5.9). I'm on an IMAC G5 using latest version of ichat. Windows user has turned off all firewalls. We can both send and accept video invitation. But i cannot see the video of my windo

  • How to use external application, webclipping portlet in webcenter ?

    I'm just following this [http://biemond.blogspot.com/2008/01/external-application-in-webcenter-11g.html|http://biemond.blogspot.com/2008/01/external-application-in-webcenter-11g.html] to integrate an application into webcenter application as a extern

  • Entering a Not To Exceed Validation Script

    I am looking for a validation script that will not allow a user to enter an amount that exceeds an amount they previously entered in another form box.  For example, if the entered a value of 25000 in a cell named 'SchValue01', they could not enter 25

  • Remapping keys to be like a PC keyboard

    I have an Apple bluetooth keyboard and works well. I use Citrix & MS's Remote Desktop a fair bit to login to WinTel machines. One anoying thing is to map certain keys to be a PC equalivant. Primarily I would like to map the "Help" (or F14) key to be