Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Sybase > Using quotes in...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 3 Topic 2459 of 2504
Post > Topic >>

Using quotes in isql for varchar fields

by Celal Dikici <CDikici@[EMAIL PROTECTED] > Apr 30, 2008 at 03:44 AM

Hello Group,

I've to get data from some tables with similar structure. So I decided
to write an
Unix shellscript to mask SQL staments (like: SELECT G.$
{DealClass}_Id... which will expanded to SELECT G.CarDeals_Id )
and then pass them to isql via

isql -w5000 -s";" <<EOF | grep -iv "\-\-\-" | grep -iv "row" | grep -v
"^$" | sed 's/^;//g' >> ${RptSQLResult_Deals}

Now the problem is that fields with Comments exist. This fields can
have a ";" in the field content.

Sample outputfile generated via isql:
1234;FORD;Mustang D12A;120000;USD;Cool car; call Mr. Jon Doe;<other
fields...>

This would result into an error while im****ting by external app which
interpretes ";" in the comment line as delimiter.

By contrast Re****tBatch would generate this above as:

Sample outputfile generated via Re****tBatch:
1234;"FORD";"Mustang D12A";120000;"USD";"Cool car; call Mr. Jon
Doe";<other fields...>

which is correct / requested.

So the question is, exists command line parameters to isql to say that
String/Varchar fields have to be quoted with "" or is Re****tBatch my
only possibility (which causes into fully change my application).

Thanks in Advance
 Celal Dikici
 




 3 Posts in Topic:
Using quotes in isql for varchar fields
Celal Dikici <CDikici@  2008-04-30 03:44:33 
Re: Using quotes in isql for varchar fields
Manish Negandhi <negan  2008-04-30 04:13:22 
Re: Using quotes in isql for varchar fields
bret@[EMAIL PROTECTED]   2008-04-30 08:53:15 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan13V112 Sun Jul 6 0:34:58 CDT 2008.