Skip to main content
added 20 characters in body
Source Link
Romeo Ninov
  • 19.5k
  • 5
  • 34
  • 48

I have an Oracle database table that is storing the full path and name of a file in a table column. In a SQL client I can run:

select file_name from table where request_id=12345

and I will get this result:

/home/example_path/example_file_name_1.xls

In a bash script I have this statement (which I largely copied from another example I'm working from):

# Get Actual Output File Name
VREQID=12345
ATTACH_FILE=$(sqlplus -s $ORA_USER_PSSWD <<-EOQ3
set heading off 
set feedback off 
set pagesize 0 
set sqlprompt "" 
set verify off 
set pause off
select file_name from table where request_id=($VREQID)
/
EOQ3
)
echo 'ATTACH_FILE: ' "$ATTACH_FILE"
# Script continues...

My echo statement is then showing:

/home/example_path/example_file_name_ 1.xls

There's a space between the underscore and the 1. I've tried using quotes to prevent this but it didn't help.

What is causing this and how do I prevent this?

I have an Oracle database table that is storing the full path and name of a file in a table column. In a SQL client I can run:

select file_name from table where request_id=12345

and I will get this result:

/home/example_path/example_file_name_1.xls

In a bash script I have this statement (which I largely copied from another example I'm working from):

# Get Actual Output File Name
VREQID=12345
ATTACH_FILE=$(sqlplus -s $ORA_USER_PSSWD <<-EOQ3
set heading off 
feedback off 
pagesize 0 
sqlprompt "" 
verify off 
pause off
select file_name from table where request_id=($VREQID)
/
EOQ3
)
echo 'ATTACH_FILE: ' "$ATTACH_FILE"
# Script continues...

My echo statement is then showing:

/home/example_path/example_file_name_ 1.xls

There's a space between the underscore and the 1. I've tried using quotes to prevent this but it didn't help.

What is causing this and how do I prevent this?

I have an Oracle database table that is storing the full path and name of a file in a table column. In a SQL client I can run:

select file_name from table where request_id=12345

and I will get this result:

/home/example_path/example_file_name_1.xls

In a bash script I have this statement (which I largely copied from another example I'm working from):

# Get Actual Output File Name
VREQID=12345
ATTACH_FILE=$(sqlplus -s $ORA_USER_PSSWD <<-EOQ3
set heading off 
set feedback off 
set pagesize 0 
set sqlprompt "" 
set verify off 
set pause off
select file_name from table where request_id=($VREQID)
/
EOQ3
)
echo 'ATTACH_FILE: ' "$ATTACH_FILE"
# Script continues...

My echo statement is then showing:

/home/example_path/example_file_name_ 1.xls

There's a space between the underscore and the 1. I've tried using quotes to prevent this but it didn't help.

What is causing this and how do I prevent this?

format sql code
Source Link
Romeo Ninov
  • 19.5k
  • 5
  • 34
  • 48

I have an Oracle database table that is storing the full path and name of a file in a table column. In a SQL client I can run:

select file_name from table where request_id=12345

and I will get this result:

/home/example_path/example_file_name_1.xls

In a bash script I have this statement (which I largely copied from another example I'm working from):

# Get Actual Output File Name
VREQID=12345
ATTACH_FILE=$(sqlplus -s $ORA_USER_PSSWD <<-EOQ3
set heading off  
feedback off  
pagesize 0  
sqlprompt ""  
verify off  
pause off
select file_name from table where request_id=($VREQID)
/
EOQ3
)
echo 'ATTACH_FILE: ' "$ATTACH_FILE"
# Script continues...

My echo statement is then showing:

/home/example_path/example_file_name_ 1.xls

There's a space between the underscore and the 1. I've tried using quotes to prevent this but it didn't help.

What is causing this and how do I prevent this?

I have an Oracle database table that is storing the full path and name of a file in a table column. In a SQL client I can run:

select file_name from table where request_id=12345

and I will get this result:

/home/example_path/example_file_name_1.xls

In a bash script I have this statement (which I largely copied from another example I'm working from):

# Get Actual Output File Name
VREQID=12345
ATTACH_FILE=$(sqlplus -s $ORA_USER_PSSWD <<-EOQ3
set heading off feedback off pagesize 0 sqlprompt "" verify off pause off
select file_name from table where request_id=($VREQID)
/
EOQ3
)
echo 'ATTACH_FILE: ' "$ATTACH_FILE"
# Script continues...

My echo statement is then showing:

/home/example_path/example_file_name_ 1.xls

There's a space between the underscore and the 1. I've tried using quotes to prevent this but it didn't help.

What is causing this and how do I prevent this?

I have an Oracle database table that is storing the full path and name of a file in a table column. In a SQL client I can run:

select file_name from table where request_id=12345

and I will get this result:

/home/example_path/example_file_name_1.xls

In a bash script I have this statement (which I largely copied from another example I'm working from):

# Get Actual Output File Name
VREQID=12345
ATTACH_FILE=$(sqlplus -s $ORA_USER_PSSWD <<-EOQ3
set heading off  
feedback off  
pagesize 0  
sqlprompt ""  
verify off  
pause off
select file_name from table where request_id=($VREQID)
/
EOQ3
)
echo 'ATTACH_FILE: ' "$ATTACH_FILE"
# Script continues...

My echo statement is then showing:

/home/example_path/example_file_name_ 1.xls

There's a space between the underscore and the 1. I've tried using quotes to prevent this but it didn't help.

What is causing this and how do I prevent this?

edited tags
Link
jesse_b
  • 41.6k
  • 14
  • 108
  • 162
deleted 151 characters in body
Source Link
Rui F Ribeiro
  • 58k
  • 28
  • 156
  • 238
Loading
Source Link
Loading