Support Support Downloads Knowledge Base Juniper Support Portal Community

Knowledge Base

Search our Knowledge Base sites to find answers to your questions.

Ask All Knowledge Base Sites All Knowledge Base Sites JunosE Defect (KA)Knowledge BaseSecurity AdvisoriesTechnical BulletinsTechnotes Sign in to display secure content and recently viewed articles

SQL statements longer the 500 characters on a single line fail to execute

0

0

Article ID: KB12518 KB Last Updated: 04 Mar 2017Version: 3.0
Summary:

SQL statements inside of a sqlauth.aut or sqlauth.acc file fail to execute if the length is over 500 characters in length on a single line

Symptoms:

A customer is attempting to use an SQL insert statement or SQL select statement with the appropriate configuration file, a message indicating a failure will be logged and the transaction will fail to execute.

For example, the following SQL statement would fail and the associated failure in the SBR log:

 

SQL=INSERT INTO RADIUS_STAGE (TS, USER_NAME, FRAMED_IP_ADDRESS, ACCT_SESSION_ID, ACCT_SESSION_TIME, NAS_IDENTIFIER, CALLING_STATION_ID, CALLED_STATION_ID, ACCT_STATUS_TYPE, NAS_IP_ADDRESS, ACCT_INPUT_OCTETS, NAS_PORT, NAS_PORT_TYPE, RB_NAS_REAL_PORT) VALUES (to_timestamp(%TransactionTime, 'DY MON DD HH24:MI:SS YYYY'), @User-Name, @Framed-IP-Address, @Acct-Session-Id, @Acct-Session-Time, @NAS-Identifier, @Calling-Station-Id, @Called-Station-Id, @Acct-Status-Type, @NAS-IP-Address, @Acct-Input-Octets, @NAS-Port, @NAS-Port-Type, @RB-NAS_Real_Port)

Here is the log error message during SBR startup:
10/20/2008 15:18:00 SQL statement parameter has invalid name: @NAS-Por
10/20/2008 15:18:00 SQL statement parameter has invalid name: @NAS-Por
10/20/2008 15:18:00 SQL statement parameter has invalid name: @NAS-Por
Solution:

SBR cannot read a single line greater then 500 characters in length. For this reason, SBR allows the use of a continuation character. Use a backslash ‘\’ to break up the line at roughly 80 character intervals. This will not only resolve the error, but it will make the statement easier to read.

Below is a corrected SQL statement:

SQL=INSERT INTO RADIUS_STAGE (TS, USER_NAME, FRAMED_IP_ADDRESS, ACCT_SESSION_ID, ACCT_SESSION_TIME, \

NAS_IDENTIFIER, CALLING_STATION_ID, CALLED_STATION_ID, ACCT_STATUS_TYPE, NAS_IP_ADDRESS, ACCT_INPUT_OCTETS, \
NAS_PORT, NAS_PORT_TYPE, RB_NAS_REAL_PORT) \
VALUES (to_timestamp(%TransactionTime, 'DY MON DD HH24:MI:SS YYYY'),\  @User-Name, @Framed-IP-Address, \
@Acct-Session-Id, @Acct-Session-Time, @NAS-Identifier, @Calling-Station-Id, @Called-Station-Id, \
@Acct-Status-Type, @NAS-IP-Address, @Acct-Input-Octets, @NAS-Port, @NAS-Port-Type, @RB-NAS_Real_Port)

Note: We use the ‘\’ character at the end of each line one space after the last character. Failure to separate the ‘\’ from the end of the line could result in a failure.


For more information on the use of the continuation character, refer to the Steel-Belted RADIUS Refernce guide specific to your version
 

Comment on this article > Affected Products Browse the Knowledge Base for more articles related to these product categories. Select a category to begin.

Getting Up and Running with Junos

Getting Up and Running with Junos Security Alerts and Vulnerabilities Product Alerts and Software Release Notices Problem Report (PR) Search Tool EOL Notices and Bulletins JTAC User Guide Customer Care User Guide Pathfinder SRX High Availability Configurator SRX VPN Configurator Training Courses and Videos End User Licence Agreement Global Search