I've been trying to make a query_report on frappe.
but it doesn't return the data on the browser.
the console says 'Unable to handle success response'
console.trace() Each data element must implement a unique 'id' property
this is my sql syntax
SELECT
`tabPayment Entry`.`name` AS `id`,
`tabFees`.`student` AS `student id::100`,
`tabFees`.`student_name` AS `name::200`,
`tabFees`.`posting_date` AS `tgl bayar::200`,
`tabFees`.`due_date` AS `bulan inv::200`,
`tabFees`.`outstanding_amount` AS `blm bayar::200`,
`tabFees`.`paid_amount` AS `terbayar::200`,
`tabFees`.`grand_total` AS `total::200`,
`tabFees`.`status` AS `status::200`,
`tabPayment Entry`.`mode_of_payment` AS `mode::200`
FROM
(tabFees
LEFT JOIN `tabPayment Entry` ON (`tabFees`.`student` = `tabPayment Entry`.`party`))
WHERE
`tabFees`.`status` = %(status)s AND
`tabFees`.`due_date` BETWEEN %(from_date)s AND %(to_date)s
this is the screenshot of the
console report
that sql syntax is working perfectly on the sql preview software.
Please if you have some answer i will appreciate it....
Related
Is there a way to check if pg_prepare already executed and remove it from the session?
Seems like pg_close doesn't remove prepared statement from the session. Kind of seems like a bug in php, but maybe I'm missing something or maybe there is a workaround.
public static function readSubdomains($dcName, $filter = null) {
// ...
$conn = pg_pconnect($connectionString);
// ...
$result = pg_prepare($conn, "subdomains", "SELECT subdomain
from tenants
where $where
order by 1 asc
");
$result = pg_execute($conn, "subdomains", $params);
// ...
pg_close($conn);
}
Second call to readSubdomains shows a warning like this:
Warning: pg_prepare(): Query failed: ERROR: prepared expression "subdomains" already exists in inc/TestHelper.php on line 121
Always check the official manuals for this sort of stuff.
https://www.postgresql.org/docs/current/view-pg-prepared-statements.html
Oh - if pg_close isn't dropping prepared statements then it isn't closing the connection. You might have some connection pooling involved.
I am developing an application using Dashdb on Bluemix and nodered, my PHP application uses the call to webservice to invoke the node-red, whenever my function on PHP invokes the node to insert on table and the field GEO_ID is null, the application fails, I understand the issue, it seems the third parameter was not informed, I have just tried to check the param before and passing something like NULL but it continues not working.
See the code:
msg.account_id = msg.req.query.account_id;
msg.user_id = msg.req.query.user_id;
msg.geo_id=msg.req.query.geo_id;
msg.payload = "INSERT INTO ACCOUNT_USER (ACCOUNT_ID, USER_ID, GEO_ID) VALUES (?,?,?) ";
return msg;
And on Dashdb component I have set the parameter as below:
msg.account_id,msg.user_id,msg.geo_id
The third geo_id is the issue, I have tried something like the code below:
if(msg.req.query.geo_id===null){msg.geo_id=null}
or
if(msg.req.query.geo_id===null){msg.geo_id="null"}
The error I got is the one below:
dashDB query node: Error: [IBM][CLI Driver][DB2/LINUXX8664] SQL0420N Invalid character found in a character string argument of the function "DECIMAL". SQLSTATE=22018
I really appreciate if someone could help me on it .
Thanks,
Eduardo Diogo Garcia
Is it possible that msg.req.query.geo_id is set to an empty string?
In that case neither if statement above would get executed, and you would be trying to insert an empty string into a DECIMAL column. Maybe try something like this:
if (! msg.req.query.geo_id || msg.req.query.geo_id == '') {
msg.geo_id = null;
}
nested exception is org.apache.ibatis.builder.BuilderException: Error creating document instance. Cause: org.xml.sax.SAXParseException: The content of elements must consist of well-formed character data or markup.
this is the syntax
it working well while fetching the result in ORACLE SQL DEVELOPER
but while start my local server it gives error
please suggest what need to fix on this
SQL is good and working to get records directly from DB
select
rownum test,
os_alternate_label "altlabel",
em_customs_bar_code "label",
em_source_appl "source",
'H5' "altoutcome",
DECODE(OS_NL_DO_NOT_LOAD,1,'NL',
DECODE(OS_H5_ALT_DUP_HOLD,1,'H5',
DECODE(OS_BD_RTS_EC,1,'BD',
DECODE(OS_H2_EC_HOLD,1,'H2',
DECODE(OS_HD_NO_DISP_HOLD,1,'HD',
DECODE(OS_H3_CBP_HOLD,1,'H3',
DECODE(OS_H4_USPIS_HOLD,1,'H4',
DECODE(OS_UD_RTS_CUSTOMER,1,'UD',
DECODE(OS_NQ_EU_WAIT_TIME,1,'NQ',
DECODE(OS_H1_iPASS_HOLD,1,'H1',
DECODE(OS_DG_DANGER_HOLD,1,'DG',
DECODE(OS_CC_COMM_HOLD,1,'CC',
DECODE(OS_H6_CUS_DUP_HOLD,1,'H6',
DECODE(OS_RL_RELEASE,1,'RL','XX')))))))))))))) "customoutcome",
em_destination_country "destCo",
em_recipient_last_name "tolastName",
em_recipient_business "tobusinessname",
em_recipient_address "toaddress",
em_recipient_city "tocity",
em_recipient_state "toregionprov",
em_recipient_postcode "postcode",
to_char(em_date_time_received,'MM/DD/YY HH24:MI') "timeReceived"
FROM CUSTOMS.OUTCOME_STATUS_T,
CUSTOMS.ECM_MANIFEST_T
WHERE OS_CUSTOMS_BAR_CODE = EM_CUSTOMS_BAR_CODE
Use escape character I believe the '/' used to define date is causing problem
<![CDATA[
select
rownum test,
os_alternate_label "altlabel",
em_customs_bar_code "label",
em_source_appl "source",
'H5' "altoutcome",
DECODE(OS_NL_DO_NOT_LOAD,1,'NL',
DECODE(OS_H5_ALT_DUP_HOLD,1,'H5',
DECODE(OS_BD_RTS_EC,1,'BD',
DECODE(OS_H2_EC_HOLD,1,'H2',
DECODE(OS_HD_NO_DISP_HOLD,1,'HD',
DECODE(OS_H3_CBP_HOLD,1,'H3',
DECODE(OS_H4_USPIS_HOLD,1,'H4',
DECODE(OS_UD_RTS_CUSTOMER,1,'UD',
DECODE(OS_NQ_EU_WAIT_TIME,1,'NQ',
DECODE(OS_H1_iPASS_HOLD,1,'H1',
DECODE(OS_DG_DANGER_HOLD,1,'DG',
DECODE(OS_CC_COMM_HOLD,1,'CC',
DECODE(OS_H6_CUS_DUP_HOLD,1,'H6',
DECODE(OS_RL_RELEASE,1,'RL','XX')))))))))))))) "customoutcome",
em_destination_country "destCo",
em_recipient_last_name "tolastName",
em_recipient_business "tobusinessname",
em_recipient_address "toaddress",
em_recipient_city "tocity",
em_recipient_state "toregionprov",
em_recipient_postcode "postcode",
to_char(em_date_time_received,'MM/DD/YY HH24:MI') "timeReceived"
FROM CUSTOMS.OUTCOME_STATUS_T,
CUSTOMS.ECM_MANIFEST_T
WHERE OS_CUSTOMS_BAR_CODE = EM_CUSTOMS_BAR_CODE
]]>
I'm hitting an error whenever 2 or more instances of a workflow is restarted. We have suspended workflows during a network incident in our office(s). It was a script timeout that disrupted the process. I couldn't reproduce this timeout anymore so I attempted to restart the workflow activities to complete the process. However, when I restart more than 1 suspended activity, I get this error (the full log is farther below):
Cannot insert the value NULL into column 'ITEM_ID', table 'tridion_cm.dbo.ITEM_ASSOCIATIONS'; column does not allow nulls. INSERT fails.
The statement has been terminated.
Restarting activities and letting it finish one by one has no problem.
Full Event Log:
An error occurred while executing the Workflow script.
The Script Engine returned the following information:
SOURCE:
Line = 0
Column = 0
Number = -2147220673
Source = Component.Save
Description =
<?xml version="1.0" standalone="yes"?>
<tcm:Error ErrorCode="8004033F" Category="4" Source="Kernel" Severity="1" xmlns:tcm="http://www.tridion.com/ContentManager/5.0">
<tcm:Line ErrorCode="8004033F" Cause="false" MessageID="16137"><![CDATA[Unable to save Component (tcm:5-32795).]]>
<tcm:Token>RESID_4574</tcm:Token>
<tcm:Token>RESID_4418</tcm:Token>
<tcm:Token>tcm:5-32795</tcm:Token>
</tcm:Line>
<tcm:Line ErrorCode="8004033F" Cause="true">CDATA[No data found. ETA_ITEMS, U Cannot insert the value NULL into column 'ITEM_ID', table 'tridion_cm.dbo.ITEM_ASSOCIATIONS'; column does not allow nulls. INSERT fails. The statement has been terminated.
</tcm:Line>
<tcm:Line ErrorCode="8004033F" Cause="false"><![CDATA[A database error occurred while executing Stored Procedure "EDA_ITEMS_UPDATE".]]>
<tcm:Token>EDA_ITEMS_UPDATE</tcm:Token>
</tcm:Line>
<tcm:Details>
<tcm:CallStack>
<tcm:Location>System.Data.SqlClient.SqlConnection.OnError(SqlException,Boolean)</tcm:Location>
<tcm:Location>System.Data.SqlClient.SqlInternalConnection.OnError(SqlException,Boolean)</tcm:Location>
<tcm:Location>System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(</tcm:Location>
<tcm:Location>System.Data.SqlClient.TdsParser.Run(RunBehavior,SqlCommand,SqlDataReader,BulkCopySimpleResultSet,TdsParserStateObject)</tcm:Location>
<tcm:Location>System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader,RunBehavior,String)</tcm:Location>
<tcm:Location>System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior,RunBehavior,Boolean,Boolean)</tcm:Location>
<tcm:Location>System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior,RunBehavior,Boolean,String,DbAsyncResult)</tcm:Location>
<tcm:Location>System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult,String,Boolean)</tcm:Location>
<tcm:Location>System.Data.SqlClient.SqlCommand.ExecuteNonQuery()</tcm:Location>
<tcm:Location>Tridion.ContentManager.Data.AdoNet.DatabaseUtilities.ExecuteNonQuery(StoredProcedureInvocation)</tcm:Location>
<tcm:Location>Tridion.ContentManager.Data.AdoNet.Sql.SqlDatabaseUtilities.ExecuteNonQuery(StoredProcedureInvocation)</tcm:Location>
<tcm:Location>Tridion.ContentManager.Data.AdoNet.Sql.SqlDatabaseUtilities.ExecuteNonQuery(StoredProcedureInvocation)</tcm:Location>
<tcm:Location>Tridion.ContentManager.Data.AdoNet.IdentifiableObjectDataMapper.Tridion.ContentManager.Data.IIdentifiableObjectDataMapper.Update(IdentifiableObjectData)</tcm:Location>
<tcm:Location>Tridion.ContentManager.IdentifiableObject.Save(SaveEventArgs)</tcm:Location>
<tcm:Location>Tridion.ContentManager.ContentManagement.VersionedItem.Save(Boolean)</tcm:Location>
<tcm:Location>Tridion.ContentManager.ContentManagement.VersionedItem.Save()</tcm:Location>
<tcm:Location>Tridion.ContentManager.BLFacade.ContentManagement.VersionedItemFacade.UpdateAndCheckIn(UserContext,String,Boolean,Boolean)</tcm:Location>
<tcm:Location>XMLState.Save</tcm:Location>
<tcm:Location>Component.Save</tcm:Location>
</tcm:CallStack>
</tcm:Details>
</tcm:Error>
HelpFile =
HelpContext = 1000440
caused by: Component.Save
and description:
<?xml version="1.0" standalone="yes"?>
<tcm:Error ErrorCode="8004033F" Category="4" Source="Kernel" Severity="1" xmlns:tcm="http://www.tridion.com/ContentManager/5.0">
<tcm:Line ErrorCode="8004033F" Cause="false" MessageID="16137"><![CDATA[Unable to save Component (tcm:5-32795).]]>
<tcm:Token>RESID_4574</tcm:Token>
<tcm:Token>RESID_4418</tcm:Token>
<tcm:Token>tcm:5-32795</tcm:Token>
</tcm:Line>
<tcm:Line ErrorCode="8004033F" Cause="true">CDATA[No data found. ETA_ITEMS, U Cannot insert the value NULL into column 'ITEM_ID', table 'tridion_cm.dbo.ITEM_ASSOCIATIONS'; column does not allow nulls. INSERT fails. The statement has been terminated.
</tcm:Line>
<tcm:Line ErrorCode="8004033F" Cause="false"><![CDATA[A database error occurred while executing Stored Procedure "EDA_ITEMS_UPDATE".]]>
<tcm:Token>EDA_ITEMS_UPDATE</tcm:Token>
</tcm:Line>
<tcm:Details>
<tcm:CallStack>
<tcm:Location>System.Data.SqlClient.SqlConnection.OnError(SqlException,Boolean)</tcm:Location>
<tcm:Location>System.Data.SqlClient.SqlInternalConnection.OnError(SqlException,Boolean)</tcm:Location>
<tcm:Location>System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(</tcm:Location>
<tcm:Location>System.Data.SqlClient.TdsParser.Run(RunBehavior,SqlCommand,SqlDataReader,BulkCopySimpleResultSet,TdsParserStateObject)</tcm:Location>
<tcm:Location>System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader,RunBehavior,String)</tcm:Location>
<tcm:Location>System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior,RunBehavior,Boolean,Boolean)</tcm:Location>
<tcm:Location>System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior,RunBehavior,Boolean,String,DbAsyncResult)</tcm:Location>
<tcm:Location>System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult,String,Boolean)</tcm:Location>
<tcm:Location>System.Data.SqlClient.SqlCommand.ExecuteNonQuery()</tcm:Location>
<tcm:Location>Tridion.ContentManager.Data.AdoNet.DatabaseUtilities.ExecuteNonQuery(StoredProcedureInvocation)</tcm:Location>
<tcm:Location>Tridion.ContentManager.Data.AdoNet.Sql.SqlDatabaseUtilities.ExecuteNonQuery(StoredProcedureInvocation)</tcm:Location>
<tcm:Location>Tridion.ContentManager.Data.AdoNet.Sql.SqlDatabaseUtilities.ExecuteNonQuery(StoredProcedureInvocation)</tcm:Location>
<tcm:Location>Tridion.ContentManager.Data.AdoNet.IdentifiableObjectDataMapper.Tridion.ContentManager.Data.IIdentifiableObjectDataMapper.Update(IdentifiableObjectData)</tcm:Location>
<tcm:Location>Tridion.ContentManager.IdentifiableObject.Save(SaveEventArgs)</tcm:Location>
<tcm:Location>Tridion.ContentManager.ContentManagement.VersionedItem.Save(Boolean)</tcm:Location>
<tcm:Location>Tridion.ContentManager.ContentManagement.VersionedItem.Save()</tcm:Location>
<tcm:Location>Tridion.ContentManager.BLFacade.ContentManagement.VersionedItemFacade.UpdateAndCheckIn(UserContext,String,Boolean,Boolean)</tcm:Location>
<tcm:Location>XMLState.Save</tcm:Location>
<tcm:Location>Component.Save</tcm:Location>
</tcm:CallStack>
</tcm:Details>
</tcm:Error>
Source:
LogScriptError
Workflow Info
The components are newly created by another application through BusinessConnector. It performs revision saves before finishing the activity. The objective of the WF is to
assign the necessary component links based on text values from the other system;
create a page;
and publish it to a target.
I know this could've been done better by other means but it is how it is right now, please bear with the implementation.
Model / Schema
Product
- modelName (text)
- categoryName (text)
- categoryCL (component link)
- statusName (text)
- statusCL (component link)
- blah1 (text)
- blah2 (text)
- blah3 (text)
- blah4 (text)
Automatic Activity Script:
' COMPONENT WORKFLOW for PRODUCT SCHEMA (START)
' Load common functions
ExecuteGlobal oTDSE.GetObject("/webdav/200%20Design/Building%20Blocks/Library/Design/Workflow/Common/Workflow%20Functions.tbbs", 1).Content
' Initialize
Set objComp = CurrentWorkItem.GetItem()
Set oContentPub = objComp.Publication
Set oWebsitePub = oTDSE.GetObject(GetStagingLangPub("EN", "website1"), 1)
modelName = objComp.Fields.Item("modelName").Value.Item(1)
' Search and Assign component links based on some text fields from BC client
Set compListRowFilter = oTDSE.CreateListRowFilter()
Call compListRowFilter.SetCondition("ShowNewItems", TRUE)
Call compListRowFilter.SetCondition("ItemType", 16)
' Assign the first component link (categoryCL)
categoryName = objComp.Fields.Item("categoryName").Value.Item(1)
Set categoryComp = GetObjectFromFolder(categoryName, oTDSE.GetObject(categoryFolderWebDav, 1), compListRowFilter)
If Not categoryComp is Nothing Then
objComp.Fields.Item("categoryCL").Value.RemoveAll
objComp.Fields.Item("categoryCL").Value.Add(categoryComp)
Call objComp.Save(True)
Else
Call SendNoObjectEmail("Category", categoryName, "categoryCL", GetEmailsFromGroup(oContentPub, categoryOwner), "")
End if
' Assign the second component link (statusCL)
statusName = objComp.Fields.Item("statusName").Value.Item(1)
Set statusComp = GetObjectFromFolder(statusName, oTDSE.GetObject(statusFolderWebDav, 1), compListRowFilter)
If Not statusComp is Nothing Then
objComp.Fields.Item("statusCL").Value.RemoveAll
objComp.Fields.Item("statusCL").Value.Add(statusComp)
Call objComp.Save(True)
Else
Call SendNoObjectEmail("Status", statusName, "statusCL", GetEmailsFromGroup(oContentPub, statusOwner), "")
End if
' Create a page with the component in WF
Set oPage = CreateDefaultPage(modelName, oWebSitePub, SaveToFolderWebDav, PageTemplateWebDav)
Call oPage.ComponentPresentations.Add(oWebSitePub, oTDSE.GetObject(ComponentTemplateWebDav, 1))
oPage.Save(True)
' Publish the page
....
' Send email
....
' Finish the Activity
Call CurrentWorkItem.ActivityInstance.FinishActivity("someMsg")
' COMPONENT WORKFLOW for PRODUCT SCHEMA (END)
I haven't zoomed in to where exactly it happens but I would assume it is either the categoryCL or statusCL's objComp.Save(True) line.
I notice that you are calling Call objComp.Save(True) - The "True" parameter forces a "CheckIn", as it means "Done Editing".
It looks like this can occur twice (i.e. If there is a statusCL and a categoryCL) whichmay be causing the problem. I would try changing the behavior so that you only the call Save() method at the end if a change has been made, and not saving it twice.
From what I see the problem is that you are trying to assign nulls as component links. Are you sure that you are not trying to link these 2 components one to another? It might be that the link you are trying to create is to new component in workflow (it has no checked-in version yet), hence you can't create link to it. Try adding some logging to your script, so we could see where exactly does it fail and what are the parameters.
And I agree with Frank that this exception is worth a defect report.
I am using SAP CR for VS 2010 in C sharp. i have five tables and i am linking them with the following query:
query = "SELECT Items.AccessionNo, Items.Name, Items.LocalName, Items.Usage, Items.Province, Items.District, Items.VillTown, Items.EthnicCommunity, Arts.Name, Items.PurchasedDonated, Items.PurchasedFrom, Items.YearOfCollection, Items.Material, Items.Height, Items.Width, Items.Length, Items.Circumference, Items.Diameter, Items.Color, Items.Age, Items.Weight, Items.PurchasedValue, Items.Rare, Items.LivingDyingTrad, Items.ManufacturingProcess, Items.PlaceOfManufacturing, Items.ConditionReport, Items.Recommandations, Items.DateOfAddition, Items.Placement, Donators.Name, Collectors.Name, Placement.Name FROM Items INNER JOIN Arts ON Items.ArtId=Arts.ArtId INNER JOIN Donators ON Items.DonatorId=Donators.id INNER JOIN Collectors ON Items.CollectorId=Collectors.id INNER JOIN Placement ON Items.PlacementId=Placement.id WHERE Items.id=" + itemid;
The problem is that the report still shows up multiple results using the already embedded query at the time of design.
I am using the following code to pass the above query
SqlCommand cmd = new SqlCommand(query, dbconn.conn);
if (dbconn.conn.State == ConnectionState.Closed)
{
dbconn.conn.Open();
}
SqlDataAdapter Datadpt = new SqlDataAdapter(cmd);
DataSet dtset = new DataSet("items");
Datadpt.Fill(dtset);
//rep is the Report document object already defined
rep.Load(#"..\..\Reports\CRItem.rpt");
rep.SetDataSource(dtset);
CRViewer.ReportSource = rep;
if (dbconn.conn.State == ConnectionState.Open)
{
dbconn.conn.Close();
}
this.CRViewer.RefreshReport();
Any suggestions?
whoooosss.....i got it. the the crystalreportviewer selection formula is separate from report document record selection formula. Record Selection Formula that you've created in crystal report is stored in ReportDoc.RecordSelectionFormula property. When you load your ReportDoc to ReportViewer it doesn't adopt the value of .RecordSelectionFormula to its ReportViewer.SelectionFormula property. so what i did is....
My objects are:
ReportDoc As CrystalDecisions.CrystalReports.Engine.ReportDocument
ReportViewer As CrystalDecisions.Windows.Forms.CrystalReportViewer
FlexReportDoc.SetParameterValue("Reference", gsReference)
After passing necessary parameters if you have any...
ReportViewer.ReportSource = FlexReportDoc
ReportViewer.SelectionFormula = FlexReportDoc.RecordSelectionFormula
you need to assign the value of FlexReportDoc.RecordSelectionFormula property to ReportViewer.SelectionFormula.