SQL Join in PHP

Dear all
I have two tables in my database like the following
Table A
Code Narr
1 Code1
2 Code2
3 Code3
4 Code4
Table B
Code Data
2 Data1
3 Data2
By joining I want to display the matching records. But I want to display all the Codes from Table A.
How can i do it in php?
Rana

By joining I want to display the matching records.
But I want to display all the Codes from Table A.LEFT OUTER JOIN?
SELECT *
FROM tableA a
LEFT JOIN
tableB b
ON a.field = b.field;
Regards,
Phiri

Similar Messages

  • Can't figure out how to install sql server for PHP

    I am trying to install SQL Server for PHP on a server with Server 2008 32 bit.  The exe from http://www.microsoft.com/en-us/download/details.aspx?id=20098 keeps tell me that it is an invalid win32 application.  I've tried running as administrator
    as well.  Somewhere I read you need to open the exe with 7zip.  I was able to do that and see all the files in there, but where do I go from there?
    Thanks
    Mike
    edit: forgot to mention I'm using Apache for my server

    That solution is obsolete. The current solution is here:
    http://msdn.microsoft.com/en-us/sqlserver/ff657782.aspx
    bill ross

  • EXEC SQL join in ABAP program

    Hi All,
    I am using EXEC SQL join in my ABAP report,but it is giving dump.could you please correct my following code?
    START-OF-SELECTION.
      CONCATENATE '%' pa_match '%' INTO tp_match.
      EXEC SQL.
        OPEN dbcur FOR
        SELECT  kunnr,name1, banks
               FROM  kna1 as a inner join
               knbk as b
               on akunnr = bkunnr
               WHERE a.kunnr = b.kunnr and
               upper(a~name1) LIKE :tp_match
      ENDEXEC.
      DO.
        EXEC SQL.
          FETCH NEXT dbcur INTO :wa_name1
        ENDEXEC.
        IF sy-subrc <> 0.
          EXIT.
        ENDIF.
        APPEND wa_name1 TO ta_name1.
        COLLECT wa_name1 INTO ta_name1.
      ENDDO.
      EXEC SQL.
        CLOSE dbcur
      ENDEXEC.

    Remove the 'As' from the statement
    EXEC SQL.
      OPEN dbcur FOR
      SELECT kunnr,name1, banks
      FROM kna1 a inner join        "Delete 'AS' here
      knbk b
      on a~kunnr = b~kunnr
      WHERE a.kunnr = b.kunnr and
      upper(a~name1) LIKE :tp_match
    ENDEXEC.

  • SQL JOIN with BPM sql component

    Hello friends.
    How to use SQL JOIN with BPM sql component?
    The tables objects are created but the joined tables belong to different sql components .
    I tried something like that, but a error "table doesn't exist" occours.
    Ex:
    for each element in
    SELECT imuImovelCd
    FROM IMOVEIS_URBANOS,
    Integracao.FGLP.IMOVEIS_PRE_EDITAIS
    WHERE IMOVEIS_URBANOS.imuImovelCd = Integracao.FGLP.IMOVEIS_PRE_EDITAIS.ipeImuCd
    AND Integracao.FGLP.IMOVEIS_PRE_EDITAIS.ipePedNr = 1
    AND Integracao.FGLP.IMOVEIS_PRE_EDITAIS.ipePedAa = 2008
    do
    extend this.imoveis using cdImovel = element.imuimovelcd,
                                  nrImovel = call(DEC_ENDERECO, codimovel : element.imuimovelcd, tipoimovel : 1)
    end
    Edited by: user9008295 on 26/01/2010 05:19

    ok, ok you are right.
    When I try use SQL Statement to make a JOIN with 2 tables on different sql objects, BPM returns "table dosn't exists".
    So.... I change my code. I dont know if this is the best way to do, but... i hope u, or everyone, can help me to do a best work.
    This code works fine.
    for each element in
    SELECT ipeImuCd
         FROM Integracao.FGLP.IMOVEIS_PRE_EDITAIS
         WHERE Integracao.FGLP.IMOVEIS_PRE_EDITAIS.ipePedNr = 1
         AND Integracao.FGLP.IMOVEIS_PRE_EDITAIS.ipePedAa = 2008
    do
         for each element2 in
              SELECT imuImovelDv
              FROM IMOVEIS_URBANOS
              WHERE imuImovelCd = element.ipeImuCd
         do
              extend this.imoveis using cdDvImovel = String(element2.imuImovelDv),
                                            cdImovel = Decimal(element.ipeImuCd),
                                            endereco = call(DEC_ENDERECO, codimovel : element.ipeImuCd, tipoimovel : 1)
         end
    end
    Thx a lot!!!

  • ANSI SQL JOIN

    Hi
    How to use ANSI SQL JOINS (9i) for below query
    SELECT EMP.EMPNO,EMP_T.TNO,EMP_T.SAL1 FROM EMP,EMP_T WHERE EMP.EMPNO=EMP_T.TNO
    UNION ALL
    SELECT EMP.EMPNO,EMP_T.TNO,EMP_T.SAL2 FROM EMP,EMP_T WHERE EMP.EMPNO=EMP_T.TNO
    UNION ALL
    SELECT EMP.EMPNO,EMP_T.TNO,EMP_T.SAL3 FROM EMP,EMP_T WHERE EMP.EMPNO=EMP_T.TNO
    EMPNO TNO SAL1
    7369 7369 100
    7499 7499 1000
    7566 7566 400
    7782 7782 4000
    7369 7369 200
    7499 7499 2000
    7566 7566 500
    7782 7782 5000
    7369 7369 300
    7499 7499 3000
    7566 7566 600
    EMPNO TNO SAL1
    7782 7782 6000
    Regards
    MM

    SELECT EMP.EMPNO,
           EMP_T.TNO,
           EMP_T.SAL1
    FROM   EMP
    JOIN   EMP_T ON ( EMP.EMPNO = EMP_T.TNO )
      UNION ALL
    SELECT EMP.EMPNO,
           EMP_T.TNO,
           EMP_T.SAL2
    FROM   EMP
    JOIN   EMP_T ON ( EMP.EMPNO = EMP_T.TNO )
      UNION ALL
    SELECT EMP.EMPNO,
           EMP_T.TNO,
           EMP_T.SAL3
    FROM   EMP
    JOIN   EMP_T ON ( EMP.EMPNO = EMP_T.TNO )

  • OWB 10.2.0.4 ANSI SQL join problem

    Hi
    Its seams to me, that in OWB 10.2.0.4 there is something broken with ANSI SQL joins and instead of ANSI joins there is used oracle SQL joins only. Maybe someone can point some solutions? I can’t rewrite all mappings with union and other operators. And manually pl/sql editing also would be big problem.

    "Am I correct in assuming you did not code ANSI joins?" -> yes, i am coding Oracle SQL joins and with this option just generating ANSI joins.
    With ANSI SQL join you can use OR and IN operands (and code looks more readable).
    It is question of performance (so for example 80% of dataset you can join by one column other 15% by second etc ..). So this all can be rewritten also in Split->join->union all, but if you have several such joins, this will be painfully.

  • SQL Join Help

    SQL Experts,
    I have a query below. Can I improve the SQL joining order in highlighted section - Lines 31 to 40
    SNIOTM.SNI_PA_OTM_ARC_DRVR -- around 200K rows
    SNIOTM.SNI_PA_ORD_SHP_STATUS -- 8 rows
    Edited by: 922411 on May 12, 2013 7:42 PM

    922411 wrote:
    SQL Experts,
    I have a query below. Can I improve the SQL joining order in highlighted section - Lines 31 to 40
    SNIOTM.SNI_PA_OTM_ARC_DRVR -- around 200K rows
    SNIOTM.SNI_PA_ORD_SHP_STATUS -- 8 rowsYou need not worry about the Joining Order, Oracle CBO is efficient enough to choose the Most Efficient way of joining the tables. However, it will depend on your Oracle Version, which you have not mentioned. If you are 10g or higher then you certainly need not worry.
    If you sense a problem in performance of query, then I will suggest you read the linked threads in {message:id=9360003} and post the details as specified.
    Only this will help us provide releavant suggestions and avoid guessing games.
    PS:- Do not forget to post Oracle Version and the Explain Plan in {noformat}{noformat} tags, exactly as specified.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Help - Bean Binding an SQL join to a gui component(jtable) in Netbeans?

    Good afternoon. I'd like to ask if there is a way to data bind an SQL Join from 2 or more tables to a
    GUI component(Jtable) in Netbeans. All the tutorials show is how to bind all the fields of 1 database table
    to the component. Under the BIND/ELements option the IMPORT DATA TO FORM menu only allows
    you to choose 1 among the database tables from a selected database.
    Is there a way to configure an SQL query and attach it to the component?
    Thanks.

    This is not a Swing problem. Try a NetBeans forum.

  • Converting oracle join to Ansi sql join

    Hi Guys,
    I am new to SQL and trying to convert the following Oracle query (joins) into ANSI sql joins...Can someone please help me?
    SELECT M.EXTERNALCODE, M.NAME AS MNAME, SC.BIRIM, SM.TRANSACTIONDATE, SMD.AMOUNT,
    SMD.UNITPRICE, SM.ID AS SMID, SMD.ID AS SMDID, F.NAME AS FNAME,
    IFNULL (SMD.AMOUNT, 0, SMD.AMOUNT) * IFNULL (SMD.UNITPRICE, 0, SMD.UNITPRICE) AS TOTALPRICE, SMD.AMOUNT AS RECEIVED_QUANTITY,
    PD.ORDERID, PD.AMOUNT QUANTITY, PO.PROCESSDATE
    FROM STOCKMAINTRANSACTION SM,
    STOCKMAINTRANSACTIONDETAIL SMD,
    MATERIAL M,
    STOCKCARD SC,
    FVSTOCK FVS,
    FIRM F,
    PURCHASEORDER PO,
    PURCHASEORDERDETAIL PD,
    PURCHASEORDERDETAILSUPPLIED PDS
    WHERE SM.ID = SMD.MAINTRANSACTIONID
    AND SMD.MATERIALID = M.ID
    AND SMD.STOCKCARDID = SC.ID
    AND SM.PROPREF = FVS.RECORDID(+)
    AND FVS.FIELDID(+) = 2559
    AND FVS.FLEVEL(+) = 'F'
    AND F.ID(+) = SUBSTR (FVS.FVALUE, 1, 9)
    AND SM.TRANSDEFID in (999,2329,2344,2370,150000903,150005362)
    AND SMD.CANCELLED = 0
    AND SMD.STOCKUPDATED = 1
    AND SMD.ID = PDS.STOCKMAINTRANSACTIONDETAILID
    AND PDS.ORDERDETAILID = PD.ORDERDETAILID
    AND PO.ORDERID = PD.ORDERID
    AND (M.ID = {@MATERIALID@} OR {@MATERIALID@} = 0)
    AND (SM.STOREID = {@STOREID@} OR {@STOREID@} = 0)
    AND (F.ID = {@SUPPLIERID@} OR {@SUPPLIERID@} = 0)
    AND SM.TRANSACTIONDATE BETWEEN {@STARTDATE@} AND {@ENDDATE@}
    ORDER BY F.NAME, M.EXTERNALCODE, SM.TRANSACTIONDATE
    Really appreciate the help!
    Thanks.

    Hi,
    Welcome to the forum!
    To convert to ANSI syntax, replace join conditions in the WHERE clause
    FROM           x
    ,             y
    WHERE         x.x1  = y.y1
    AND           x.x2  = y.y2with ON conditions in the FROM clause:
    FROM           x
    JOIN             y   ON    x.x1  = y.y1
                             AND   x.x2  = y.y2In inner joins, conditions that do not reference 2 tables are not really join conditions, so it doesn't matter if they are in the FROM clause or in the WHERE clause.
    In your case
    SM.TRANSDEFID in (999,2329,2344,2370,150000903,150005362)could be part of a join condition involving sm, or it could be in the WHERE clause. Most people find it clearer if 1-table conditions like this are in the WHERE clause.
    Again, this only applies to inner joins. For outer joins, all conditions that apply to a table that may lack matching rows must be included in the FROM clause, like this:
    LEFT OUTER JOIN  fvstock   fvs  ON   sm.propref       = fvs.recordid
                                    AND  fvs.fieldid  = 2559
                        AND  fvs.flevel   = 'F'Try it.
    If you have trouble, post your best attempt, along with CREATE TABLE and INSERT statements for a little sample data from all the tables involved, and the results you want from that data. Simplify the problem. Post only the tables and columns that you don't know how to handle.
    See the forum FAQ {message:id=9360002}
    user8428528 wrote:
    AND (M.ID = {@MATERIALID@} OR {@MATERIALID@} = 0)
    AND (SM.STOREID = {@STOREID@} OR {@STOREID@} = 0)
    AND (F.ID = {@SUPPLIERID@} OR {@SUPPLIERID@} = 0)
    AND SM.TRANSACTIONDATE BETWEEN {@STARTDATE@} AND {@ENDDATE@}This is not valid Oracle SQL. Is {@MATERIALID@} some kind of variable?

  • Could I call SQL Loader in PHP?

    Hi.
    I a newer using oracle with PHP. I want to import data to database.
    I am using SQL Loader tool. It is good for import data.
    Now, I want to call command from PHP. Can I call it from PHP or Not?
    Thank for your help.
    Rac

    Hi,
    Yes. You can invoke SQL*Loader using php exec. function: http://pl.php.net/manual/en/function.exec.php
    Please read all security warnings related to this function.
    Regards, Paweł

  • Having SQL join problems!

    I have got a master recordset and this is the SQL for it:
    SELECT fld_contentID, fld_contentPAGE, fld_contentIMGSLDR, fld_contentTITLE, fld_contentTOP, fld_contentPODL, fld_contentPODR, fld_contentBOTTOM, fld_contentBGIMG, fld_contentSHOW, fld_contentDATE
    FROM tbl_content
    WHERE fld_contentPAGE = '1'
    ORDER BY fld_contentDATE DESC
    This works fine. I can populate the page with the content that I want.
    I have a second table with secondary information within it for promotional needs. This table serves what I am referring to as 'pods' of info. I am trying to pull and join content from the table called tbl_pods using the unique ID of the pod record and joining it with a field in the tbl_content table, and that field is called fld_contentPODL. Here's the code:
    SELECT *
    FROM tbl_pods
    JOIN tbl_content ON tbl_content.fld_contentPODR = tbl_pods.fld_podID
    WHERE fld_podID = podrvar
    Name: podrvar
    Type: Interger
    Default value: %
    Run-time Value: $_GET['tbl_content.fld_contentPODL']
    I have tried every variation of JOIN that I can think of, but it just won't work with a dynamic default value. If I give a specific default value of 1, instead of %, then it works as expected, but only by being specific which means it's not loading the variable dynamically.
    Can somebody please highlight the problem with my join statement, cos this is driving me mental!
    Is there something wrong with my master table tbl_contents. I can't see that there is as I am using the field fld_contentPODL to hold the unique ID of the pod, so surely I can join the tables on that! Am I passing data incorrectly? I didn't think I was as I am asking to join the data of tbl_pods to the data of tbl_contentPODL, which should work.
    Thanks in advance.
    Mat

    What I mean by dynamic default value is the content of the field in the record which is effectively the 'master' instruction to load the content of the JIONed table record using the field fld_podID (in tbl_pods). Basically, as you put it, the runtime value. I used % as an example just because I have tried loads of other things! I normally use -1 which DW sets by default.
    So, my database is like this:
    Main page content is held in a table called: tbl_content
    fld_contentID - INT (primary key) - Value eg: 1 to what ever!
    fld_contentTITLE - VARCHAR - Value eg: About us
    fld_contentTOP - VARCHAR - Value eg: Blah blah blah
    fld_contentPODL - INT - Value eg: 1 (or 2 or 3 etc based on how many records I have in tbl_pods.fld_podID)
    The 'pods' content is held in a table called: tbl_pods
    fld_podID - INT (primary key) - Value eg: 1 to what ever!
    fld_podNAME - VARCHAR - Value eg: Book for Xmas
    fld_podCONTENT - VARCHAR - Value eg: We're taking bookings now, so get in touch to ensure you don't miss out.
    What I am trying to do is JOIN tbl_content.fld_contentPODL to tbl_pod.fld_podID and then display the runtime content associated with the record so I can display 'Book for Xmas, We're taking bookings now...'
    Here's my page code:
    <?php require_once('Connections/conn_t3pi.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;   
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      return $theValue;
    mysql_select_db($database_conn_t3pi, $conn_t3pi);
    $query_rs_content = "SELECT * FROM tbl_content WHERE fld_contentPAGE = '1' ORDER BY fld_contentDATE DESC";
    $rs_content = mysql_query($query_rs_content, $conn_t3pi) or die(mysql_error());
    $row_rs_content = mysql_fetch_assoc($rs_content);
    $totalRows_rs_content = mysql_num_rows($rs_content);
    $podlvar_rs_podl = "-1";
    if (isset($_GET['tbl_pods.fld_podID'])) {
      $podlvar_rs_podl = $_GET['tbl_pods.fld_podID'];
    mysql_select_db($database_conn_t3pi, $conn_t3pi);
    $query_rs_podl = sprintf("SELECT * FROM tbl_pods JOIN tbl_content ON tbl_content.fld_contentPODL = tbl_pods.fld_podID WHERE tbl_content.fld_contentPODL = %s", GetSQLValueString($podlvar_rs_podl, "int"));
    $rs_podl = mysql_query($query_rs_podl, $conn_t3pi) or die(mysql_error());
    $row_rs_podl = mysql_fetch_assoc($rs_podl);
    $totalRows_rs_podl = mysql_num_rows($rs_podl);
    ?>
    <!DOCTYPE HTML>
    <html>
    <head><title>Untitled Document</title></head>
    <body>
    <h1 class="pinyon"><?php echo $row_rs_content['fld_contentTITLE']; ?></h1>
        <?php echo $row_rs_content['fld_contentTOP']; ?>
        <p><a href="http://localhost/~matthewstuart/ThreePigeons/page.php?ID=1">link</a></p>
      <h4><?php echo $row_rs_podl['fld_podNAME']; ?></h4>
      <p><?php echo $row_rs_podl['fld_podCONTENT']; ?></p>
    </body>
    </html>
    <?php
    mysql_free_result($rs_content);
    mysql_free_result($rs_podl);
    ?>
    I've made the SQL bold so it's easier to pick out. Yeah, I am at a loss as I can make the correct content appear if I physically type the correct runtime ID, but if I have a runtime that is loaded by the master record, then it doesn't show anything. I can't figure out why! I am sure I just have something switched around either in the JOIN or in the WHERE, but I don't know what though.
    Thanks.
    Mat

  • SQL JOIN problem

    Hello,
    To output data on my .php website I use a SQL database. One
    particular page needs information from 3 tables:
    1. Product (product.id, product.name)
    2. Partner (partner.productid, parner.shopname)
    3. Shop (shop.shopshopname)
    I currently have this code running to make it happend:
    SELECT *
    FROM (product LEFT JOIN partner ON product.id =
    partner.productid) LEFT JOIN shop ON partner.shopnaam =
    shop.shopshopnaam
    WHERE product.categorie = 'Kinderwagens' AND
    product.hoofdmodel = '1'
    ORDER BY product.name ASC, shop.shopcpc DESC
    The idea is that every product.name gets outputted in a list
    just once and that it picks partner.productid of the row with the
    highest corresponding shop.cpc.
    Example: I have a lot of product.id's where product.id =
    "1000 is found 4 times in partner.productid. All product.name's are
    outputted and ascend correctly. However, product.name with
    product.id=1000 is outputted 4 times. I only want it outputted once
    where it pickes the corresponding partner.id where its
    corresponding shop.shopcpc is highest. What do I do to prevent it
    from outputting all 4?
    I know its kind of complex to explain, if there are questions
    please let me know.

    I kind of fixed this problem with a group by:
    SELECT *
    FROM (product LEFT JOIN partner ON product.id =
    partner.productid) LEFT JOIN shop ON partner.shopnaam =
    shop.shopshopnaam
    WHERE product.categorie = 'Kinderwagens' AND
    product.hoofdmodel = '1'
    GROUP BY product.naam
    ORDER BY product.naam ASC, shop.shopcpc DESC
    However, by doing this my ORDER BY shop.shopcpc doesnt work
    anymore. Anyone know how to fix this?

  • Pl sql join and selecting columns from join."t"."c": invalid at debug time

    I noticed the error at cc.Country that is shown because cc is not yet there at compile time (got that
    from searching this forum).
    Isnt that a bit weak of oracle sql developer that it doesnt compile from the outside to the inside /core but
    rather form top to bottom?
    Am I right with my conclusion? If so, how to do it otherwise i.e. specifying that cc.country is
    a column from countrycodes joined with table6 ?
    SELECT DISTINCT 0,
    2,
    SUBSTR('metable', 0, 1) || '_ABC',
    'ABC_' || 'metable',
    'ABC ' ||cc.Country ,
    '+'
    FROM table6
    LEFT JOIN COUNTRYCODE cc
    ON cc.Code = metable
    WHERE metable IS NOT NULL
    AND metable <> ''

    metalray wrote:
    hi Boneist
    thanks for your reply
    its in a plsql procedure (10g). well as you see cc is the alias
    of the table COUNTRYCODE. which does exists. the error is at 'ABC ' ||cc.Country'
    telling me"PL/SQL: ORA-01747: invalid user.table.column,..."
    when I put COUNTRYCODE next to table6 in the FROM it works but thats not what I want
    since I want to join both tables not just select from both.Can you give us your exact code and exact error message.
    I'm not finding any problem with using alias names in the query..
    SQL> select d.dname
      2        ,'EMPNAME : '||e.ename
      3  from dept d LEFT JOIN emp e ON e.deptno = d.deptno;
    DNAME          'EMPNAME:'||E.ENAME
    RESEARCH       EMPNAME : SMITH
    SALES          EMPNAME : ALLEN
    SALES          EMPNAME : WARD
    RESEARCH       EMPNAME : JONES
    SALES          EMPNAME : MARTIN
    SALES          EMPNAME : BLAKE
    ACCOUNTING     EMPNAME : CLARK
    RESEARCH       EMPNAME : SCOTT
    ACCOUNTING     EMPNAME : KING
    SALES          EMPNAME : TURNER
    RESEARCH       EMPNAME : ADAMS
    SALES          EMPNAME : JAMES
    RESEARCH       EMPNAME : FORD
    ACCOUNTING     EMPNAME : MILLER
    OPERATIONS     EMPNAME :
    15 rows selected.
    SQL>

  • Invalid identifier results from an sql statement in php

    hello there, i'm trying to access data from an oracle 11g database via oci and php 5.3.8.
    i'm getting the ORA-00904 (invalid identifier) error when executing the following statement:
    $stid = oci_parse($conn, 'select * from table1 where column1 = "XYZ"');
    when i do this:
    $searchstring = "XYZ";
    $stid = oci_parse($conn, 'select * from table1 where column1 = '.$searchstring.'');
    i'm getting this error:
    ORA-00933: SQL command not properly ended
    column1 is varchar2, the entries are either letters and numbers (never only numbers) or empty.
    when i do this:
    $stid = oci_parse($conn, 'select * from table1');
    i'm getting the data and there are entries in column1 with XYZ.
    has anyone an idea, what i do wrong?
    regards j

    The PHP forum for questions like this is at http://www.oracle.com/technetwork/forums/php/index.html
    You really need to be using a bind variable here. Otherwise you will likely suffer from poor DB performance, and also open yourself to SQL Injection security attacks. Try:
    $stid = oci_parse($conn, 'select * from table1 where column1 = :bv');
    oci_bind_by_name($stid, ":bv", $searchstring);Regarding quoting of your example try:
    $searchstring = "XYZ";
    echo  'select * from table1 where column1 = '.$searchstring.'';Then run that SQL in SQL*Plus and watch it fail. What you need is given with:
    echo  'select * from table1 where column1 = \''.$searchstring.'\'';See the bottom of p 126 of The Underground PHP and Oracle Manual
    Note that with the bind variable example you didn't need quotes around :bv.

  • Malformed SQL Join Created in BO XI SP5

    Hi I am receiving the following message when running a specific universe-based Crystal Report:
    Error in File C:\Program Files\Business Objects\BusinessObjects Enterprise 11.5\Data\procSched\hq-erpboprod.reportjobserver\~tmp1e061e138ef0560.rpt: Failed to retrieve data from the database.
    I can see why it is failing to retrieve data from the database - the SQL that the Crystal is generating is not putting the 'AND' in between each clause in the join statement (see below). However, when I build the same query in Designer, I get the correct SQL results.
    SELECT GLPD.GLDGL, GLPGL.GLGLNM, cvtdate(GLPD.GLDEDT), GLPD.GLDJC, GLPD.GLDEDS, sum(GLPD.GLDBA), GLPD.GLDJB, GLPD.GLDCC, GLPD.GLDCN, GLPPJ.GLPJ, DT_ROLLUPLEV.XAFVVC, trim(GLPPJ.GLPJNM), GLPD.GLDBT, GLPD.GLDBE, GLPD.GLDBL FROM GLPD INNER JOIN GLPMF ON (GLPMF.GLMGL= GLPD.GLDGL AND GLPMF.GLMCO=GLPD.GLDCOGLPMF.GLMIC= GLPD.GLDICGLPMF.GLMPJ= GLPD.GLDPJGLPMF.GLMJB= GLPD.GLDJBGLPMF.GLMCC= GLPD.GLDCCGLPMF.GLMCN= GLPD.GLDCNGLPMF.GLMBK=GLPD.GLDBKGLPD.GLDFY=GLPMF.GLMFYGLPD.GLDFFC=GLPMF.GLMFFCGLPMF.GLMFFY=GLPD.GLDFFYGLPD.GLDFC=GLPMF.GLMFC) RIGHT OUTER JOIN GLPGL ON (GLPMF.GLMGL=GLPGL.GLGL) INNER JOIN GLPPJ ON (GLPMF.GLMPJ=GLPPJ.GLPJ) RIGHT OUTER JOIN ( select distinct xafvk1, xafvvc, xafvvd
    from xapfv
    where xafvfl = 'XAPROJECT'
    and xafvff = 'ROLLUPLEV' ) AS DT_ROLLUPLEV ON (GLPPJ.GLPJNV=DT_ROLLUPLEV.XAFVK1) WHERE ( GLPD.GLDBK='ACT' ) AND ( ( ( GLPPJ.GLPJ ) IN {?Query1_Prompt0} ) AND ( ( GLPMF.GLMBK )=('{?Query1_Prompt1}') ) AND GLPGL.GLGL IN {?Query1_Prompt2} AND DT_ROLLUPLEV.XAFVVC IN {?Query1_Prompt3} AND ( GLPD.GLDEDT <= RCVTDATE(( XCVTDATE(DATE(SUBSTRING({?Query1_Prompt4},1,10))) )) AND GLPD.GLDEDT >= RCVTDATE(( XCVTDATE(DATE(SUBSTRING({?Query1_Prompt5},1,10))) )) ) ) GROUP BY GLPD.GLDGL, GLPGL.GLGLNM, cvtdate(GLPD.GLDEDT), GLPD.GLDJC, GLPD.GLDEDS, GLPD.GLDJB, GLPD.GLDCC, GLPD.GLDCN, GLPPJ.GLPJ, DT_ROLLUPLEV.XAFVVC, trim(GLPPJ.GLPJNM), GLPD.GLDBT, GLPD.GLDBE, GLPD.GLDBL
    Has anyone seen anything like this?
    We have recently migrated from BO XI R2 SP2 to BO XI R2 SP5.
    We use SQL Server 2005 SP3.

    This should be set up in steps, Have you configured java AD kerberos so you can login via your web/app with AD? This is a prerequisite before setting up any type of delegation to the DB.
    You can also set up SSO in the front end but this shouldn't be necessarry for delegating to the DB.
    What SPN's do you need...
    Well if using java AD you should have an SPN for the account running the SIA (typically BOBJCentralMS/something) This SPN needs to be set in the CMC, You will need the krb5 and bsclogin files to login to your web/app with kerberos/AD. The krb5.ini will have to have a setting forwardable = true, and finally the MSAS server will need SPN's http://support.microsoft.com/kb/917409
    This a a very complex configuration and you will likely need to open an incident with support to get an engineer to help. I'm not sure where our current docs for the configuration are.
    Regards,
    Tim

Maybe you are looking for

  • Accounting doc number for a material doc

    Hi Experts, Pls help me to know the accouting document number for a material document. Is there any functional module for the above or any table fields. currently we are developing zprogram. Appreciate for advices.

  • Build problem with makepkg of linux in the abs(core/linux)

    Hi,all I wanted to have a taste of systemtap, I read this page:https://wiki.archlinux.org/index.php/Systemtap,and followed the guide,but had problem like this: scripts/link-vmlinux.sh: line 135: ./.config: No such file or directory It looks like the

  • KeyChain Getting On My Nerves

    At first I thought KeyChain would be a great help, but now it is just getting on my nerves. I really do not want to have to enter my KeyChain password just to check for new mail messages, or to auto fill in web passwords. Is there any way to keep Key

  • Dynamics CRM 2013 fetch Query

    Hi All, I have an scenario in CRM we have a entity name visit body. In this table we have multiple questions like Q1,Q2,Q3 and Q1 is related with product p1,p2. and Q2 is related with product p1 and Q3 is related with p1,p2, p3. Query is that when us

  • Photoshop CC help needed urgently

    PLEASE HELP... I have recently joined Creative Cloud and have no problems using and of the applications, except Photoshop. The message – Could not initialize Photoshop the internal file signature is incorrect – appears when I try to open the applicat