Group data model does not

Hello

I am developing a revision update for my app BB10 stunts and I use a data model to pull in the elements of the application do not forget; the only problem I encounter is that I can't get the data model of the group work so that I can arrange the items by the first character instead the data are currently presented as Z - A, even if I could get it to display in A - Z would be enough, but what I am looking to achieve is to get the model to display in A - Z and then sort by the first character, while a header for each letter is displayed.

Here is the list (QML) and my data model (C++)

ListView {
                            dataModel: _noteBook.model

                            listItemComponents: ListItemComponent {
                                type: "item"

                                StandardListItem {
                                    title: ListItemData.title
                                    description: ListItemData.status
                                }
                            }

                            onTriggered: {
                                clearSelection()
                                select(indexPath)

                                _noteBook.setCurrentNote(indexPath)

                                _noteBook.viewNote();
                                navigationPane.push(noteViewer.createObject())
                            }
                        }

NoteBook.cpp

#include "NoteBook.hpp"

#include "NoteEditor.hpp"
#include "NoteViewer.hpp"

#include 

using namespace bb::cascades;
using namespace bb::pim::notebook;

//! [0]
NoteBook::NoteBook(QObject *parent)
    : QObject(parent)
    , m_notebookService(new NotebookService(this))
    , m_model(new GroupDataModel(this))
    , m_noteViewer(new NoteViewer(m_notebookService, this))
    , m_noteEditor(new NoteEditor(m_notebookService, this))
{
    // First Character grouping in data model
    m_model->setGrouping(ItemGrouping::FirstChar);

    // Ensure to invoke the filterNotes() method whenever a note has been added, changed or removed
    bool ok = connect(m_notebookService, SIGNAL(notebookEntriesAdded(QList)), SLOT(filterNotes()));
    Q_ASSERT(ok);
    ok = connect(m_notebookService, SIGNAL(notebookEntriesUpdated(QList)), SLOT(filterNotes()));
    Q_ASSERT(ok);
    ok = connect(m_notebookService, SIGNAL(notebookEntriesDeleted(QList)), SLOT(filterNotes()));
    Q_ASSERT(ok);

    // Fill the data model with notes initially
    filterNotes();
}
//! [0]

//! [1]
void NoteBook::setCurrentNote(const QVariantList &indexPath)
{
    // Extract the ID of the selected note from the model
    if (indexPath.isEmpty()) {
        m_currentNoteId = NotebookEntryId();
    } else {
        const QVariantMap entry = m_model->data(indexPath).toMap();
        m_currentNoteId = entry.value("noteId").value();
    }
}
//! [1]

//! [2]
void NoteBook::createNote()
{
    // Prepare the note editor for creating a new note
    m_noteEditor->reset();
    m_noteEditor->setMode(NoteEditor::CreateMode);
}
//! [2]

//! [3]
void NoteBook::editNote()
{
    // Prepare the note editor for editing the current note
    m_noteEditor->loadNote(m_currentNoteId);
    m_noteEditor->setMode(NoteEditor::EditMode);
}
//! [3]

//! [4]
void NoteBook::viewNote()
{
    // Prepare the note viewer for displaying the current note
    m_noteViewer->setNoteId(m_currentNoteId);
}
//! [4]

//! [5]
void NoteBook::deleteNote()
{
    m_notebookService->deleteNotebookEntry(m_currentNoteId);
}
//! [5]

bb::cascades::GroupDataModel* NoteBook::model() const
{
    return m_model;
}

QString NoteBook::filter() const
{
    return m_filter;
}

//! [6]
void NoteBook::setFilter(const QString &filter)
{
    if (m_filter == filter)
        return;

    m_filter = filter;
    emit filterChanged();

    // Update the model now that the filter criterion has changed
    filterNotes();
}
//! [6]

NoteViewer* NoteBook::noteViewer() const
{
    return m_noteViewer;
}

NoteEditor* NoteBook::noteEditor() const
{
    return m_noteEditor;
}

//! [7]
void NoteBook::filterNotes()
{
    NotebookEntryFilter filter;

    // Use the entered filter string as search string
    filter.setSearchString(m_filter);

    const QList notes = m_notebookService->notebookEntries(filter);

    // Clear the old note information from the model
    m_model->clear();

    // Iterate over the list of notes
    foreach (const NotebookEntry ¬e, notes) {
        // Copy the data into a model entry
        QVariantMap entry;
        entry["noteId"] = QVariant::fromValue(note.id());
        entry["title"] = note.title();
        entry["status"] = NoteViewer::statusToString(note.status());

        // Add the entry to the model
        m_model->insert(entry);
    }
}
//! [7]

NoteBook.hpp

/* Copyright (c) 2012, 2013  BlackBerry Limited.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#ifndef NOTEBOOK_HPP
#define NOTEBOOK_HPP

#include 
#include 
#include 

#include 

class NoteEditor;
class NoteViewer;

/**
 * @short The controller class that makes access to notes available to the UI.
 */
//! [0]
class NoteBook : public QObject
{
    Q_OBJECT

    // The model that provides the filtered list of notes
    Q_PROPERTY(bb::cascades::GroupDataModel *model READ model CONSTANT);

    // The pattern to filter the list of notes
    Q_PROPERTY(QString filter READ filter WRITE setFilter NOTIFY filterChanged);

    // The viewer object for the current note
    Q_PROPERTY(NoteViewer* noteViewer READ noteViewer CONSTANT);

    // The editor object for the current note
    Q_PROPERTY(NoteEditor* noteEditor READ noteEditor CONSTANT);

public:
    NoteBook(QObject *parent = 0);

public Q_SLOTS:
    /**
     * Marks the note with the given @p indexPath as current.
     */
    void setCurrentNote(const QVariantList &indexPath);

    /**
     * Prepares the note editor to create a new note.
     */
    void createNote();

    /**
     * Prepares the note editor to edit the current note.
     */
    void editNote();

    /**
     * Prepares the note viewer to display the current note.
     */
    void viewNote();

    /**
     * Deletes the current note.
     */
    void deleteNote();

Q_SIGNALS:
    // The change notification signal for the property
    void filterChanged();

private Q_SLOTS:
    // Filters the notes in the model according to the filter property
    void filterNotes();

private:
    // The accessor methods of the properties
    bb::cascades::GroupDataModel* model() const;
    QString filter() const;
    void setFilter(const QString &filter);
    NoteViewer* noteViewer() const;
    NoteEditor* noteEditor() const;

    // The central object to access the notebook service
    bb::pim::notebook::NotebookService* m_notebookService;

    // The property values
    bb::cascades::GroupDataModel* m_model;
    QString m_filter;

    // The controller object for viewing a note
    NoteViewer* m_noteViewer;

    // The controller object for editing a note
    NoteEditor* m_noteEditor;

    // The ID of the current note
    bb::pim::notebook::NotebookEntryId m_currentNoteId;
};
//! [0]

#endif

If something you can help me with then this would be very useful - if you need to see more of code then let me know too!

Thanks in advance

Try to add in constructor (after a call to setGrouping):

QStringList keys;
key<>
m_model-> setSortingKeys (keys);

May require alterations, I have not tried this compilation.

Tags: BlackBerry Developers

Similar Questions

  • How can I Data Modeler does not generate constraints on NNC_ tables?

    Hi all

    Unfortunately I have not found the answer using Google ;-)

    When I generate my DDL scripts on my model on some tables Data Modeler (version 4.0.0) automatically generates constraints on the columns of the table "NNC_" for example:

    CREATE TABLE STG_DURCHGANGSKNOTEN

    (

    ID NUMBER CONSTRAINT NNC_STG_DURCHGANGSKNOTENv1_ID NOT NULL,

    Kilometrierung VARCHAR2 (20) CONSTRAINT NNC_STG_DURCHGANGSKNOTENv1_Kilometrierung NOT NULL,

    Letzte_Aenderung DATE CONSTRAINT NNC_STG_DURCHGANGSKNOTENv1_Letzte_Aenderung NOT NULL,

    Knotentyp VARCHAR2 (100) CONSTRAINT NNC_STG_DURCHGANGSKNOTENv1_Knotentyp NOT NULL,

    Name VARCHAR2 (100),

    BZ_Bezeichner VARCHAR2 (100),

    GUI_Bezeichner VARCHAR2 (100),

    Spurplanabschnitt_ID NUMBER NNC_STG_DURCHGANGSKNOTENv1_Spurplanabschnitt_ID CONSTRAINT NOT NULL,.

    XML_Document XMLTYPE

    );

    How can I avoid this? I like to just get something like this:

    CREATE TABLE STG_DURCHGANGSKNOTEN

    (

    IDENTIFICATION NUMBER NOT NULL,

    Kilometrierung VARCHAR2 (20) NOT NULL,

    Letzte_Aenderung DATE NOT NULL,

    Knotentyp VARCHAR2 (100) NOT NULL,

    Name VARCHAR2 (100),

    BZ_Bezeichner VARCHAR2 (100),

    GUI_Bezeichner VARCHAR2 (100),

    Spurplanabschnitt_ID NUMBER NOT NULL,

    XML_Document XMLTYPE

    );

    Thank you

    Matthias

    Hi Matthias,

    The NOT NULL Constraint clause appears likely because 'Not Null Constraint Name' property is set to the column.  (It is indicated on the Panel "forced by default and ' in the column properties dialog box.)

    To stop these products, you can go to the Data Modeler/DOF of the preferences page (on the Tools menu) and set the option 'generate short form of NO forced NULL.

    Note that there now is a forum specifically for the Data Modeler: SQL Developer Data Modeler

    David

  • Data Modeler does not connect to SQL Server database

    I click connect on New / select connection to the base and nothing happens.  No connection is added to the list of connection in the Import Wizard dialog box (file-> import-> Oracle Designer model) so I can't go forward with the wizard and I can't connect to my SQL Server DB.

    The connection works very well according to the test and to connect buttons on the New / select connection to the base dialogue.  Initially, there was errors, reported originally by Test and Connect, but those that have been resolved with minor changes to the URL JDBC and CLASSPATH for jtds.

    Is there a Data Modeler error log which could give an overview of what's going on?  Everyone knows this?

    SQL Server 2008

    JTDS 1.3.1 and 1.2.8

    Data Modeler 4.0.0.825

    Thank you.

    Hello

    No connection is added to the list of connection in the dialog box Import Wizard (file-> import-> Oracle Designer model)

    This path is for the import of the Oracle Designer repository that resides on the Oracle database as well as the Oracle connections are listed here.

    You must use "file > import > data dictionary.

    Philippe

  • the windows boot configuration data file does not contain a valid entry os

    Hello

    I got this message when recovery... I can't get the windows... I have the CD recovery, but when I boot it... It gives me this message

    the windows boot configuration data file does not contain a valid entry os

     


    How do I solve this problem

    Hello

    Assuming that it's just a problem with the recovery media, here's another solution, you can try.

    Before you try the following, make sure that you can always read the character product activation key 25 on your label Windows COA (5 blocks of 5 alphanumeric games).

    An example of a COA label can be seen here.

    You can create a Windows 7 installation disc yourself using another PC - just download the good Disk Image ( it must be the same version that originally shipped with your laptop - IE if your laptop comes with Windows 7 Home Premium, that is the file you need to download ) from the link below and use an app like ImgBurn to burn the ISO correctly file on a blank DVD - a guide on the use of ImgBurn to write an ISO on a disc is here.  The source of the Image is - Digital River.

    Images of Windows 7.

    Use the disk to perform the installation, enter the activation key of Windows on the label of the COA at the request and once the installation is complete, use ' 'phone Method' described in detail in the link below to activate the operating system -this made method supported by Microsoft and is popular with people who want to just have a new installation of Windows 7 without additional software load normally comes with OEM installations.

    http://www.kodyaz.com/articles/how-to-activate-Windows-7-by-phone.aspx

    All pilots additional and the software you may need are located by entering your full model number or Nr here.

    Kind regards

    DP - K

  • Hello, I'am getting a little crazy because Group/scrolling text does not. I looked at several videos of Adobe evangelists now to make a scrolling text or group.  I ' am in collaboration with InDesign CC and it looks like my 'Overlay tools' do not work.  W

    Hello, I'am getting a little crazy because Group/scrolling text does not. I looked at several videos of Adobe evangelists now to make a scrolling text or group.  I ' am in collaboration with InDesign CC and it looks like my 'Overlay tools' do not work.  When I see the preview, I can't scroll but only to select text. My steps are simple: I put my text in a selected area. PLACE IN > that select > Folio overlays > floating framework. It does not scroll. What I've done wrong?

    Schermafbeelding 2016-02-14 om 14.57.41.pngSchermafbeelding 2016-02-14 om 14.56.38.png

    DAT danced some overlays avenues (!) reviews Regolamento zijn voor DPS books, due noch het SWF-noch het ePUB-voorvertoningsvenster laten zien said. Het due zal ook niet werken in bv. en PDF een in een ePUB avenues in FXL - epub puts extra een saw CSS code. DHS avenues from DPS DPS 2015 (article) maar voorvertonen zal het niet anyway (folio).

    Werk I niet met DPS (peper, peperduur!) vergeet dan het hele Overlay window DHS.

  • Yosemite user model does not

    I have 20 macs in a University laboratory image in the same way, with a user model that I created.  Worked fine for several months.  Lately, the chances that my user model does not load correctly is 50-50.  This takes the form of:

    • the loading dock is generic and does not include my shortlisted apps
    • wallpaper is the default 'Yosemite' image and not the wallpaper that I created
    • or, the mounted drives are not displayed on the desktop.

    Pictured above, the bottom image is what I call a wrong profile.  It is in this profile, you can see that the dock, HDD and wallpaper are not loaded; However, things like the Finder and Safari open to the correct location, based on a template.

    I can log in and out of the same machine all day and arrive at a 30 to 50% chance of the model charge properly.  However, I need this number to 99.9%

    Our laboratory is partially controlled by JAMF/Casper to load scripts at startup.   These logon scripts in the form of:

    • load the customer print PHAROS
    • load a "alert of emergency of the University" application in the dock
    • If the user has a folder on our server, xsan, Casper Mont scripts this folder on the desktop (this feature works on our Mavericks stations, but is broken in Yosemite).

    What process occurs when a user connects and the model is pulled?  Is it possible that Casper connect you scripts could be in conflict with the creation of models of the user?

    Solution: The question is a folder called Non_localized, reflect the English.lproj content with this file in template/User.

  • Why do write can not be performed because the number of data channels does not match number of channels in the task.

    Possible reasons:

    Scripture cannot be performed because the number of data channels does not match number of channels in the task.

    When writing, provide data for all channels in the task. You can also change the task so that it contains the same number of channels as the written data.

    Number of job channels: 8
    Number of data channels: 1

    Lama says:

    The DAQmx vi writing gives me the error. If I run a single channel, isn't a problem. Multichannel gives me error.

    You are funny! Why tie yourself to work VI (single channel) instead of one that gives you errors (multichannel)?

    (If your car does not work, you bring car your wives to the mechanic, right!)

    What is the exact text in the multichannel 'physical channels' when you do the AO control?

    Lama says:

    I did a sequence to ensure that each function has been run in the correct order. Wouldn't a race condition.

    All you have to do is wire the 'start of task' error at the entrance of error of the DAQ assistant and then back to 'stop task' and things will run in order. Guaranteed! Think the stream! Everything else can run in parallel or the order is irrelevant.

    First convert the sequence stacked to a sequence of plate, remove the flat sequence and add the mentioned son. Now, do a "cleaning pattern.

    A when stacked with the inhabitants of the sequence is one of the worst construction you can possibly do. It makes the code difficult to follow, impossible to maintain, difficult to debug.

  • Having hard time you sign in to one account on my computer. "The group policy service does not have log on." Access denied. "

    Trying to connect to one of the accounts on my computer and the message telling me "the group policy service does not have the journal on.»  Access denied. "  Can someone help me with this?

    Hello

    1. is the computer connected to a network domain?

    2 are you facing this problem into account administrator? Do you have other administrator accounts enabled in the computer?

    3 did you changes to the computer before the show?

     
     
    Method 1:

    Check if you are able to start the computer in safe mode.
     
    Step 1: Safe Mode

    Start your computer in safe mode and check the number.

    To start your computer in safe mode

    http://Windows.Microsoft.com/en-us/Windows-Vista/start-your-computer-in-safe-mode

     
    If you are unable to boot into safe mode, please let us know.

    Step 2:

    You run the system restore in Windows recovery environment?

    If this isn't the case, I would say you can do a system restore to the Windows recovery environment. Follow the steps in the section provided.

    http://support.Microsoft.com/kb/940765/en-us


     
    I hope this helps!
  • How can I correct a problem accessing my firewall settings because the Group Policy client does not connect to windows?

    I have tried everything recently adjust the settings of the firewall from my window and a box appears saying that after an unidentified error, I can't access my firewall. After some research, I discovered that it was because my client group policy server does not connect and a small box appears saying that whenever I connect to my laptop. It is not effect my use of the internet at all, so I've never bothered to see what that meant until now I need to access my firewall. I tried to adjust the settings in group policy, but everything is gray and I can't change anything. I use an admin account so I don't know why I can't set the parameters. I'm completely stuck and I don't know that much about computers. Is there anything else I can try? I also tried a system restore, but it lasts for a long time and I can return only 5 days. Thank you

    Hi Sheldon,

    Are you connected or connected to a work network or domain? If so, this could be a policy governed by your network administrator, and you will not be able to change it.
    You might try to tell scientists on TechNet on your question to see if they have a better answer for you:
  • Found "Save as model" grayed out and cannot save. Recorded with .dwt but saved them "model" does not present as a "site template. Can anyone help? Thank you.

    Found "Save as model" grayed out and cannot save. Recorded with .dwt but saved them "model" does not present as a "site template. Can anyone help? Thank you

    I found the problem. I opened 'File' then saw 'save as template' grayed. Having not worked with models, I didn't know this isn't how it's done.

    What I should have done was file > save as > then clicked the drop-down 'Save as template' menu option. It was a simple mistake. Thanks to you all.

  • synchronize data dictionary with the model does not generate the DDL

    Hello

    I followed the instruction from the link below

    Re-engineering of your database by using the Data Modeler 3.1

    Here's what I did.

    1. the tables imported using import-> MS SQL 2012 data dictionary (used jDTS 1.3.1)

    2. Add new column to one of the imported tables of the Data Modeler

    3. click on synchronize data dictionary button

    4. compare the contextual model poster! indicating there is gap, but the DOF Preview button is disabled.

    Would you advise me what I got wrong?

    Best,

    Yong

    MODIFY the script is only supported for Oracle databases.

  • Smartphones blackBerry 9900 data Plan does not work!

    Hi, new here, great site!

    I'm from Canada, with Koodo and bought a unlocked 9900 opportunity, my neighbor via a Classifieds site, and as much as I know it was his business phone.
    I wiped it it clean and improved the operating system to 7.01

    I noticed that the previous service logo remains still (Rogers) during boot-up/shutdown, hmm, OK whatever he is working with Koodo.

    I called Koodo to allow data, but nothing works. I called them and they told me to enter "bb.koodo.com" in the APN field with no username and password. Then to save the host Routing Table (he told me that he registered very well) but I did not receive a message. Also, we have removed battery and tried everything again. It still does not.

    It is H + at the top right of the screen, but who has always been there.

    She said that maybe the phone was restriction IP since I bought it used, and maybe BB Swiss Army tool could help me get off, but she didn't know how. So I downloaded and pushed some buttons (more precisely remove COD) and really messed up my phone... lol

    Just reinstalled OS7.01 once again and fortunately had a fairly recent backup.

    Suggestions for making data work, or do I need a new phone?

    Hello and welcome to the community!

    Serious9900 wrote:

    bought an unlocked 9900 used my neighbor via a Classifieds site, and AFAIK it was his business phone.

    Let's start there, because who can be tricky depending on what exactly is meant by "business phone". Reference:

    • Article ID: KB05099 Steps to take before selling or after the purchase of a used BlackBerry smartphone

    Many of the steps can only be carried out by the seller... for example, if the prior carrier still has a BIS account allocated to that specific device, so no other carrier will be able to create a BIS account for her, and a BIS account is required to use wisely. As a general rule, a carrier will come out only the BB from the account when the real account holder made the request... and you will not if this situation applies.

    In addition, if the device has been activated BES, you need to follow additional steps. Reference:

    • Article ID: KB30076 How to check for an it on a BlackBerry smartphone policy

    If there is an IT strategy, then there are a special method, you need to remove it, but it will be successful if the BES server, to which the device has been set already has the removed feature of it... you may need to ask the previous owner about it. If this BES server was deleted, you can use this method to clean up the it policy:

    • Article ID: KB31291 How to reset a BlackBerry smartphone to factory using BlackBerry Desktop Software Settings

    It is necessary to use this exact method... refer:

    • Article ID: KB16307 Actions performed by the BlackBerry smartphone during the removal of the user stored and application data

    Now, with all these preliminaries of the road...

    Serious9900 wrote:

    I noticed that the previous service logo remains still (Rogers) during boot-up/shutdown, hmm, OK whatever he is working with Koodo.

    As you guessed, it's irrelevant. BBs are still originally designed for a specific carrier... and some of these contractual carriers with BB to place a splash screen of starting the device ROM, that can never be changed. But, it does nothing other that that unit was built for this carrier... but as long as all other things correctly, it is not serious at all.

    But, to be clear, when you say "it works on Koodo", I guess that's your voice services? And are all now, you must operate your data services? If telephone services do not work correctly on Koodo, then it is useless trying to get data services going.

    Serious9900 wrote:

    I called Koodo to allow data, but nothing works. I called them and they told me to enter "bb.koodo.com" in the APN field with no username and password. Then to save the host Routing Table (he told me that he registered very well) but I did not receive a message. Also, we have removed battery and tried everything again. It still does not.

    But now say you "nothing works"... should I continue to assume this are information specific to the data, and that telephone services continue to operate properly on Koodo? Sorry for being blunt, but clarity is critical or waste us time on unnecessary things.

    When you say "he told me that he registered very well", which means exactly please? This means that he said something like 'Check pending', 'Record sent' or some other message popup? Once again, here the clarity is critical. If that's what you saw, then indeed it is not registered correctly. Rather, he made the application very well... but until the enrollment message arrives in the Messages application, then the intervention is required since the data network of the carrier did not and until it nothing for the data will be working.

    Serious9900 wrote:

    It is H + at the top right of the screen, but who has always been there.

    Upper case H +? Once again, just double check, since if she was tiny, that it would mean something completely different from that of capital letters. Top of case, this is what it must be.

    Serious9900 wrote:

    She said that perhaps the phone restriction IP since I bought it used

    I don't know what she thought about it. May be restriction of BES and if the above process I gave you can purify that.

    Serious9900 wrote:
    and that maybe BB Swiss Army tool could help me to remove, but she didn't know how. So I downloaded and pushed some buttons (more precisely remove COD) and really messed up my phone... lol

    Never good to a few buttons when you don't know what you do... I don't remember if BBSAK is able to remove political or not, but it can do a very good cleaning.

    Serious9900 wrote:

    Just reinstalled OS7.01 once again and fortunately had a fairly recent backup.

    And that could be part of your problems. If, for example, the device has one IT political edge, while part of a full process... which means that even if you happen to clean off, a complete restoration simply will return to the instrument, turning to your right back to where you started backup/restore. Instead, to do only a partial backup or restore, and more precisely to avoid data bases that have to do with THIS, political, business or something similar... the conservative approach is to only to backup/restore of critical databases you need (for example, contacts, calendar) and manually reconfigure the rest. Remove a policy is a tricky thing.

    Serious9900 wrote:

    Suggestions for making data work, or do I need a new phone?

    I think you have enough to start on top. Another question about whether Koodo, however, is if their network is configured to auto-fill your specific with entries HRT device model and service book. If their network is not, while actually explains everything. No carriers configure their network to support all models of BB... each one chooses a subset of the model numbers of BB and configure their network accordingly. But trying to use a model number BB on a carrier network that is NOT configured for this model results in number exactly what you live... their network will not automatically grow some HRT and SB entries on your device because their network does not recognize your device as a model BB number taken in charge.

    Looking at a reference that I can find, it seems that Koodo is configured for the 9360, 9300, 8530 and 9790. But not for the 9900. Now, is that with a proverbial grain of salt... that reference does not necessarily mean that the network of Koodo is not configured for the 9900, it's just an indicator that is not. Koodo can only tell you that answer for you.

    Good luck and let us know!

  • -You also get an invalid identifier error when executing this query sql for a data model, but not in TOAD/SQL Developer?

    Hello OTN.

    I don't understand why my sql query will pass by in the data model of the BI Publisher. I created a new data model, chose the data source and type of Standard SQL = SQL. I tried several databases and all the same error in BI Publisher, but the application works well in TOAD / SQL Developer. So, I think it might be something with my case so I'm tender hand to you to try and let me know if you get the same result as me.

    The query is:

    SELECT to_char (to_date ('15-' |)) TO_CHAR(:P_MONTH) | » -'|| (To_char(:P_YEAR), "YYYY-DD-MONTH") - 90, "YYYYMM") as yrmth FROM DUAL


    Values of the variable:

    : P_MONTH = APRIL

    : P_YEAR = 2015

    I tried multiple variations and not had much luck. Here are the other options I've tried:

    WITH DATES AS

    (

    Select TO_NUMBER (decode (: P_MONTH, 'JANUARY', '01',))

    'FEBRUARY', '02',.

    'MARCH', '03'.

    'APRIL', '04'

    'MAY', '05'.

    'JUNE', '06'.

    'JULY', '07',.

    'AUGUST', '08'.

    'SEPTEMBER', '09'.

    'OCTOBER', '10',.

    'NOVEMBER', '11'.

    "DECEMBER", "12."

    '01')) as mth_nbr

    of the double

    )

    SELECT to_char (to_date ('15-' |)) MTH_NBR | » -'|| (TO_CHAR(:P_YEAR), 'DD-MM-YYYY') - 90, "YYYYMM")

    OF DATES

    SELECT to_char (to_date ('15-' |: P_MONTH |)) » -'|| ((: P_YEAR, 'MONTH-DD-YYYY')-90, "YYYYMM") as yrmth FROM DUAL

    I'm running out of ideas and I don't know why it does not work. If anyone has any suggestions or ideas, please let me know. I always mark answers correct and useful in my thread and I appreciate all your help.

    Best regards

    -Konrad

    So I thought to it. It seems that there is a bug/lag between the guest screen that appears when you enter SQL in the data model and parameter values, to at model/value data.

    Here's how I solved my problem.

    I have created a new data model and first created all my settings required in the data model (including the default values without quotes, i.e. APRIL instead "Of APRIL") and then saved.

    Then I stuck my sql query in the data model and when I clicked ok, I entered my string values in the message box with single quotes (i.e. "in APRIL' instead of APRIL)

    After entering the values of string with single quotes in the dialog box, I was able to retrieve the columns in the data model and save.

    In the data tab, is no longer, I had to enter the values in single quotes, but entered values normally instead, and the code worked.

    It seems the box prompted to bind the values of the variables when the SQL text in a data model expects strings to be wrapped in single quotes, but no where else. It's a big headache for me, but I'm glad that I solved it, and I hope this can be of help to other institutions.

    See you soon.

  • Report of the Group of left does not sort descending

    Hello seniors...

    I have the following query which produces the result as you wish below at the SQL level; I aim to lines to be copied in descending order...
    SQL> SELECT Z.ACATG_TYPE, Y.EXPN_CATG, z.ACATG_DESC, y.expn_code, y.expn_name,
      2  DECODE(Z.ACATG_TYPE,'I', x.closing) Income,
      3  DECODE(Z.ACATG_TYPE,'E', x.closing) Expense
      4  FROM(
      5  SELECT PSN_PARTY, expn_name, SUM(nvl(NETT,0)) nett,  SUM(nvl(DEBIT,0)) debit,  SUM(nvl(CREDIT,0
    )) credit, 
      6  SUM((nvl(NETT,0)+nvl(DEBIT,0)-nvl(CREDIT,0))) CLOSING
      7  FROM (
      8  SELECT PSN_PARTY, 0 nett, SUM(nvl(debit,0)) DEBIT, SUM(nvl(CREDIT,0)) CREDIT
      9  FROM(
     10   SELECT PSN_TXN_DATE,PSN_PARTY, nvl(DEBIT,0) debit, nvl(CREDIT,0) credit
     11   FROM 
     12       (
    .
    .
    .
     94  where PSN_PARTY = expn_code
     95  GROUP BY PSN_PARTY, expn_name) x, expense_master y, Accounts_category z
     96  where x.psn_party = y.expn_code
     97  and   y.expn_catg = z.acatg_code
     98  and   z.acatg_type in ('I','E')
     99  ORDER BY Z.ACATG_TYPE DESC, Y.EXPN_CATG,y.expn_code;
    
    ACA EXPN_C ACATG_DESC                     EXPN_C EXPN_NAME                             INCOME       EXPENSE
    --- ------ ------------------------------ ------ ------------------------------ ------------- ------
    I   90     Income                         AC2000 Sale                                1333.000
    E   10     Expense                        AC0003 ELECTRICIRTY BILL                                   30.000
    E   10     Expense                        AC0005 TELEPHONE BILL                                      16.000
    E   10     Expense                        AC0007 TEA & SNACKS                                        17.000
    E   10     Expense                        AC0009 REPAIRS & MAINTENANCE                               15.000
    E   10     Expense                        AC0010 MOBILE BILL                                         45.000
    E   10     Expense                        AC0011 REFUND                                             220.000
    E   10     Expense                        AC0019 OFFICE EXPENCE                                      15.000
    E   40     Staff Salaries                 AC0006 STAFF SLALARY                                      250.000
    
    9 rows selected.
    But when I've made use of the query above in my report with an Option of left group, I understand not sorted in descending order.
    With a tabular report, it sorts correctly as indicated above.

    Schot screen for a better idea of my report is attached for reference.

    [http://i995.photobucket.com/albums/af71/rhnshk/INCEXP.jpg |-overview of the report]
    [http://i995.photobucket.com/albums/af71/rhnshk/INCEXP1.jpg |] ReportWizard-DataModel]
    [http://i995.photobucket.com/albums/af71/rhnshk/INCEXP2.jpg |] ReportWizard-groups]
    [http://i995.photobucket.com/albums/af71/rhnshk/INCEXP3.jpg |] ReportWizard-fields]
    [http://i995.photobucket.com/albums/af71/rhnshk/INCEXP4.jpg |] ReportWizard-totals]

    I want the lines with acatg_type = 'I' to be displayed first.

    Sorry for fixing is not SQL full, but no problems, or even not at all necessary, I can do the same.
    Given that this is a long online created SQL view. thought that the solution might come out showing as much a part only.

    I use report 6i to 10g.

    Please help me.

    Hello

    Verify that the order of the fields in the "data model", in the respective application group ACATG_TYPE column should be first by EXPN_CATG, then expn_code.
    Also check the order of the breaking of all columns.

    I hope this helps.

    Best regards

    Arif Khadas

  • Load model does not work

    I have a problem. I defined a definition of data with the code "my_data_definition". I model a link with my definition of data and define a competitor with the name short "my_data_definition".
    Out of the report is PDF but does not work, I get "File does not begin with '% PDF -'". When I run applications I do not have any available.
    What I am doing wrong?

    Hello

    The defined simultaneous program must have an output XML defined in its definition.

    concerning

    Tim

Maybe you are looking for

  • Can I allow someone else access to my favorites?

    So far, I was only a laptop Vista Home Premium SP2 user, with 1 user (admin, password) account. I have now created a 2nd account, not administrator user and password-protected, for husband Dave. Both accounts have (ver.12) Firefox as default browser.

  • Satellite A205-S5000 - no recovery disk

    Be aware that my Toshiba Satellite A205-S5000 laptop was purchased at Walmart-Caroline N. July 2008 and had no recovery disc in the package and not info on computer on how to make a. It was cheap ($400) and probably made just for Walmmart. As it is,

  • Inspiron 15 7559 - upgrade SSD

    Hello world I recently bought the 7559 Inspiron, 16 GB RAM, UHD/touch screen, 4 GB NVidia, 1 TB HDD and 128 GB of SSD. I already traded on the HARD drive for a 1 to Samsung 850 Pro SSD. I am now considering permutation of the SSD 128 GB for an equiva

  • ICH habe mir ein iphone4 so! GER t

    Warum steht're bei mir als unbekannt in der Gerateansicht. Da steht iphone 4 unbekannt, habe ich was please gemacht? Liegt oder are daran, das are schon einen Vorbesitzer had!

  • d2kqt60 ins (67) statement normally when ' ' found.

    d2kqt60 ins (67) statement normally when ' ' found.i cannot install oracle 6 or 6i on windows 7 64-bit platform .can any body can help as soon as possible