Hi,
here is the Docrrin class i have generated for the following SQL View -
CREATE VIEW `STREAMLINE`.`ViewPurchaseOrderProgress` AS
-
(SELECT
-
P.StockPurchaseOrderId, P.Item, I.Name, P.Ordered, IFNULL(0, G.Received) AS Received,
-
(P.Ordered - IFNULL(0, G.Received) + IFNULL(0, R.Returned)) AS Pending
-
FROM
-
ViewStockPurchaseOrderSummary P
-
LEFT JOIN
-
StockItem I
-
ON (I.StockItemId = P.Item)
-
LEFT JOIN
-
ViewStockGrnSummary G
-
ON (G.PurchaseOrder = P.StockPurchaseOrderId AND G.Item = P.Item)
-
LEFT JOIN
-
ViewStockDamageReturnSummary R
-
ON (R.PurchaseOrder = P.StockPurchaseOrderId AND R.Item = P.Item))
-
-
abstract class BaseViewPurchaseOrderProgress extends Doctrine_Record
-
{
-
public function setTableDefinition()
-
{
-
$this->setTableName('ViewPurchaseOrderProgress');
-
$this->hasColumn('StockPurchaseOrderId', 'integer', 4, array(
-
'type' => 'integer',
-
'length' => 4,
-
'fixed' => false,
-
'unsigned' => false,
-
'primary' => false,
-
'default' => '0',
-
'notnull' => true,
-
'autoincrement' => false,
-
));
-
$this->hasColumn('Item', 'integer', 4, array(
-
'type' => 'integer',
-
'length' => 4,
-
'fixed' => false,
-
'unsigned' => false,
-
'primary' => false,
-
'notnull' => true,
-
'autoincrement' => false,
-
));
-
$this->hasColumn('Name', 'string', 128, array(
-
'type' => 'string',
-
'length' => 128,
-
'fixed' => false,
-
'unsigned' => false,
-
'primary' => false,
-
'notnull' => false,
-
'autoincrement' => false,
-
));
-
$this->hasColumn('Ordered', 'decimal', 32, array(
-
'type' => 'decimal',
-
'length' => 32,
-
'fixed' => false,
-
'unsigned' => false,
-
'primary' => false,
-
'notnull' => false,
-
'autoincrement' => false,
-
));
-
$this->hasColumn('Received', 'decimal', 32, array(
-
'type' => 'decimal',
-
'length' => 32,
-
'fixed' => false,
-
'unsigned' => false,
-
'primary' => false,
-
'notnull' => false,
-
'autoincrement' => false,
-
));
-
$this->hasColumn('Pending', 'decimal', 34, array(
-
'type' => 'decimal',
-
'length' => 34,
-
'fixed' => false,
-
'unsigned' => false,
-
'primary' => false,
-
'notnull' => false,
-
'autoincrement' => false,
-
));
-
}
-
-
public function setUp()
-
{
-
parent::setUp();
-
-
}
-
}
-
I used the folllowing code to get the data -
$poItems = Doctrine_Query::create()
-
->select('Item, Name, Ordered, Received, Pending')
-
->from('ViewPurchaseOrderProgress')
-
->where('StockPurchaseOrderId = ?', 1)
-
->fetchArray();
-
but this triggers the following error
Column not found: 1054 Unknown column 'v.id' in 'field list'
and it is true that this table does not have any column with the name id
please help me to solve this as im new to doctrine
Regards
Chathura Bamunusinghe
1 3829
Take a look at the "Doctrine_Record" class, I'm sure that has "id" in it.
I don't know what Doctrine is, but if it's a framework then I think some frameworks require all their tables to have a field called id.
Dan
Sign in to post your reply or Sign up for a free account.
Similar topics
by: js |
last post by:
I am trying to create a primary key constraint on a view in the
following statement. However, I got an error ORA-00907: missing right
parenthesis. If the CONSTRAINT clause is removed, then the...
|
by: M. Mehta |
last post by:
It seems that you can not create a materialized view if you are using
outer joins...can someone please verify this?
Thanks
M. Mehta
Please follow my example below:
created 2 tables:
|
by: Ryan |
last post by:
Bit of an obscure one here, so please bear with me. I have two copies
of a database which should be identical. Both have a complex view
which is identical. I can open the views and the data is as...
|
by: Jef Driesen |
last post by:
I'm implementing some image processing algorithms in C++. I created a
class called 'image' (see declaration below), that will take care of the
memory allocations and some basic (mathematical)...
|
by: Neil |
last post by:
I just resolved a strange situation I was having with an ODBC linked SQL 7
view in an Access 2000 MDB file, and I'm trying to get some understanding as
to what happened.
The linked view was...
|
by: Neil |
last post by:
I previously posted re. this, but thought I'd try again with a summary of
facts.
I have an Access 2000 MDB with a SQL Server 7 back end. There is a view that
is linked to the database via ODBC...
|
by: Zack Sessions |
last post by:
Has anyone tried to create a SQL7 view using the CREATE VIEW command
and ADO.NET? If so, is there a trick in trapping a SQL error when
trying to create the view? I have a VB.NET app that, amoung...
|
by: Nogusta123 |
last post by:
Hi,
I have had a lot of problems getting web pages, master pages and
content pages to render in VS2005 design view the same as they would in
Internet Explorer. I did a lot of looking on the...
|
by: Neil |
last post by:
I had a strange situation with a view in SQL 7, that I could use some input
on.
I had a very simple view -- select a, b, c from table1 where x=y and z=q.
Field a in table1 originally was varchar...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |