Please help me to find the problem in this Query

hi
This is my xml structure,
<?xml version="1.0">
<rss version ="2.0">
<channel>
<Lgs>
<Lg>
     <Fid>16447</Fid>
<Fname>Sam</Fname>
</Lg>
</Lgs>
<Lgs>
<Lg>
     <Fid>206</Fid>
<Fname>David</Fname>
</Lg>
</Lgs>
<Lgs>
</channel>
</rss>
I need to limit the results ie, at a time retrieve only "10" results , also that should be ordered by node "Fid".
I am using PHP-API
and following query is i have used...
$query = "let $hits := (for $hit in collection('gview.dbxml')/rss/channel/Lgs/Lg order by $hit/Fid return $hit) return subsequence($hits, 1, 10)";
$results = $mgr->query($query);
getting the error,
Fatal error: Uncaught exception 'xmlexception' with message 'Error: syntax error, unexpected :=, expecting <end of file> [err:XPST0003], <query>:1:8' in /usr/local/apache/htdocs/add_loc_file.php:99 Stack trace: #0 /usr/local/apache/htdocs/add_loc_file.php(99): xmlmanager->query('let := (for i...') #1 {main} thrown
Message was edited by:
user647571

The "$hits" in your string is being interpreted by PHP as a variable reference and substituted out before DB XML gets the query.
John

Similar Messages

  • Please help me in finding the solution for this query

    Hi Experts,
    How could i print column name's second word in next line
    suppose am taking ename alias as "employee name"
    i want to print the second word "name" in next line
    like
    "Employee
    Name"
    Whats the way of writing this query
    Please help me out
    Thanks in Advance

    Hi,
    914618 wrote:
    WITH mydata AS
    SELECT 1 emp_id, 'John Smith' emp_name FROM DUAL UNION ALL
    SELECT 2 emp_id, 'Steve Jobs' emp_name FROM DUAL UNION ALL
    SELECT 3 emp_id, 'Larry Allison' emp_name FROM DUAL
    SELECT emp_id, emp_name
    FROM mydata;
    after executing the above query the o/p I am getting is in the normal format like EMP_ID and EMP_NAME
    not according to my requirement like
    Emp Emp
    Id NameWhat are the results you reaally want? Do you want this?
    `   EMP_ID SPLIT_NAME
             1 John
               Smith
             2 Steve
               Jobs
             3 Larry
               AllisonIf so:
    SELECT  emp_id
    ,      REPLACE (emp_name, ' ', CHR (10))     AS split_name
    FROM      mydata
    ;The results above are 3 rows, not 6.
    What results would you want if emp_name contained 3 or more words? For example, if you add this to the sample data:
    SELECT 9 emp_id, 'Aung San Suu Kyi' emp_name FROM DUAL UNION ALL

  • Can you please help me to improve the performence of this query

    Select All Invoices cleared between date range
      SELECT bsak~prctr AS prfcntco
        cepct~ktext AS prfcnttx
        bsak~lifnr AS vendcode
        lfa1~name1 AS vendname
        bsak~bukrs AS compcode
        t001~butxt AS compname
        bsak~zterm AS paytrmco
        tvzbt~vtext AS paytrmna
        bsak~waers AS invcurre
        bsak~zbd1t AS paydays1
        bsak~belnr AS invnumbe
        bsak~buzei AS invlinnu
        bsak~wrbtr AS invamoun
        bsak~budat AS invpstda
        bsak~zfbdt AS invdueda
        bsak~augdt AS invpayda
        bsak~gjahr AS invfiscy
        bsak~zlspr AS zlspr
        t001~land1 AS land1
        bsak~projk AS contract
        rbkp~xblnr AS invsupnu
        rbkp~bldat AS creadate
        rbkp~cpudt AS cpudt
      INTO CORRESPONDING FIELDS OF TABLE list_aux
      FROM ( ( ( ( ( bsak INNER JOIN rbkp ON bsakbelnr = rbkpbelnr )
                     LEFT OUTER JOIN t001 ON bsakbukrs = t001bukrs )
                     LEFT OUTER JOIN lfa1 ON bsaklifnr = lfa1lifnr )
                     LEFT OUTER JOIN cepct ON bsakprctr = cepctprctr
                                          AND cepct~spras = sy-langu )
                     LEFT OUTER JOIN tvzbt ON bsakzterm = tvzbtzterm
                                          AND tvzbt~spras = sy-langu )
      WHERE bsak~bukrs IN company AND
            bsak~lifnr IN vendor AND
            bsak~zterm IN payterm AND
            bsak~augdt IN daterang AND
            bsak~projk IN contract.
      SELECT * FROM   rseg
               INTO   TABLE it_rseg
               FOR ALL ENTRIES IN list_aux
               WHERE  belnr = list_aux-invnumbe
               AND    buzei = list_aux-invlinnu
               AND    gjahr = list_aux-invfiscy.
      SORT it_rseg BY belnr buzei gjahr ASCENDING.

    Moderator message - Welcome to SCN
    Please see Please Read before Posting in the Performance and Tuning Forum before posting in this forum. there are some things you need to take care of first. - post locked
    Please read [Rules of Engagement|https://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement], How to post code in SCN, and some things NOT to do... and [Asking Good Questions in the Forums to get Good Answers|/people/rob.burbank/blog/2010/05/12/asking-good-questions-in-the-forums-to-get-good-answers] before posting again.
    Rob

  • TS1424 Hy. Please help me. what's the problem? when i accessing icloud or find my friend app: The maximum number of free accounts have been activated on this iPhone.

    Hy. please help me. what's the problem? when i accessing icloud or find my friend:The maximum number of free accounts have been activated on this iPhone.

    Then you'll have to use another iOS device or Mac running OS X Lion or higher to create a new account for you to use on your phone.  If you don't have one, perhaps a friend would allow you to create and account on their device (note: this will use one of their three maximum accounts).  To do this, they would need to go to Settings>iCloud, tap Delete Account (which will delete the account from their device but not from iCloud), then allow you to sign back in with your ID to create the new account.  Then tap Delete Account to delete the new account from their device, and finally, sign back in with their iCloud ID to restore their iCloud account to their device.  Then you can sign in with your ID on your phone in Settings>iCloud and use the new account.

  • PLEASE HELP ME TO FIND THE SOLUTION REGARDING "LOGICAL SYSTEM CHANGED"

    HAI EVERYBODY,
    PLEASE HELP ME TO FIND THE SOLUTION REGARDING "LOGICAL SYSTEM CHANGED" during the material master replication by using middleware parameters.
    step1 : i have taken SRM client 810 and named it as CHINNISRM
    step2 : i  have taken r3 client 810 and named it as CHINNIR3
    step3: During material master replication i maintained tables like crmconsum,crmrfcpar,crmparoltp in   r3   and smofparsfa in srm client and filtered the objects and loaded the objects through r3ac3,r3ac1,r3as.
    step4 : And later i have checked in r3 queues to activate the objects,but i have seen a message like  "LOGICAL SYSTEM CHANGED:SEE 588701".according to the oss instructions i have checked in CRMPRLS table in se16 in R3 .there i found out there is one logical client  named with T90CLNT810.
    oss :588701
    Solution
    There are different cases in which different forms of processing are
    required or where several options exist:
    - The logical system name of an R/3 Backend client was changed in
    current operation. In this case, the data hangs in the outbound
    queues of the R/3 Backend system as specified under point 1 of
    the symptom. In this case, the logical system name must be
    changed back to the original value. Then the outbound queues
    can be reactivated. If no data was transferred to the EBP/CRM
    server before the change, also a correctioin of the check table
    is possible.
    - The same logical system name was used again in a new client of
    an R/3 Backend system that was linked to the EBP/CRM server. In
    this case, the data is in the inbound queue of the EBP/CRM
    server with the exception GUID_FOR_LOGSYS_CHANGED. In this
    case, the queue entries which have status SYSFAIL must be rejected, however, not the entire queues. If the new client of  the R/3 Backend system you have linked has exactly the same
    data as the old client and if it is meant to replace the old
    client (that is, this was deactivated), also a correction of
    the check tables is possible. In this case, the inbound queues
    can be reactivated after the correction.
    oss:765018
    1. If the situation in your system corresponds to the situation described
    under "Reason and Prerequisites" and if symptom 1 occurs, you can
    delete the table entry from table CRMPRLS table (there is just one
    entry). Since there is no maintenance dialog for this table and you
    cannot maintain it using transaction SE16, you must use a report to
    delete it. This report is attached to this note as correction
    instructions.
    Create the report ZZ_DELETE_CRMPRLS in your system and copy the source
    code from the correction instructions. You cannot implement this
    source code using transaction SNOTE.
    You can use the report in every plug-in or plug-in basis system, even
    if it is not specified in the validity section.
    After you have run the report, you can trigger existing queues again
    in transaction SMQ1.
    2. If the situation in your system corresponds to the situation described
    under "Reason and prerequisite" and if symptom 2 occurs, you can
    delete the entry from table CRMMLSGUID (there is just one entry).
    Since there is no maintenance entry for this table and you cannot
    maintain it using transaction SE16, you must use a report to delete
    it. This report is attached to this note as correction instructions.
    If they do not yet exist, add the following messages to message class SMOF in your logon language:
    Message Message short text
    303 User &1 is not allowed to change table &2.
    304 User &1 IS not allowed to display table &2.
    305 Logical system &1 was not found in table &2.
    306 System error! The current client was not
    found in table T000.
    Create the report ZZ_DELETE_CRMMLSGUID in your system and copy the
    source code from the correction instructions. You cannot implement
    this source code using transaction SNOTE.
    You can use the report for every release of the CRM system, even if it
    is not specified in the validity section. The only exceptions are CRM
    releases with Support Package versions that are too low such as CRM
    Release 3.0 with Support Package 12.
    After you have run the report, you can trigger existing queues again
    in transaction SMQ1 of the R/3 back-end system or transaction SMQ2 of
    the CRM system.
    so what should i do to do the replication.please suggest me .untill and unless i solve my problem i cant move to the further activity.i hope you people can solve my problem.thanks in advance.
    thanks and best regards,
    n.chakradhar

    Hi chakradhar,
    Did you find a solution to your issue? We are facing a similar issue and looking to figure out how this can be resolved.
    BR// 420

  • Need driver for canon mg 5250 as scanner is not working with version 10.7. Can you please help me to find the driver so scanner works with WIFI?

    need driver for canon mg 5250 as scanner is not working with version 10.7. Lion. Can you please help me to find the driver so scanner works with WIFI?

    Try with the latest Apple driver package for Canon (released 15th Feb):
    http://support.apple.com/kb/DL899
    This solved my problem with the printing.

  • Suddenly on sunday while i was working, my macbook Air stopped working, right after that i tried getting it on but nothing came other than a grey screen with a question mark right in the center could you please help me in rectifying the problem. Would th

    Suddenly on Sunday while i was working, my macbook Air which i bought last year in Spetember from Arkansas, Little Rock stopped working, right after that i tried getting it on but nothing came other than a grey screen with a question mark right in the center. Could someone please help me in rectifying the problem. Would thi issue also affect saved data. However, I have handed the notebook to Apple for reapirs and they will revert by Thursday 12/04/2012.

    I just received some horrifying news from Adobe about my production suite.  I just FINALLY learned today that what I've been trying to do for over a week now - CAN'T be done because of compatability issues involving updates of both Adobe & Microsucks Winders!!!  I sincerely hope this is not your problem.  Mine is ALMOST HOPELESS!!  Being in this HOPELESS Obamma economy,,,, leaves NO STIMULUS in which to currently upgrade everything that needs upgraded for me to fully use my INVESTMENT in Adobe Suite - sad, horrible and SICKENING!!!
    I just wanted to post this. And again, I truly hope you find a solution. Good Luck!

  • My mobile phone is lost, please help me to find the serial number is: DNQKDBS8F8H4, my name is Yu Fan, thank you very much for this is my number: 15052995201

    My mobile phone is lost, please help me to find the serial number is: DNQKDBS8F8H4, my name is Yu Fan, thank you very much for this is my number: 15052995201

    We're not Apple here.  We're users.  We cannot locate your phone any more than you could locate ours.
    If you did not have find my phone activated on your device, there's no way to track it.

  • Please help me to find the table for fields where the descriptions are give

    please help me to find the table for fields where the descriptions are given below
    Customer Support Administrator
    first line Support indicator

    You could also try table DD01T. In se 16,put in the description thats needed,you will get to know the respective data elements.
    Then you can use DD03L to find the respective table. This would work if the data element is not generic.
    Regards,
    Anubhav.

  • Please help me to find the sample code and schema for GetDBDateTime.zip fil

    Please help me to find the GetDBDateTime.zip and Guest_Book.zip files.
    Tks!

    Does this Help?
    http://www.oracle.com/technology/sample_code/products/ias/files/psp/GetDBDateTime/Readme.html
    Did you install Oracle9iAS ?

  • My iphone 5 screen is turning grey I dnt knw wht causes that and how to fix it.Others said my Lcd is finished others said its a virus..Please help wht might be the cause of this.

    My iphone 5 screen is turning grey I dnt knw wht causes that and how to fix it.Others said my Lcd is finished others said its a virus..Please help wht might be the cause of this.

    Take it in for testing.
    Barry

  • HT1918 I would like to change my Visa card from the account but its not changing and the billing information is not changing and I can't purchase any thing from my account its now not usable please help me to solve the problem

    I would like to change my Visa card from the account but its not changing and the billing information is not changing and I can't purchase any thing from my account its now not usable please help me to solve the problem

    You made a purchase and exhausted the credit on your card before it processed. All purchases are final. Contact iTunes Store support. You need to settle up before you can purchase or download anything else.

  • Please help me to solve the issue in my query.

    Hi All,
    Please help me to understand the mistake what i did in below query and help to resolve that.
    Actually i am trying to create a query to filter the records from db based on my input parameter.
       If my input parameter is 1(@showallrecords) then i need to show all the records which has the IsLatest as 1
       If my input parameter is 0(@showallrecords) then i need to show all the records which has the IsLatest as 0
    select * from tabel1 INNER JOIN tabel2    
    ON tabel1.KeyId = tabel2.KeyId 
    and (@showallrecords = 1 and tabel1.IsLatest = 1 )
    and (@showallrecords = 0 and tabel1.IsLatest = 0 )
    when i am executing the above query with the parameter @showallrecords = 1 ,db is returning 0 rows.If i am executing the above query after removed the last line and (@showallrecords = 0 and tabel1.IsLatest = 0 ) then records are coming.
    i understand that 1=0(last line) and the condition is not true.So its affecting the result.
    Please help me to solve this.

    select * from tabel1 INNER JOIN tabel2
    ON tabel1.KeyId = tabel2.KeyId
    WHERE (tabel1.IsLatest = @showallrecords Or @showallrecords=0)

  • Please tell me what is the problem with this code

    Hai,
    Iam new to Swings. can any one tell what is the problem with this code. I cant see those controls on the frame. please give me the suggestions.
    I got the frame ,but the controls are not.
    this is the code:
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class ex2 extends JFrame
    JButton b1;
    JLabel l1,l2;
    JPanel p1,p2;
    JTextField tf1;
    JPasswordField tf2;
    public ex2()
    setDefaultCloseOperation(EXIT_ON_CLOSE);
    setTitle("Another example");
    setSize(500,500);
    setVisible(true);
    b1=new JButton(" ok ");
    p1=new JPanel();
    p1.setLayout(new GridLayout(2,2));
    p2=new JPanel();
    p2.setLayout(new BorderLayout());
    l1=new JLabel("Name :");
    l2=new JLabel("Password:");
    tf1=new JTextField(15);
    tf2=new JPasswordField(15);
    Container con=getContentPane();
    con.add(p1);
    con.add(p2);
    public static void createAndShowGUI()
    ex2.setDefaultLookAndFeelDecorated(true);
    public static void main(String ar[])
    createAndShowGUI();
    new ex2();
    }

    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class ex2 extends JFrame
        JButton b1;
        JLabel l1,l2;
        JPanel p1,p2;
        JTextField tf1;
        JPasswordField tf2;
        public ex2()
            setDefaultCloseOperation(EXIT_ON_CLOSE);
            setTitle("Another example");
            b1=new JButton(" ok ");
            p1=new JPanel();
            p1.add(b1);
            p2=new JPanel();
            p2.setLayout(new GridLayout(2,2));
            l1=new JLabel("Name :");
            l2=new JLabel("Password:");
            tf1=new JTextField(15);
            tf2=new JPasswordField(15);
            p2.add(l1);
            p2.add(tf1);
            p2.add(l2);
            p2.add(tf2);
            Container con=getContentPane();
            con.add(p1, BorderLayout.NORTH);
            con.add(p2, BorderLayout.CENTER);
            pack();
            setVisible(true);
        public static void createAndShowGUI()
            ex2.setDefaultLookAndFeelDecorated(true);
        public static void main(String ar[])
            createAndShowGUI();
            new ex2();
    }

  • HT1338 How to get rid of Apple Support Community notices, my box is full I receive thousand a day and I really cannot handle it.  Please help, I cannot find the notification tad in my "preferences"  I have Mac OS X 10.7.5.  Please help it is urgent

    How to get rid of Apple Support Community notices?  my box is full as I receive thousand of messages a day.  I cannot handle it anymore, please it is urgent.  Help!  I have Mac OS X 10.7.5 and unable to find the "notification tab" in my "preferences"  I need a image if possible to better understand.  Thanks a lot.

    Thank you, but I just  tried everything you said, my apple id account (icloud) continues and still is receiving the email from ASC each second.  My i phone and macpro (i cloud account) is full of messages that I have difficult to erase at once.  I have to do it one by one which can take me the whole day.  How can i unsucribe from ASC, just get ride of my account, I mean cancel the ASC account, so I will not get any messages.  Please help.  Thanks.

Maybe you are looking for