Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2003
    Posts
    35

    Red face Unanswered: Add special character?

    HI Expert

    Is it possible to add special character (carriage return) inside the sql statement in sybase 11.5?

    I am trying to do this:

    Select 'Select count(*) from ' + name + Chr(13) + 'go' from sysobjects where type='U'


    The purpose of doing this is i want to output the above statement to a file so that produce like following sql

    Select count(*) from <table 1>
    go
    Select count(*) from <table 1>
    go
    ...etc

    If i can get the file correctly i can put them isql.

    I know function Chr(13) is not sybase function but i do not know yet the correct function so i just put it in.

    Any help is appreciated.


    Regards

  2. #2
    Join Date
    Dec 2002
    Posts
    104

    Re: Add special character?

    Originally posted by msetjadi
    HI Expert

    Is it possible to add special character (carriage return) inside the sql statement in sybase 11.5?

    I am trying to do this:

    Select 'Select count(*) from ' + name + Chr(13) + 'go' from sysobjects where type='U'


    The purpose of doing this is i want to output the above statement to a file so that produce like following sql

    Select count(*) from <table 1>
    go
    Select count(*) from <table 1>
    go
    ...etc

    If i can get the file correctly i can put them isql.

    I know function Chr(13) is not sybase function but i do not know yet the correct function so i just put it in.

    Any help is appreciated.


    Regards

    hello,

    try to use char(13)

    if u using some interface like sqladv,etc

    example: select 'selct count(*) from '+name + char(13)+'go'
    from sysobjects
    where type = 'U'

    result set will shown some thing like :
    Select count(*) from WHOLEGOOD_ORDER_EVENT|go
    Select count(*) from CNH_INVENTORY|go
    Select count(*) from EXPORT_DATA|go
    Select count(*) from IMPORT_DATA_VALID_UNIT|go
    Select count(*) from FORECAST_NAME|go
    Select count(*) from CNH_ORDER_MANAGEMENT|go

    but it will actually get stored in file as:
    Select count(*) from WHOLEGOOD_ORDER_EVENT
    go
    Select count(*) from CNH_INVENTORY
    go
    Select count(*) from EXPORT_DATA
    go
    Select count(*) from IMPORT_DATA_VALID_UNIT
    go
    Select count(*) from FORECAST_NAME
    go
    Select count(*) from CNH_ORDER_MANAGEMENT
    go

    hope this will meet ur requirements,
    Pooja

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •