How To Use Named Data Sources In Stored Procedure 关注

0
Avatar
Legacy Poster

We are using Bartender Commander to process a text data file that our ERP system is generating. This file contains various data fields to print a label. These fields are mapped to Named Data Sources in the Bartender label design. We need to utilize a stored procedure to update a date code field in our database when the label is printed. The key to that update is a job # being passed from the text file to Bartender. How do we access those named data sources in the Custom SQL Statement input box? 

 

My SQL statement is in the form of:

 

EXEC <stored procedure name> <job number>, <job suffix>, <Date Code OUTPUT>

 

I want to replace the <job number> and <job suffix> parameters with the named data sources job.job and job.suffix. The last parameter will be just NULL.

 

I tried query prompts and those work for testing, but I don't think those will work with the automated processing (non-interactive):

 

EXEC [ES_GetDateCode] '?JobNum', '?Suffix', NULL

 

 

I appreciate any assistance anyone can provide.

 

-Tim

2 评论

0
Avatar
Ian Cummings
版主
评论操作 固定链接

I don't think you can do it in that way.  Instead I suggest you make use of a document level VB script (via "File>BarTender Document Options") and run a VB script on the OnPrintJobEnd event to make a connection to the database, execute the stored procedure while passing the named data source value which is an easy to use reference expression.

0
Avatar
Legacy Poster
评论操作 固定链接

OK, I'll check that out. Thanks Ian.

 

I don't think you can do it in that way.  Instead I suggest you make use of a document level VB script (via "File>BarTender Document Options") and run a VB script on the OnPrintJobEnd event to make a connection to the database, execute the stored procedure while passing the named data source value which is an easy to use reference expression.

请先登录再写评论。