Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQLBase, BAT, and Truncated Output

Status
Not open for further replies.

astrozomby

Technical User
Jun 8, 2004
3
US
I've got two things happening that I see similar, unresolved issues on this forum.
I'm going to jump to the conclusion that one of the other folks has figured out what
they needed to get their issue resolved, and hope I can get a response as well.


RUNNING AS BAT:
<

COLUMNS WIDE ISSUE:
<

I have tried to run the query as a command line as follows:

sqltalk BAT DB=POS/STARUSER/STARUSER INPUT=c:\path\inv.sql OUTPUT=c:\path\out.txt

I've attempted to include the queries I'm using below, as well as the output that
I get from the command line "OUTPUT" versus the output I get when I run the same query
from within the SQLTALK.EXE application "OUTPUT WITHIN SQLTALK".

My goal is to get the "OUTPUT WITHIN SQLTALK" information in an automated fashion, such
as by running a .bat that executes the above command line on a regular schedule.

I attempted to add the "SET LINESIZE 5000;" line to the top of my INV.SQL file, but this
did not solve the trouble with cutoff results when running via command line.




------------------------------ INV.SQL ------------------------------
Select
PRODUCT.WEB_ITEM as WEB,
PRODUCT_SIZE.SKU as SKU,
ACTIVE_INV.ONHAND_QTY as QTY,
PRODUCT_SIZE.RETAIL_PRICE as PRICE,
PRODUCT.STYLE as STYLE,
PRODUCT.DESCRIPTION as DESC,
PRODUCT.DEPARTMENT as DEPT,
DEPARTMENT.DEPARTMENT_NAME as DEPT_NAME,
PRODUCT.CLASS as CLASS,
CLASS.CLASS_NAME as CLASS_NAME,
PRODUCT.SUBCLASS as SUBCLASS,
PROD_NOTES.NOTE as EXTENDED_NOTES
From
SYSADM.CLASS CLASS,
SYSADM.DEPARTMENT DEPARTMENT,
SYSADM.ACTIVE_INV ACTIVE_INV,
SYSADM.PROD_NOTES PROD_NOTES,
SYSADM.PRODUCT_SIZE PRODUCT_SIZE,
SYSADM.PRODUCT PRODUCT,
SYSADM.STYLE_NOTE STYLE_NOTE
Where
PRODUCT.DEPARTMENT = DEPARTMENT.DEPARTMENT
And PRODUCT.STYLE = PRODUCT_SIZE.STYLE
And PRODUCT_SIZE.SKU = ACTIVE_INV.SKU
And STYLE_NOTE.NOTE_ID = PROD_NOTES.NOTE_ID
And STYLE_NOTE.STYLE = PRODUCT.STYLE
And PRODUCT.CLASS = CLASS.CLASS
And PRODUCT.DEPARTMENT = CLASS.DEPARTMENT
;
------------------------------ END INV.SQL -------------------------


------------------------------ OUTPUT ------------------------------

Select
PRODUCT.WEB_ITEM as WEB,
PRODUCT_SIZE.SKU as SKU,
ACTIVE_INV.ONHAND_QTY as QTY,
PRODUCT_SIZE.RETAIL_PRICE as PRICE,
PRODUCT.STYLE as STYLE,
PRODUCT.DESCRIPTION as DESC,
PRODUCT.DEPARTMENT as DEPT,
DEPARTMENT.DEPARTMENT_NAME as DEPT_NAME,
PRODUCT.CLASS as CLASS,
CLASS.CLASS_NAME as CLASS_NAME,
PRODUCT.SUBCLASS as SUBCLASS,
PROD_NOTES.NOTE as EXTENDED_NOTES
From
SYSADM.CLASS CLASS,
SYSADM.DEPARTMENT DEPARTMENT,
SYSADM.ACTIVE_INV ACTIVE_INV,
SYSADM.PROD_NOTES PROD_NOTES,
SYSADM.PRODUCT_SIZE PRODUCT_SIZE,
SYSADM.PRODUCT PRODUCT,
SYSADM.STYLE_NOTE STYLE_NOTE
Where
PRODUCT.DEPARTMENT = DEPARTMENT.DEPARTMENT
And PRODUCT.STYLE = PRODUCT_SIZE.STYLE
And PRODUCT_SIZE.SKU = ACTIVE_INV.SKU
And STYLE_NOTE.NOTE_ID = PROD_NOTES.NOTE_ID
And STYLE_NOTE.STYLE = PRODUCT.STYLE
And PRODUCT.CLASS = CLASS.CLASS
And PRODUCT.DEPARTMENT = CLASS.DEPARTMENT
;

WEB SKU QTY PRICE STYLE
=== ==================== =========== =============== ===============
Y 400100170571 2 7.99 0-20239
Y 400100010242 1 6.99 rampant031
Y 400100012420 1 10.99 zone022
Y 400100007143 1 10.99 rr003

4 ROWS SELECTED IN 0.02 SECONDS
200.00 ROWS PER SECOND / 0.00 SECONDS PER ROW

----------------------------END OUTPUT ------------------------------



------------------------------ OUTPUT WITHIN SQLTALK ------------------------------

WEB SKU QTY PRICE STYLE DESC DEPT DEPT_NAME CLASS CLASS_NAME SUBCLASS EXTENDED_NOTES
=== ==================== =========== =============== =============== ============================== ========== ============================== ====== ============================== ======== ==============================================================================================================================================================================================================================================================
Y 400100170571 1 7.99 0-20239 (vc) madonna: like a virgin 1 Vinyl 999 Misc. 20 uuuuuuuuuuuuu
Y 400100010242 1 6.99 rampant031 Gorilla Pimp (b) "this is real 1 Vinyl 100 Breakbeat zzzzzzzzzzzzz
Y 400100012420 1 10.99 zone022 arksun (b/tra) "earth one" 1 Vinyl 100 Breakbeat yyyyyyyyy
Y 400100007143 1 10.99 rr003 Downpressor (b) "nine" 1 Vinyl 100 Breakbeat xxxxxxx


4 ROWS SELECTED
IN 0.02 SECONDS

200.00 ROWS PER SECOND / 0.00 SECONDS PER ROW

------------------------------ END OUTPUT WITHIN SQLTALK ------------------------------
 
Should have added this info with the original post.

SQLBase Server 7.5.1
SQLTalk 7.5.1
 
Well, I'm not sure if this is progress or not. I modified my .sql command file
to include lines to increase the linesize, pagesize, turn the echo off, and use
the SET SPOOL command to specify the file to write out to instead of indicating
that on the command line. So now the command line looks like this...

> sqltalk BAT DB=POS/STARUSER/STARUSER INPUT=c:\path\inv.sql

It seems that the output file is re-written on each pass, but, I am still not
getting the full output that I need. Only the first five columns are showing
up in the output file when I run this via the command line.

HOWEVER, if I actually open the sqltalk.exe application, connect to the db, and
execute the same query, I get an output file with the complete results.

So, the question is, why do I get inconsistent output using the same .sql command
file?

This is still using...


SQLBase Server 7.5.1
SQLTalk 7.5.1




------------------------------ INV.SQL ------------------------------
SET ECHO OFF;
SET LINESIZE 5000;
SET PAGESIZE 99999;

SET SPOOL OUTPUT.TXT OVERWRITE;

Select
PRODUCT.WEB_ITEM as WEB,
PRODUCT_SIZE.SKU as SKU,
ACTIVE_INV.ONHAND_QTY as QTY,
PRODUCT_SIZE.RETAIL_PRICE as PRICE,
PRODUCT.STYLE as STYLE,
PRODUCT.DESCRIPTION as DESC,
PRODUCT.DEPARTMENT as DEPT,
DEPARTMENT.DEPARTMENT_NAME as DEPT_NAME,
PRODUCT.CLASS as CLASS,
CLASS.CLASS_NAME as CLASS_NAME,
PRODUCT.SUBCLASS as SUBCLASS,
PROD_NOTES.NOTE as EXTENDED_NOTES
From
SYSADM.CLASS CLASS,
SYSADM.DEPARTMENT DEPARTMENT,
SYSADM.ACTIVE_INV ACTIVE_INV,
SYSADM.PROD_NOTES PROD_NOTES,
SYSADM.PRODUCT_SIZE PRODUCT_SIZE,
SYSADM.PRODUCT PRODUCT,
SYSADM.STYLE_NOTE STYLE_NOTE
Where
PRODUCT.DEPARTMENT = DEPARTMENT.DEPARTMENT
And PRODUCT.STYLE = PRODUCT_SIZE.STYLE
And PRODUCT_SIZE.SKU = ACTIVE_INV.SKU
And STYLE_NOTE.NOTE_ID = PROD_NOTES.NOTE_ID
And STYLE_NOTE.STYLE = PRODUCT.STYLE
And PRODUCT.CLASS = CLASS.CLASS
And PRODUCT.DEPARTMENT = CLASS.DEPARTMENT
;

SET SPOOL OFF;

------------------------------ END INV.SQL -------------------------


------------------------------ OUTPUT ------------------------------

Select
PRODUCT.WEB_ITEM as WEB,
PRODUCT_SIZE.SKU as SKU,
ACTIVE_INV.ONHAND_QTY as QTY,
PRODUCT_SIZE.RETAIL_PRICE as PRICE,
PRODUCT.STYLE as STYLE,
PRODUCT.DESCRIPTION as DESC,
PRODUCT.DEPARTMENT as DEPT,
DEPARTMENT.DEPARTMENT_NAME as DEPT_NAME,
PRODUCT.CLASS as CLASS,
CLASS.CLASS_NAME as CLASS_NAME,
PRODUCT.SUBCLASS as SUBCLASS,
PROD_NOTES.NOTE as EXTENDED_NOTES
From
SYSADM.CLASS CLASS,
SYSADM.DEPARTMENT DEPARTMENT,
SYSADM.ACTIVE_INV ACTIVE_INV,
SYSADM.PROD_NOTES PROD_NOTES,
SYSADM.PRODUCT_SIZE PRODUCT_SIZE,
SYSADM.PRODUCT PRODUCT,
SYSADM.STYLE_NOTE STYLE_NOTE
Where
PRODUCT.DEPARTMENT = DEPARTMENT.DEPARTMENT
And PRODUCT.STYLE = PRODUCT_SIZE.STYLE
And PRODUCT_SIZE.SKU = ACTIVE_INV.SKU
And STYLE_NOTE.NOTE_ID = PROD_NOTES.NOTE_ID
And STYLE_NOTE.STYLE = PRODUCT.STYLE
And PRODUCT.CLASS = CLASS.CLASS
And PRODUCT.DEPARTMENT = CLASS.DEPARTMENT
;

WEB SKU QTY PRICE STYLE
=== ==================== =========== =============== ===============
Y 400100170571 2 7.99 0-20239
Y 400100010242 1 6.99 rampant031
Y 400100012420 1 10.99 zone022
Y 400100007143 1 10.99 rr003

4 ROWS SELECTED IN 0.02 SECONDS
200.00 ROWS PER SECOND / 0.00 SECONDS PER ROW

SET SPOOL OFF;


----------------------------END OUTPUT ------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top